aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-10-17 15:43:43 -0400
committerIngo Molnar <mingo@elte.hu>2011-10-17 15:43:43 -0400
commitee8f967b15179c34b923c9b87c06984e682b24cf (patch)
tree7ae0c4cff2ebcb4fd952f1cbf286456961d39a7b
parent53b0a61a9d31ef9b4256558c671094576e8eaf65 (diff)
parent7bc7298d3f63e55591477752eb809ab17031ec19 (diff)
Merge branch 'perf/core' of git://github.com/acmel/linux into perf/core
-rw-r--r--tools/perf/builtin-top.c9
-rw-r--r--tools/perf/util/hist.c17
-rw-r--r--tools/perf/util/hist.h5
-rw-r--r--tools/perf/util/ui/helpline.h1
4 files changed, 22 insertions, 10 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index e211304a0dd7..7a871714d44e 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,
@@ -436,6 +438,7 @@ static int key_mapped(int c)
436 case 'S': 438 case 'S':
437 return 1; 439 return 1;
438 case 'E': 440 case 'E':
441 return top.evlist->nr_entries > 1 ? 1 : 0;
439 default: 442 default:
440 break; 443 break;
441 } 444 }
@@ -555,7 +558,9 @@ static void perf_top__sort_new_samples(void *arg)
555 558
556 hists__collapse_resort_threaded(&t->sym_evsel->hists); 559 hists__collapse_resort_threaded(&t->sym_evsel->hists);
557 hists__output_resort_threaded(&t->sym_evsel->hists); 560 hists__output_resort_threaded(&t->sym_evsel->hists);
558 hists__decay_entries_threaded(&t->sym_evsel->hists); 561 hists__decay_entries_threaded(&t->sym_evsel->hists,
562 top.hide_user_symbols,
563 top.hide_kernel_symbols);
559 hists__output_recalc_col_len(&t->sym_evsel->hists, winsize.ws_row - 3); 564 hists__output_recalc_col_len(&t->sym_evsel->hists, winsize.ws_row - 3);
560} 565}
561 566
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);
diff --git a/tools/perf/util/ui/helpline.h b/tools/perf/util/ui/helpline.h
index 809975759080..fdcbc0270acd 100644
--- a/tools/perf/util/ui/helpline.h
+++ b/tools/perf/util/ui/helpline.h
@@ -2,6 +2,7 @@
2#define _PERF_UI_HELPLINE_H_ 1 2#define _PERF_UI_HELPLINE_H_ 1
3 3
4#include <stdio.h> 4#include <stdio.h>
5#include <stdarg.h>
5 6
6void ui_helpline__init(void); 7void ui_helpline__init(void);
7void ui_helpline__pop(void); 8void ui_helpline__pop(void);