aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-07-21 08:19:41 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-07-23 07:55:59 -0400
commit7a007ca90b7c465137de06795ef4d5faa10f459e (patch)
tree3d84aac112f4389381dfb40aaf78dc1595b3c598 /tools
parent3a01736e70a7d629140695ba46a901266b4460cc (diff)
perf hists: Mark entries filtered by parent
And don't consider them in hists__inc_nr_entries. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/hist.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 7b5848ce1505..d998d1d706eb 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -5,6 +5,12 @@
5#include "sort.h" 5#include "sort.h"
6#include <math.h> 6#include <math.h>
7 7
8enum hist_filter {
9 HIST_FILTER__DSO,
10 HIST_FILTER__THREAD,
11 HIST_FILTER__PARENT,
12};
13
8struct callchain_param callchain_param = { 14struct callchain_param callchain_param = {
9 .mode = CHAIN_GRAPH_REL, 15 .mode = CHAIN_GRAPH_REL,
10 .min_percent = 0.5 16 .min_percent = 0.5
@@ -52,11 +58,20 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template)
52 58
53static void hists__inc_nr_entries(struct hists *self, struct hist_entry *entry) 59static void hists__inc_nr_entries(struct hists *self, struct hist_entry *entry)
54{ 60{
61 if (entry->filtered)
62 return;
55 if (entry->ms.sym && self->max_sym_namelen < entry->ms.sym->namelen) 63 if (entry->ms.sym && self->max_sym_namelen < entry->ms.sym->namelen)
56 self->max_sym_namelen = entry->ms.sym->namelen; 64 self->max_sym_namelen = entry->ms.sym->namelen;
57 ++self->nr_entries; 65 ++self->nr_entries;
58} 66}
59 67
68static u8 symbol__parent_filter(const struct symbol *parent)
69{
70 if (symbol_conf.exclude_other && parent == NULL)
71 return 1 << HIST_FILTER__PARENT;
72 return 0;
73}
74
60struct hist_entry *__hists__add_entry(struct hists *self, 75struct hist_entry *__hists__add_entry(struct hists *self,
61 struct addr_location *al, 76 struct addr_location *al,
62 struct symbol *sym_parent, u64 period) 77 struct symbol *sym_parent, u64 period)
@@ -75,6 +90,7 @@ struct hist_entry *__hists__add_entry(struct hists *self,
75 .level = al->level, 90 .level = al->level,
76 .period = period, 91 .period = period,
77 .parent = sym_parent, 92 .parent = sym_parent,
93 .filtered = symbol__parent_filter(sym_parent),
78 }; 94 };
79 int cmp; 95 int cmp;
80 96
@@ -790,11 +806,6 @@ print_entries:
790 return ret; 806 return ret;
791} 807}
792 808
793enum hist_filter {
794 HIST_FILTER__DSO,
795 HIST_FILTER__THREAD,
796};
797
798static void hists__remove_entry_filter(struct hists *self, struct hist_entry *h, 809static void hists__remove_entry_filter(struct hists *self, struct hist_entry *h,
799 enum hist_filter filter) 810 enum hist_filter filter)
800{ 811{