blob: ac2590a3de2d1586fa60a1893d9ec4233967b5e0 [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;
Jiri Olsaffe777252015-10-25 15:51:36 +010053 event_attr_op event_update;
Adrian Hunter47c3d102013-07-04 16:20:21 +030054 event_op2 tracing_data;
Arnaldo Carvalho de Melod704ebd2015-03-03 12:37:54 -030055 event_oe finished_round;
56 event_op2 build_id,
Adrian Huntera16ac022015-04-09 18:53:43 +030057 id_index,
Adrian Huntere9bf54d2015-04-09 18:53:47 +030058 auxtrace_info,
Jiri Olsa5f3339d2015-10-25 15:51:19 +010059 auxtrace_error,
Adrian Hunter46bc29b2016-03-08 10:38:44 +020060 time_conv,
Jiri Olsa6640b6c2015-10-25 15:51:23 +010061 thread_map,
Jiri Olsa374fb9e2015-10-25 15:51:27 +010062 cpu_map,
Jiri Olsad80518c2015-10-25 15:51:30 +010063 stat_config,
Jiri Olsa2d8f0f12015-10-25 15:51:33 +010064 stat,
65 stat_round;
Adrian Huntera16ac022015-04-09 18:53:43 +030066 event_op3 auxtrace;
Jiri Olsa0a8cb852014-07-06 14:18:21 +020067 bool ordered_events;
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020068 bool ordering_requires_timestamps;
69};
70
71#endif /* __PERF_TOOL_H */