evswitch
OPTS_EVSWITCH(&report.evswitch),
ret = evswitch__init(&report.evswitch, session->evlist, stderr);
if (evswitch__discard(&rep->evswitch, sample->evsel))
struct evswitch evswitch;
struct evswitch evswitch;
if (evswitch__discard(&scr->evswitch, evsel))
if (evswitch__discard(&scr->evswitch, evsel))
OPTS_EVSWITCH(&script.evswitch),
err = evswitch__init(&script.evswitch, session->evlist, stderr);
if (evswitch__discard(&top->evswitch, evsel)) {
OPTS_EVSWITCH(&top.evswitch),
status = evswitch__init(&top.evswitch, top.evlist, stderr);
struct evswitch evswitch;
if (evswitch__discard(&trace->evswitch, sample->evsel))
OPTS_EVSWITCH(&trace.evswitch),
err = evswitch__init(&trace.evswitch, trace.evlist, stderr);
if (evswitch->on && evswitch->discarding) {
if (evswitch->on != evsel)
evswitch->discarding = false;
if (!evswitch->show_on_off_events)
if (evswitch->off && !evswitch->discarding) {
if (evswitch->off != evsel)
evswitch->discarding = true;
if (!evswitch->show_on_off_events)
int evswitch__init(struct evswitch *evswitch, struct evlist *evlist, FILE *fp)
if (evswitch->on_name) {
evswitch->on = evlist__find_evsel_by_str(evlist, evswitch->on_name);
if (evswitch->on == NULL) {
evswitch__fprintf_enoent(fp, "on", evswitch->on_name);
evswitch->discarding = true;
if (evswitch->off_name) {
evswitch->off = evlist__find_evsel_by_str(evlist, evswitch->off_name);
if (evswitch->off == NULL) {
evswitch__fprintf_enoent(fp, "off", evswitch->off_name);
bool evswitch__discard(struct evswitch *evswitch, struct evsel *evsel)
int evswitch__init(struct evswitch *evswitch, struct evlist *evlist, FILE *fp);
bool evswitch__discard(struct evswitch *evswitch, struct evsel *evsel);
#define OPTS_EVSWITCH(evswitch) \
OPT_STRING(0, "switch-on", &(evswitch)->on_name, \
OPT_STRING(0, "switch-off", &(evswitch)->off_name, \
OPT_BOOLEAN(0, "show-on-off-events", &(evswitch)->show_on_off_events, \
struct evswitch evswitch;