From d7b76f0935d294e9abaac1577cdc2137eff15a49 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 18 Oct 2011 19:07:34 -0200 Subject: perf hists: Move the dso and thread filters from hist_browser Since with dynamic addition of new hist entries we need to apply those filters as we merge new batches of hist_entry instances, for instance in perf top. Cc: David Ahern Cc: Frederic Weisbecker Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-zjhhf8kh9w1buty9p10od6rz@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/hist.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tools/perf/util/hist.c') diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 8d15e9f72f0..fdff2a8288b 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1087,7 +1087,7 @@ static void hists__remove_entry_filter(struct hists *hists, struct hist_entry *h hists__calc_col_len(hists, h); } -void hists__filter_by_dso(struct hists *hists, const struct dso *dso) +void hists__filter_by_dso(struct hists *hists) { struct rb_node *nd; @@ -1101,7 +1101,8 @@ void hists__filter_by_dso(struct hists *hists, const struct dso *dso) if (symbol_conf.exclude_other && !h->parent) continue; - if (dso != NULL && (h->ms.map == NULL || h->ms.map->dso != dso)) { + if (hists->dso_filter != NULL && + (h->ms.map == NULL || h->ms.map->dso != hists->dso_filter)) { h->filtered |= (1 << HIST_FILTER__DSO); continue; } @@ -1110,7 +1111,7 @@ void hists__filter_by_dso(struct hists *hists, const struct dso *dso) } } -void hists__filter_by_thread(struct hists *hists, const struct thread *thread) +void hists__filter_by_thread(struct hists *hists) { struct rb_node *nd; @@ -1121,7 +1122,8 @@ void hists__filter_by_thread(struct hists *hists, const struct thread *thread) for (nd = rb_first(&hists->entries); nd; nd = rb_next(nd)) { struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); - if (thread != NULL && h->thread != thread) { + if (hists->thread_filter != NULL && + h->thread != hists->thread_filter) { h->filtered |= (1 << HIST_FILTER__THREAD); continue; } -- cgit v1.2.3