diff --git a/src/perf_dlfilter.c b/src/perf_dlfilter.c index ab8e89627..c3d462bd4 100644 --- a/src/perf_dlfilter.c +++ b/src/perf_dlfilter.c @@ -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; }