From 90edcbde0318689ab1dd5c8e1b74261bd4c39754 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Thu, 13 Oct 2011 09:06:54 -0300 Subject: [PATCH] --- yaml --- r: 269087 b: refs/heads/master c: e345fa185ad805cbd3be3397b3cba32bc42ef571 h: refs/heads/master i: 269085: cb931c1380de4a7825bfedd2f0c629bf978f0ea7 269083: 1858afd1499f544dda25ffa29cc3cb9e99ac61e4 269079: c8fedb6f276868505faed2f4a757f8fadfbdb4a4 269071: 4d93091c817a12099b8bb3ca684bdfce1e58b61b 269055: 1a7b06a4e2b8d50267c4e5d2de10674d53b690bb v: v3 --- [refs] | 2 +- trunk/tools/perf/builtin-top.c | 4 ++-- trunk/tools/perf/util/hist.c | 14 ++++++++++++-- trunk/tools/perf/util/hist.h | 1 + 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 4d0cf4bb0c40..990873d13e2b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ed7e5662ddff6a60bdae830ff65547c2eeed6f9a +refs/heads/master: e345fa185ad805cbd3be3397b3cba32bc42ef571 diff --git a/trunk/tools/perf/builtin-top.c b/trunk/tools/perf/builtin-top.c index de3cb1e00f9e..e211304a0dd7 100644 --- a/trunk/tools/perf/builtin-top.c +++ b/trunk/tools/perf/builtin-top.c @@ -304,7 +304,7 @@ static void print_sym_table(void) hists__collapse_resort_threaded(&top.sym_evsel->hists); hists__output_resort_threaded(&top.sym_evsel->hists); - hists__decay_entries(&top.sym_evsel->hists); + hists__decay_entries_threaded(&top.sym_evsel->hists); hists__output_recalc_col_len(&top.sym_evsel->hists, winsize.ws_row - 3); putchar('\n'); hists__fprintf(&top.sym_evsel->hists, NULL, false, false, @@ -555,7 +555,7 @@ static void perf_top__sort_new_samples(void *arg) hists__collapse_resort_threaded(&t->sym_evsel->hists); hists__output_resort_threaded(&t->sym_evsel->hists); - hists__decay_entries(&t->sym_evsel->hists); + hists__decay_entries_threaded(&t->sym_evsel->hists); hists__output_recalc_col_len(&t->sym_evsel->hists, winsize.ws_row - 3); } diff --git a/trunk/tools/perf/util/hist.c b/trunk/tools/perf/util/hist.c index 9b9d12bbdc1d..a7193c5a0422 100644 --- a/trunk/tools/perf/util/hist.c +++ b/trunk/tools/perf/util/hist.c @@ -108,7 +108,7 @@ static bool hists__decay_entry(struct hists *hists, struct hist_entry *he) return he->period == 0; } -void hists__decay_entries(struct hists *hists) +static void __hists__decay_entries(struct hists *hists, bool threaded) { struct rb_node *next = rb_first(&hists->entries); struct hist_entry *n; @@ -124,7 +124,7 @@ void hists__decay_entries(struct hists *hists) if (hists__decay_entry(hists, n) && !n->used) { rb_erase(&n->rb_node, &hists->entries); - if (sort__need_collapse) + if (sort__need_collapse || threaded) rb_erase(&n->rb_node_in, &hists->entries_collapsed); hist_entry__free(n); @@ -133,6 +133,16 @@ void hists__decay_entries(struct hists *hists) } } +void hists__decay_entries(struct hists *hists) +{ + return __hists__decay_entries(hists, false); +} + +void hists__decay_entries_threaded(struct hists *hists) +{ + return __hists__decay_entries(hists, true); +} + /* * histogram, sorted on item, collects periods */ diff --git a/trunk/tools/perf/util/hist.h b/trunk/tools/perf/util/hist.h index 7416521f7fea..bcc8ab91e26f 100644 --- a/trunk/tools/perf/util/hist.h +++ b/trunk/tools/perf/util/hist.h @@ -79,6 +79,7 @@ void hists__collapse_resort(struct hists *self); void hists__collapse_resort_threaded(struct hists *hists); void hists__decay_entries(struct hists *hists); +void hists__decay_entries_threaded(struct hists *hists); void hists__output_recalc_col_len(struct hists *hists, int max_rows); void hists__inc_nr_events(struct hists *self, u32 type);