blob: 0146f8ef5cc30f0d7d700208baf07333e4c58a75 [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,
46 throttle,
47 unthrottle;
48 event_attr_op attr;
Adrian Hunter47c3d102013-07-04 16:20:21 +030049 event_op2 tracing_data;
Arnaldo Carvalho de Melod704ebd2015-03-03 12:37:54 -030050 event_oe finished_round;
51 event_op2 build_id,
Adrian Huntera16ac022015-04-09 18:53:43 +030052 id_index,
53 auxtrace_info;
54 event_op3 auxtrace;
Jiri Olsa0a8cb852014-07-06 14:18:21 +020055 bool ordered_events;
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020056 bool ordering_requires_timestamps;
57};
58
59#endif /* __PERF_TOOL_H */