Skip to content

Commit

Permalink
perf symbols: Apply all filters to an addr_location
Browse files Browse the repository at this point in the history
Instead of bailing out as soon as we find a filter that applies, go on
checking all of them so that we can zoom in/out filters.

We also need to make sure we only update al->filtered after
thread__find_addr_map(), because there is where al->filtered gets
initialized to zero.

This will increase the cost of processing when all we don't need this
toggling, but will provide flexibility for the TUI and GTK+ interfaces,
that will incur in creating the hist_entries just once.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-fhv9lhzdjxgp9w3w3668lsfw@git.kernel.org
[ yanked this out of a previous patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
namhyung authored and acmel committed Mar 18, 2014
1 parent b3cef7f commit 466fa76
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions tools/perf/util/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,11 +793,6 @@ int perf_event__preprocess_sample(const union perf_event *event,
if (thread == NULL)
return -1;

if (thread__is_filtered(thread)) {
al->filtered |= (1 << HIST_FILTER__THREAD);
goto out_filtered;
}

dump_printf(" ... thread: %s:%d\n", thread__comm_str(thread), thread->tid);
/*
* Have we already created the kernel maps for this machine?
Expand All @@ -815,6 +810,10 @@ int perf_event__preprocess_sample(const union perf_event *event,
dump_printf(" ...... dso: %s\n",
al->map ? al->map->dso->long_name :
al->level == 'H' ? "[hypervisor]" : "<not found>");

if (thread__is_filtered(thread))
al->filtered |= (1 << HIST_FILTER__THREAD);

al->sym = NULL;
al->cpu = sample->cpu;

Expand All @@ -828,7 +827,6 @@ int perf_event__preprocess_sample(const union perf_event *event,
strlist__has_entry(symbol_conf.dso_list,
dso->long_name))))) {
al->filtered |= (1 << HIST_FILTER__DSO);
goto out_filtered;
}

al->sym = map__find_symbol(al->map, al->addr,
Expand All @@ -839,11 +837,7 @@ int perf_event__preprocess_sample(const union perf_event *event,
(!al->sym || !strlist__has_entry(symbol_conf.sym_list,
al->sym->name))) {
al->filtered |= (1 << HIST_FILTER__SYMBOL);
goto out_filtered;
}

return 0;

out_filtered:
return 0;
}

0 comments on commit 466fa76

Please sign in to comment.