aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-10-17 07:05:04 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-10-17 07:05:04 -0400
commitb079d4e975b6338bcf8f8868eb2b3d3fd867b933 (patch)
treea8758ecb16f56a4f457c67351a5541d308247624 /tools
parentc73a3cb356f94b443aa7624b539493191dbf44c1 (diff)
perf top: Honour --hide_{user,kernel}_symbols and the 'U' hotkey
The new decay routine (__hists__decay_entries) wasn't being passed the toggles, fix it. Reported-by: Mike Galbraith <efault@gmx.de> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-hg6m0mi1colket982oq9hhly@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-top.c8
-rw-r--r--tools/perf/util/hist.c17
-rw-r--r--tools/perf/util/hist.h5
3 files changed, 20 insertions, 10 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index e211304a0dd7..bf368f1663d1 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -304,7 +304,9 @@ static void print_sym_table(void)
304 304
305 hists__collapse_resort_threaded(&top.sym_evsel->hists); 305 hists__collapse_resort_threaded(&top.sym_evsel->hists);
306 hists__output_resort_threaded(&top.sym_evsel->hists); 306 hists__output_resort_threaded(&top.sym_evsel->hists);
307 hists__decay_entries_threaded(&top.sym_evsel->hists); 307 hists__decay_entries_threaded(&top.sym_evsel->hists,
308 top.hide_user_symbols,
309 top.hide_kernel_symbols);
308 hists__output_recalc_col_len(&top.sym_evsel->hists, winsize.ws_row - 3); 310 hists__output_recalc_col_len(&top.sym_evsel->hists, winsize.ws_row - 3);
309 putchar('\n'); 311 putchar('\n');
310 hists__fprintf(&top.sym_evsel->hists, NULL, false, false, 312 hists__fprintf(&top.sym_evsel->hists, NULL, false, false,
@@ -555,7 +557,9 @@ static void perf_top__sort_new_samples(void *arg)
555 557
556 hists__collapse_resort_threaded(&t->sym_evsel->hists); 558 hists__collapse_resort_threaded(&t->sym_evsel->hists);
557 hists__output_resort_threaded(&t->sym_evsel->hists); 559 hists__output_resort_threaded(&t->sym_evsel->hists);
558 hists__decay_entries_threaded(&t->sym_evsel->hists); 560 hists__decay_entries_threaded(&t->sym_evsel->hists,
561 top.hide_user_symbols,
562 top.hide_kernel_symbols);
559 hists__output_recalc_col_len(&t->sym_evsel->hists, winsize.ws_row - 3); 563 hists__output_recalc_col_len(&t->sym_evsel->hists, winsize.ws_row - 3);
560} 564}
561 565
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index a7193c5a0422..48da373afa3d 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -108,7 +108,8 @@ static bool hists__decay_entry(struct hists *hists, struct hist_entry *he)
108 return he->period == 0; 108 return he->period == 0;
109} 109}
110 110
111static void __hists__decay_entries(struct hists *hists, bool threaded) 111static void __hists__decay_entries(struct hists *hists, bool zap_user,
112 bool zap_kernel, bool threaded)
112{ 113{
113 struct rb_node *next = rb_first(&hists->entries); 114 struct rb_node *next = rb_first(&hists->entries);
114 struct hist_entry *n; 115 struct hist_entry *n;
@@ -121,7 +122,10 @@ static void __hists__decay_entries(struct hists *hists, bool threaded)
121 * case some it gets new samples, we'll eventually free it when 122 * case some it gets new samples, we'll eventually free it when
122 * the user stops browsing and it agains gets fully decayed. 123 * the user stops browsing and it agains gets fully decayed.
123 */ 124 */
124 if (hists__decay_entry(hists, n) && !n->used) { 125 if (((zap_user && n->level == '.') ||
126 (zap_kernel && n->level != '.') ||
127 hists__decay_entry(hists, n)) &&
128 !n->used) {
125 rb_erase(&n->rb_node, &hists->entries); 129 rb_erase(&n->rb_node, &hists->entries);
126 130
127 if (sort__need_collapse || threaded) 131 if (sort__need_collapse || threaded)
@@ -133,14 +137,15 @@ static void __hists__decay_entries(struct hists *hists, bool threaded)
133 } 137 }
134} 138}
135 139
136void hists__decay_entries(struct hists *hists) 140void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel)
137{ 141{
138 return __hists__decay_entries(hists, false); 142 return __hists__decay_entries(hists, zap_user, zap_kernel, false);
139} 143}
140 144
141void hists__decay_entries_threaded(struct hists *hists) 145void hists__decay_entries_threaded(struct hists *hists,
146 bool zap_user, bool zap_kernel)
142{ 147{
143 return __hists__decay_entries(hists, true); 148 return __hists__decay_entries(hists, zap_user, zap_kernel, true);
144} 149}
145 150
146/* 151/*
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index bcc8ab91e26f..ea96c1cbb850 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -78,8 +78,9 @@ void hists__output_resort_threaded(struct hists *hists);
78void hists__collapse_resort(struct hists *self); 78void hists__collapse_resort(struct hists *self);
79void hists__collapse_resort_threaded(struct hists *hists); 79void hists__collapse_resort_threaded(struct hists *hists);
80 80
81void hists__decay_entries(struct hists *hists); 81void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel);
82void hists__decay_entries_threaded(struct hists *hists); 82void hists__decay_entries_threaded(struct hists *hists, bool zap_user,
83 bool zap_kernel);
83void hists__output_recalc_col_len(struct hists *hists, int max_rows); 84void hists__output_recalc_col_len(struct hists *hists, int max_rows);
84 85
85void hists__inc_nr_events(struct hists *self, u32 type); 86void hists__inc_nr_events(struct hists *self, u32 type);