Skip to content

Commit

Permalink
Make dlfilter backend less aggressive about filtering out errors
Browse files Browse the repository at this point in the history
Ref #260
  • Loading branch information
Xyene committed Nov 16, 2022
1 parent c73a4cf commit 662f689
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/perf_dlfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ int filter_event_early(void *data, const struct perf_dlfilter_sample *sample,
perf_dlfilter_fns.resolve_ip(ctx);
const struct perf_dlfilter_al *resolved_addr =
perf_dlfilter_fns.resolve_addr(ctx);
if (!resolved_ip || !resolved_ip->sym || !resolved_addr ||
!resolved_addr->sym ||

// Only filter out events we for sure don't want. It's better to be less aggressive than
// too aggressive, as being too aggressive will lead to broken traces, while being not
// aggressive enough just makes things slower.
if (resolved_ip && resolved_ip->sym && resolved_addr && resolved_addr->sym &&
strcmp(resolved_ip->sym, resolved_addr->sym) == 0) {
return 1;
}

return 0;
}

0 comments on commit 662f689

Please sign in to comment.