0001
0002
0003 #ifndef __PERF_EVSWITCH_H
0004 #define __PERF_EVSWITCH_H 1
0005
0006 #include <stdbool.h>
0007 #include <stdio.h>
0008
0009 struct evsel;
0010 struct evlist;
0011
0012 struct evswitch {
0013 struct evsel *on, *off;
0014 const char *on_name, *off_name;
0015 bool discarding;
0016 bool show_on_off_events;
0017 };
0018
0019 int evswitch__init(struct evswitch *evswitch, struct evlist *evlist, FILE *fp);
0020
0021 bool evswitch__discard(struct evswitch *evswitch, struct evsel *evsel);
0022
0023 #define OPTS_EVSWITCH(evswitch) \
0024 OPT_STRING(0, "switch-on", &(evswitch)->on_name, \
0025 "event", "Consider events after the ocurrence of this event"), \
0026 OPT_STRING(0, "switch-off", &(evswitch)->off_name, \
0027 "event", "Stop considering events after the ocurrence of this event"), \
0028 OPT_BOOLEAN(0, "show-on-off-events", &(evswitch)->show_on_off_events, \
0029 "Show the on/off switch events, used with --switch-on and --switch-off")
0030
0031 #endif