2019-08-15 20:37:24 +07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
// Copyright (C) 2019, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
|
|
#ifndef __PERF_EVSWITCH_H
|
|
|
|
#define __PERF_EVSWITCH_H 1
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2019-08-15 21:31:29 +07:00
|
|
|
#include <stdio.h>
|
2019-08-15 20:37:24 +07:00
|
|
|
|
|
|
|
struct evsel;
|
2019-08-15 21:31:29 +07:00
|
|
|
struct evlist;
|
2019-08-15 20:37:24 +07:00
|
|
|
|
|
|
|
struct evswitch {
|
|
|
|
struct evsel *on, *off;
|
2019-08-15 21:11:14 +07:00
|
|
|
const char *on_name, *off_name;
|
2019-08-15 20:37:24 +07:00
|
|
|
bool discarding;
|
|
|
|
bool show_on_off_events;
|
|
|
|
};
|
|
|
|
|
2019-08-15 21:31:29 +07:00
|
|
|
int evswitch__init(struct evswitch *evswitch, struct evlist *evlist, FILE *fp);
|
|
|
|
|
2019-08-15 21:00:11 +07:00
|
|
|
bool evswitch__discard(struct evswitch *evswitch, struct evsel *evsel);
|
|
|
|
|
2019-08-15 21:21:21 +07:00
|
|
|
#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")
|
|
|
|
|
2019-08-15 20:37:24 +07:00
|
|
|
#endif /* __PERF_EVSWITCH_H */
|