diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-03-17 16:12:27 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-03-18 17:16:58 -0400 |
commit | 466fa7647413665dcba46c4f7f2b4a9808426989 (patch) | |
tree | 8c2f720801a2c34d14319d269e2de33553387294 /tools/perf | |
parent | b3cef7f60f17d953545f7069f6407fc24202a64d (diff) |
perf symbols: Apply all filters to an addr_location
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>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/event.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 0da09db5f9f6..ebb48a623407 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -793,11 +793,6 @@ int perf_event__preprocess_sample(const union perf_event *event, | |||
793 | if (thread == NULL) | 793 | if (thread == NULL) |
794 | return -1; | 794 | return -1; |
795 | 795 | ||
796 | if (thread__is_filtered(thread)) { | ||
797 | al->filtered |= (1 << HIST_FILTER__THREAD); | ||
798 | goto out_filtered; | ||
799 | } | ||
800 | |||
801 | dump_printf(" ... thread: %s:%d\n", thread__comm_str(thread), thread->tid); | 796 | dump_printf(" ... thread: %s:%d\n", thread__comm_str(thread), thread->tid); |
802 | /* | 797 | /* |
803 | * Have we already created the kernel maps for this machine? | 798 | * Have we already created the kernel maps for this machine? |
@@ -815,6 +810,10 @@ int perf_event__preprocess_sample(const union perf_event *event, | |||
815 | dump_printf(" ...... dso: %s\n", | 810 | dump_printf(" ...... dso: %s\n", |
816 | al->map ? al->map->dso->long_name : | 811 | al->map ? al->map->dso->long_name : |
817 | al->level == 'H' ? "[hypervisor]" : "<not found>"); | 812 | al->level == 'H' ? "[hypervisor]" : "<not found>"); |
813 | |||
814 | if (thread__is_filtered(thread)) | ||
815 | al->filtered |= (1 << HIST_FILTER__THREAD); | ||
816 | |||
818 | al->sym = NULL; | 817 | al->sym = NULL; |
819 | al->cpu = sample->cpu; | 818 | al->cpu = sample->cpu; |
820 | 819 | ||
@@ -828,7 +827,6 @@ int perf_event__preprocess_sample(const union perf_event *event, | |||
828 | strlist__has_entry(symbol_conf.dso_list, | 827 | strlist__has_entry(symbol_conf.dso_list, |
829 | dso->long_name))))) { | 828 | dso->long_name))))) { |
830 | al->filtered |= (1 << HIST_FILTER__DSO); | 829 | al->filtered |= (1 << HIST_FILTER__DSO); |
831 | goto out_filtered; | ||
832 | } | 830 | } |
833 | 831 | ||
834 | al->sym = map__find_symbol(al->map, al->addr, | 832 | al->sym = map__find_symbol(al->map, al->addr, |
@@ -839,11 +837,7 @@ int perf_event__preprocess_sample(const union perf_event *event, | |||
839 | (!al->sym || !strlist__has_entry(symbol_conf.sym_list, | 837 | (!al->sym || !strlist__has_entry(symbol_conf.sym_list, |
840 | al->sym->name))) { | 838 | al->sym->name))) { |
841 | al->filtered |= (1 << HIST_FILTER__SYMBOL); | 839 | al->filtered |= (1 << HIST_FILTER__SYMBOL); |
842 | goto out_filtered; | ||
843 | } | 840 | } |
844 | 841 | ||
845 | return 0; | 842 | return 0; |
846 | |||
847 | out_filtered: | ||
848 | return 0; | ||
849 | } | 843 | } |