summaryrefslogtreecommitdiff
path: root/tools/perf/util
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-08-15 11:21:21 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-08-15 12:25:47 -0300
commitadd3a719c95f0443d563889b4af255b78ba54521 (patch)
tree3adf33320674cb3c6a54985b7b64acbd1da24507 /tools/perf/util
parent0b495b121585a1b6ca120fe13f950e2f86ca8197 (diff)
perf evswitch: Introduce OPTS_EVSWITCH() for cmd line processing
All tools will want those, so provide a convenient way to get them. 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-v16pe3sbf3wjmn152u18f649@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/evswitch.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/evswitch.h b/tools/perf/util/evswitch.h
index 891164504080..94220d1bb479 100644
--- a/tools/perf/util/evswitch.h
+++ b/tools/perf/util/evswitch.h
@@ -16,4 +16,12 @@ struct evswitch {
bool evswitch__discard(struct evswitch *evswitch, struct evsel *evsel);
+#define OPTS_EVSWITCH(evswitch) \
+ OPT_STRING(0, "switch-on", &(evswitch)->on_name, \
+ "event", "Consider events after the ocurrence of this event"), \
+ OPT_STRING(0, "switch-off", &(evswitch)->off_name, \
+ "event", "Stop considering events after the ocurrence of this event"), \
+ OPT_BOOLEAN(0, "show-on-off-events", &(evswitch)->show_on_off_events, \
+ "Show the on/off switch events, used with --switch-on and --switch-off")
+
#endif /* __PERF_EVSWITCH_H */