xref: /openbmc/linux/tools/tracing/rtla/src/trace.h (revision 2f0754f2)
1 // SPDX-License-Identifier: GPL-2.0
2 #include <tracefs.h>
3 #include <stddef.h>
4 
5 struct trace_instance {
6 	struct tracefs_instance		*inst;
7 	struct tep_handle		*tep;
8 	struct trace_seq		*seq;
9 };
10 
11 int trace_instance_init(struct trace_instance *trace, char *tool_name);
12 int trace_instance_start(struct trace_instance *trace);
13 void trace_instance_destroy(struct trace_instance *trace);
14 
15 struct trace_seq *get_trace_seq(void);
16 int enable_tracer_by_name(struct tracefs_instance *inst, const char *tracer_name);
17 void disable_tracer(struct tracefs_instance *inst);
18 
19 int enable_osnoise(struct trace_instance *trace);
20 int enable_timerlat(struct trace_instance *trace);
21 
22 struct tracefs_instance *create_instance(char *instance_name);
23 void destroy_instance(struct tracefs_instance *inst);
24 
25 int save_trace_to_file(struct tracefs_instance *inst, const char *filename);
26 int collect_registered_events(struct tep_event *tep, struct tep_record *record,
27 			      int cpu, void *context);
28