summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/top.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-08-15 21:03:26 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-08-15 21:03:26 +0200
commit2f53ae347f597842683c4bde5b9ce76f5efae247 (patch)
tree7137a52231c58a003f5aa1430167a9d851dbd15a /tools/perf/util/top.h
parentperf trace: Add --switch-on/--switch-off events (diff)
downloadlinux-2f53ae347f597842683c4bde5b9ce76f5efae247.tar.xz
linux-2f53ae347f597842683c4bde5b9ce76f5efae247.zip
perf top: Add --switch-on/--switch-off events
Just like 'perf trace' and 'perf script', should be useful for instance to only consider samples after the initialization phase of some workload. The man page has some examples and considerations about its current interface, that still doesn't handle the on/off events in a special way, behaving just like when multiple events are specified, i.e.: - In non-group mode (when the event list is not enclosed in {}) show a a menu to allow choosing which event the user wants to see in the histograms browser - In group mode, be it using {} or asking for --group, show one column per event. Try for instance: # perf top -e '{cycles,instructions,probe:icmp_rcv}' --switch-on=probe:icmp_rcv Replace probe:icmp_rcv, that I put in place using: # perf probe icmp_rcv:59 To hit when broadcast packets arrive, with a probe installed after an initialization phase is over or after some other point of interest, some garbage collection, etc, and also use --switch-off, for instance, on a probe installed after said garbage collection is over. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Florian Weimer <fweimer@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: William Cohen <wcohen@redhat.com> Link: https://lkml.kernel.org/n/tip-c7q7qjeqtyvc9mkeipxza6ne@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/top.h')
-rw-r--r--tools/perf/util/top.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h
index 2023e0bf6165..dc4bb6e52a83 100644
--- a/tools/perf/util/top.h
+++ b/tools/perf/util/top.h
@@ -3,6 +3,7 @@
#define __PERF_TOP_H 1
#include "tool.h"
+#include "evswitch.h"
#include "annotate.h"
#include <linux/types.h>
#include <stddef.h>
@@ -18,6 +19,7 @@ struct perf_top {
struct evlist *evlist;
struct record_opts record_opts;
struct annotation_options annotation_opts;
+ struct evswitch evswitch;
/*
* Symbols will be added here in perf_event__process_sample and will
* get out after decayed.