Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 1 | #ifndef __PERF_TOOL_H |
| 2 | #define __PERF_TOOL_H |
| 3 | |
Arnaldo Carvalho de Melo | ee29be6 | 2011-11-28 17:57:40 -0200 | [diff] [blame] | 4 | #include <stdbool.h> |
| 5 | |
Adrian Hunter | a16ac02 | 2015-04-09 18:53:43 +0300 | [diff] [blame] | 6 | #include <linux/types.h> |
| 7 | |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 8 | struct perf_session; |
Arnaldo Carvalho de Melo | ee29be6 | 2011-11-28 17:57:40 -0200 | [diff] [blame] | 9 | union perf_event; |
| 10 | struct perf_evlist; |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 11 | struct perf_evsel; |
Arnaldo Carvalho de Melo | ee29be6 | 2011-11-28 17:57:40 -0200 | [diff] [blame] | 12 | struct perf_sample; |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 13 | struct perf_tool; |
| 14 | struct machine; |
Arnaldo Carvalho de Melo | d704ebd | 2015-03-03 12:37:54 -0300 | [diff] [blame] | 15 | struct ordered_events; |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 16 | |
| 17 | typedef int (*event_sample)(struct perf_tool *tool, union perf_event *event, |
| 18 | struct perf_sample *sample, |
| 19 | struct perf_evsel *evsel, struct machine *machine); |
| 20 | |
| 21 | typedef int (*event_op)(struct perf_tool *tool, union perf_event *event, |
| 22 | struct perf_sample *sample, struct machine *machine); |
| 23 | |
Adrian Hunter | 47c3d10 | 2013-07-04 16:20:21 +0300 | [diff] [blame] | 24 | typedef int (*event_attr_op)(struct perf_tool *tool, |
| 25 | union perf_event *event, |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 26 | struct perf_evlist **pevlist); |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 27 | |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 28 | typedef int (*event_op2)(struct perf_tool *tool, union perf_event *event, |
| 29 | struct perf_session *session); |
| 30 | |
Arnaldo Carvalho de Melo | d704ebd | 2015-03-03 12:37:54 -0300 | [diff] [blame] | 31 | typedef int (*event_oe)(struct perf_tool *tool, union perf_event *event, |
| 32 | struct ordered_events *oe); |
| 33 | |
Adrian Hunter | a16ac02 | 2015-04-09 18:53:43 +0300 | [diff] [blame] | 34 | typedef s64 (*event_op3)(struct perf_tool *tool, union perf_event *event, |
| 35 | struct perf_session *session); |
| 36 | |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 37 | struct perf_tool { |
| 38 | event_sample sample, |
| 39 | read; |
| 40 | event_op mmap, |
Stephane Eranian | 5c5e854 | 2013-08-21 12:10:25 +0200 | [diff] [blame] | 41 | mmap2, |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 42 | comm, |
| 43 | fork, |
| 44 | exit, |
| 45 | lost, |
Kan Liang | c4937a9 | 2015-05-10 15:13:15 -0400 | [diff] [blame] | 46 | lost_samples, |
Adrian Hunter | 4a96f7a | 2015-04-30 17:37:29 +0300 | [diff] [blame] | 47 | aux, |
Adrian Hunter | 0ad21f6 | 2015-04-30 17:37:30 +0300 | [diff] [blame] | 48 | itrace_start, |
Adrian Hunter | 0286039 | 2015-07-21 12:44:03 +0300 | [diff] [blame] | 49 | context_switch, |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 50 | throttle, |
| 51 | unthrottle; |
| 52 | event_attr_op attr; |
Adrian Hunter | 47c3d10 | 2013-07-04 16:20:21 +0300 | [diff] [blame] | 53 | event_op2 tracing_data; |
Arnaldo Carvalho de Melo | d704ebd | 2015-03-03 12:37:54 -0300 | [diff] [blame] | 54 | event_oe finished_round; |
| 55 | event_op2 build_id, |
Adrian Hunter | a16ac02 | 2015-04-09 18:53:43 +0300 | [diff] [blame] | 56 | id_index, |
Adrian Hunter | e9bf54d | 2015-04-09 18:53:47 +0300 | [diff] [blame] | 57 | auxtrace_info, |
Jiri Olsa | 5f3339d | 2015-10-25 15:51:19 +0100 | [diff] [blame] | 58 | auxtrace_error, |
Jiri Olsa | 6640b6c | 2015-10-25 15:51:23 +0100 | [diff] [blame] | 59 | thread_map, |
Jiri Olsa | 374fb9e | 2015-10-25 15:51:27 +0100 | [diff] [blame^] | 60 | cpu_map, |
| 61 | stat_config; |
Adrian Hunter | a16ac02 | 2015-04-09 18:53:43 +0300 | [diff] [blame] | 62 | event_op3 auxtrace; |
Jiri Olsa | 0a8cb85 | 2014-07-06 14:18:21 +0200 | [diff] [blame] | 63 | bool ordered_events; |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 64 | bool ordering_requires_timestamps; |
| 65 | }; |
| 66 | |
| 67 | #endif /* __PERF_TOOL_H */ |