diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-10-13 08:06:54 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-10-13 09:29:17 -0400 |
commit | e345fa185ad805cbd3be3397b3cba32bc42ef571 (patch) | |
tree | aa548f1267b6ecf63f22cd036c75b28a5be375f6 /tools/perf/builtin-top.c | |
parent | ed7e5662ddff6a60bdae830ff65547c2eeed6f9a (diff) |
perf top: Remove entries from entries_collapsed on decay
We were removing only when using a --sort order that needs collapsing,
while we also use it in the threaded case, causing memory corruption
because we were scribbling freed hist entries, oops.
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-k16fb4jsulr7x0ixv43amb6d@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index de3cb1e00f9e..e211304a0dd7 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -304,7 +304,7 @@ 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(&top.sym_evsel->hists); | 307 | hists__decay_entries_threaded(&top.sym_evsel->hists); |
308 | hists__output_recalc_col_len(&top.sym_evsel->hists, winsize.ws_row - 3); | 308 | hists__output_recalc_col_len(&top.sym_evsel->hists, winsize.ws_row - 3); |
309 | putchar('\n'); | 309 | putchar('\n'); |
310 | hists__fprintf(&top.sym_evsel->hists, NULL, false, false, | 310 | hists__fprintf(&top.sym_evsel->hists, NULL, false, false, |
@@ -555,7 +555,7 @@ static void perf_top__sort_new_samples(void *arg) | |||
555 | 555 | ||
556 | hists__collapse_resort_threaded(&t->sym_evsel->hists); | 556 | hists__collapse_resort_threaded(&t->sym_evsel->hists); |
557 | hists__output_resort_threaded(&t->sym_evsel->hists); | 557 | hists__output_resort_threaded(&t->sym_evsel->hists); |
558 | hists__decay_entries(&t->sym_evsel->hists); | 558 | hists__decay_entries_threaded(&t->sym_evsel->hists); |
559 | hists__output_recalc_col_len(&t->sym_evsel->hists, winsize.ws_row - 3); | 559 | hists__output_recalc_col_len(&t->sym_evsel->hists, winsize.ws_row - 3); |
560 | } | 560 | } |
561 | 561 | ||