File Index
Files and directories
Sign in
FILE

actions.h

File preview with syntax highlighting.

linux-6.19.14/tools/tracing/rtla/src/actions.h C
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#include <tracefs.h>
 3#include <stdbool.h>
 4
 5enum action_type {
 6	ACTION_NONE = 0,
 7	ACTION_TRACE_OUTPUT,
 8	ACTION_SIGNAL,
 9	ACTION_SHELL,
10	ACTION_CONTINUE,
11	ACTION_FIELD_N
12};
13
14struct action {
15	enum action_type type;
16	union {
17		struct {
18			/* For ACTION_TRACE_OUTPUT */
19			char *trace_output;
20		};
21		struct {
22			/* For ACTION_SIGNAL */
23			int signal;
24			int pid;
25		};
26		struct {
27			/* For ACTION_SHELL */
28			char *command;
29		};
30	};
31};
32
33static const int action_default_size = 8;
34
35struct actions {
36	struct action *list;
37	int len, size;
38	bool present[ACTION_FIELD_N];
39	bool continue_flag;
40
41	/* External dependencies */
42	struct tracefs_instance *trace_output_inst;
43};
44
45void actions_init(struct actions *self);
46void actions_destroy(struct actions *self);
47int actions_add_trace_output(struct actions *self, const char *trace_output);
48int actions_add_signal(struct actions *self, int signal, int pid);
49int actions_add_shell(struct actions *self, const char *command);
50int actions_add_continue(struct actions *self);
51int actions_parse(struct actions *self, const char *trigger, const char *tracefn);
52int actions_perform(struct actions *self);
~/ Read-only file preview.