blob: aa7ae73d76b46f3729ddc57353ac99c89a59993f [file] [log] [blame]
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -02001#ifndef __PERF_TOOL_H
2#define __PERF_TOOL_H
3
Arnaldo Carvalho de Meloee29be62011-11-28 17:57:40 -02004#include <stdbool.h>
5
Adrian Huntera16ac022015-04-09 18:53:43 +03006#include <linux/types.h>
7
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -02008struct perf_session;
Arnaldo Carvalho de Meloee29be62011-11-28 17:57:40 -02009union perf_event;
10struct perf_evlist;
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020011struct perf_evsel;
Arnaldo Carvalho de Meloee29be62011-11-28 17:57:40 -020012struct perf_sample;
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020013struct perf_tool;
14struct machine;
Arnaldo Carvalho de Melod704ebd2015-03-03 12:37:54 -030015struct ordered_events;
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020016
17typedef 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
21typedef int (*event_op)(struct perf_tool *tool, union perf_event *event,
22 struct perf_sample *sample, struct machine *machine);
23
Adrian Hunter47c3d102013-07-04 16:20:21 +030024typedef int (*event_attr_op)(struct perf_tool *tool,
25 union perf_event *event,
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020026 struct perf_evlist **pevlist);
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020027
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020028typedef int (*event_op2)(struct perf_tool *tool, union perf_event *event,
29 struct perf_session *session);
30
Arnaldo Carvalho de Melod704ebd2015-03-03 12:37:54 -030031typedef int (*event_oe)(struct perf_tool *tool, union perf_event *event,
32 struct ordered_events *oe);
33
Adrian Huntera16ac022015-04-09 18:53:43 +030034typedef s64 (*event_op3)(struct perf_tool *tool, union perf_event *event,
35 struct perf_session *session);
36
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020037struct perf_tool {
38 event_sample sample,
39 read;
40 event_op mmap,
Stephane Eranian5c5e8542013-08-21 12:10:25 +020041 mmap2,
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020042 comm,
43 fork,
44 exit,
45 lost,
Kan Liangc4937a92015-05-10 15:13:15 -040046 lost_samples,
Adrian Hunter4a96f7a2015-04-30 17:37:29 +030047 aux,
Adrian Hunter0ad21f62015-04-30 17:37:30 +030048 itrace_start,
Adrian Hunter02860392015-07-21 12:44:03 +030049 context_switch,
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020050 throttle,
51 unthrottle;
52 event_attr_op attr;
Adrian Hunter47c3d102013-07-04 16:20:21 +030053 event_op2 tracing_data;
Arnaldo Carvalho de Melod704ebd2015-03-03 12:37:54 -030054 event_oe finished_round;
55 event_op2 build_id,
Adrian Huntera16ac022015-04-09 18:53:43 +030056 id_index,
Adrian Huntere9bf54d2015-04-09 18:53:47 +030057 auxtrace_info,
Jiri Olsa5f3339d2015-10-25 15:51:19 +010058 auxtrace_error,
Jiri Olsa6640b6c2015-10-25 15:51:23 +010059 thread_map,
Jiri Olsa374fb9e2015-10-25 15:51:27 +010060 cpu_map,
61 stat_config;
Adrian Huntera16ac022015-04-09 18:53:43 +030062 event_op3 auxtrace;
Jiri Olsa0a8cb852014-07-06 14:18:21 +020063 bool ordered_events;
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020064 bool ordering_requires_timestamps;
65};
66
67#endif /* __PERF_TOOL_H */