2019-08-15 06: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 07:31:29 -07:00
|
|
|
#include <stdio.h>
|
2019-08-15 06:37:24 -07:00
|
|
|
|
|
|
|
struct evsel;
|
2019-08-15 07:31:29 -07:00
|
|
|
struct evlist;
|
2019-08-15 06:37:24 -07:00
|
|
|
|
|
|
|
struct evswitch {
|
|
|
|
struct evsel *on, *off;
|
2019-08-15 07:11:14 -07:00
|
|
|
const char *on_name, *off_name;
|
2019-08-15 06:37:24 -07:00
|
|
|
bool discarding;
|
|
|
|
bool show_on_off_events;
|
|
|
|
};
|
|
|
|
|
2019-08-15 07:31:29 -07:00
|
|
|
int evswitch__init(struct evswitch *evswitch, struct evlist *evlist, FILE *fp);
|
|
|
|
|
2019-08-15 07:00:11 -07:00
|
|
|
bool evswitch__discard(struct evswitch *evswitch, struct evsel *evsel);
|
|
|
|
|
2019-08-15 07:21:21 -07:00
|
|
|
#define OPTS_EVSWITCH(evswitch) \
|
|
|
|
OPT_STRING(0, "switch-on", &(evswitch)->on_name, \
|
2023-01-22 05:20:32 -07:00
|
|
|
"event", "Consider events after the occurrence of this event"), \
|
2019-08-15 07:21:21 -07:00
|
|
|
OPT_STRING(0, "switch-off", &(evswitch)->off_name, \
|
2023-01-22 05:20:32 -07:00
|
|
|
"event", "Stop considering events after the occurrence of this event"), \
|
2019-08-15 07:21:21 -07:00
|
|
|
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 06:37:24 -07:00
|
|
|
#endif /* __PERF_EVSWITCH_H */
|