summaryrefslogtreecommitdiff
path: root/tools/perf/util/hist.c
diff options
context:
space:
mode:
authorKan Liang <kan.liang@intel.com>2015-09-04 17:45:45 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-09-14 19:02:08 +0300
commit84734b06b63093cd44533f4caa43d4452fb11ec3 (patch)
tree671aac2a8e6af768d81fc63a823a0654275d41f0 /tools/perf/util/hist.c
parent21394d948a0c7c451d4a4d68afed9a06c4969636 (diff)
downloadlinux-84734b06b63093cd44533f4caa43d4452fb11ec3.tar.xz
perf hists browser: Zoom in/out for processor socket
Currently, users can zoom in/out for threads and dso in 'perf top' and 'perf report'. This patch extends it for the processor sockets. 'S' is the short key to zoom into current Processor Socket. Signed-off-by: Kan Liang <kan.liang@intel.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1441377946-44429-4-git-send-email-kan.liang@intel.com [ - Made it elide the Socket column when zooming into it, just like with the other zoom ops; - Make it use browser->pstack, to unzoom level by level; - Rename 'socket' variables to 'socket_id' to make it build on older systems where it shadows a global glibc declaration ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/hist.c')
-rw-r--r--tools/perf/util/hist.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 5d78ae879017..b3567a25f0c4 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1310,6 +1310,25 @@ static bool hists__filter_entry_by_socket(struct hists *hists,
return false;
}
+void hists__filter_by_socket(struct hists *hists)
+{
+ struct rb_node *nd;
+
+ hists->stats.nr_non_filtered_samples = 0;
+
+ hists__reset_filter_stats(hists);
+ hists__reset_col_len(hists);
+
+ for (nd = rb_first(&hists->entries); nd; nd = rb_next(nd)) {
+ struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node);
+
+ if (hists__filter_entry_by_socket(hists, h))
+ continue;
+
+ hists__remove_entry_filter(hists, h, HIST_FILTER__SOCKET);
+ }
+}
+
void events_stats__inc(struct events_stats *stats, u32 type)
{
++stats->nr_events[0];