xref: /openbmc/linux/tools/perf/util/tool.h (revision 99b7e93c)
1 #ifndef __PERF_TOOL_H
2 #define __PERF_TOOL_H
3 
4 #include <stdbool.h>
5 
6 struct perf_session;
7 union perf_event;
8 struct perf_evlist;
9 struct perf_evsel;
10 struct perf_sample;
11 struct perf_tool;
12 struct machine;
13 struct ordered_events;
14 
15 typedef int (*event_sample)(struct perf_tool *tool, union perf_event *event,
16 			    struct perf_sample *sample,
17 			    struct perf_evsel *evsel, struct machine *machine);
18 
19 typedef int (*event_op)(struct perf_tool *tool, union perf_event *event,
20 			struct perf_sample *sample, struct machine *machine);
21 
22 typedef int (*event_attr_op)(struct perf_tool *tool,
23 			     union perf_event *event,
24 			     struct perf_evlist **pevlist);
25 
26 typedef int (*event_op2)(struct perf_tool *tool, union perf_event *event,
27 			 struct perf_session *session);
28 
29 typedef int (*event_oe)(struct perf_tool *tool, union perf_event *event,
30 			struct ordered_events *oe);
31 
32 struct perf_tool {
33 	event_sample	sample,
34 			read;
35 	event_op	mmap,
36 			mmap2,
37 			comm,
38 			fork,
39 			exit,
40 			lost,
41 			throttle,
42 			unthrottle;
43 	event_attr_op	attr;
44 	event_op2	tracing_data;
45 	event_oe	finished_round;
46 	event_op2	build_id,
47 			id_index;
48 	bool		ordered_events;
49 	bool		ordering_requires_timestamps;
50 };
51 
52 #endif /* __PERF_TOOL_H */
53