summaryrefslogtreecommitdiff
path: root/kernel/trace/rv/monitors/opid/opid.h
blob: fb0aa4c28aa663c9ca4e009335fee5fe441344a2 (plain) (blame)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Automatically generated C representation of opid automaton
 * For further information about this format, see kernel documentation:
 *   Documentation/trace/rv/deterministic_automata.rst
 */

#define MONITOR_NAME opid

enum states_opid {
	any_opid,
	state_max_opid,
};

#define INVALID_STATE state_max_opid

enum events_opid {
	sched_need_resched_opid,
	sched_waking_opid,
	event_max_opid,
};

enum envs_opid {
	irq_off_opid,
	preempt_off_opid,
	env_max_opid,
	env_max_stored_opid = irq_off_opid,
};

_Static_assert(env_max_stored_opid <= MAX_HA_ENV_LEN, "Not enough slots");

struct automaton_opid {
	char *state_names[state_max_opid];
	char *event_names[event_max_opid];
	char *env_names[env_max_opid];
	unsigned char function[state_max_opid][event_max_opid];
	unsigned char initial_state;
	bool final_states[state_max_opid];
};

static const struct automaton_opid automaton_opid = {
	.state_names = {
		"any",
	},
	.event_names = {
		"sched_need_resched",
		"sched_waking",
	},
	.env_names = {
		"irq_off",
		"preempt_off",
	},
	.function = {
		{           any_opid,           any_opid },
	},
	.initial_state = any_opid,
	.final_states = { 1 },
};