File: evswitch.h

package info (click to toggle)
linux 6.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,488,076 kB
  • sloc: ansic: 23,401,844; asm: 266,744; sh: 108,976; makefile: 49,705; python: 36,927; perl: 36,810; cpp: 6,044; yacc: 4,904; lex: 2,722; awk: 1,440; ruby: 25; sed: 5
file content (31 lines) | stat: -rw-r--r-- 1,032 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 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>
#include <stdio.h>

struct evsel;
struct evlist;

struct evswitch {
	struct evsel *on, *off;
	const char   *on_name, *off_name;
	bool	     discarding;
	bool	     show_on_off_events;
};

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,				  \
		   "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 */