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 <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-zjhhf8kh9w1buty9p10od6rz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 8d15e9f..fdff2a8 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1087,7 +1087,7 @@
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 @@
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_thread(struct hists *hists, const struct thread *thread)
+void hists__filter_by_thread(struct hists *hists)
{
struct rb_node *nd;
@@ -1121,7 +1122,8 @@
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;
}