Merge tag 'mm-hotfixes-stable-2025-07-11-16-16' of git://git.kernel.org/pub/scm/linux...
[linux-block.git] / tools / perf / util / tool.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
45694aa7
ACM
2#ifndef __PERF_TOOL_H
3#define __PERF_TOOL_H
4
ee29be62
ACM
5#include <stdbool.h>
6
a16ac023
AH
7#include <linux/types.h>
8
45694aa7 9struct perf_session;
ee29be62 10union perf_event;
63503dba 11struct evlist;
32dcd021 12struct evsel;
ee29be62 13struct perf_sample;
45694aa7
ACM
14struct perf_tool;
15struct machine;
d704ebda 16struct ordered_events;
45694aa7 17
30f29bae 18typedef int (*event_sample)(const struct perf_tool *tool, union perf_event *event,
45694aa7 19 struct perf_sample *sample,
32dcd021 20 struct evsel *evsel, struct machine *machine);
45694aa7 21
30f29bae 22typedef int (*event_op)(const struct perf_tool *tool, union perf_event *event,
45694aa7
ACM
23 struct perf_sample *sample, struct machine *machine);
24
30f29bae 25typedef int (*event_attr_op)(const struct perf_tool *tool,
47c3d109 26 union perf_event *event,
63503dba 27 struct evlist **pevlist);
45694aa7 28
89f1688a 29typedef int (*event_op2)(struct perf_session *session, union perf_event *event);
7336555a 30typedef s64 (*event_op3)(struct perf_session *session, union perf_event *event);
2292083f
AB
31typedef int (*event_op4)(struct perf_session *session, union perf_event *event, u64 data,
32 const char *str);
45694aa7 33
30f29bae 34typedef int (*event_oe)(const struct perf_tool *tool, union perf_event *event,
d704ebda
ACM
35 struct ordered_events *oe);
36
114f709e
DCC
37enum show_feature_header {
38 SHOW_FEAT_NO_HEADER = 0,
39 SHOW_FEAT_HEADER,
40 SHOW_FEAT_HEADER_FULL_INFO,
41};
42
45694aa7
ACM
43struct perf_tool {
44 event_sample sample,
45 read;
46 event_op mmap,
5c5e854b 47 mmap2,
45694aa7 48 comm,
f3b3614a 49 namespaces,
ba78c1c5 50 cgroup,
45694aa7
ACM
51 fork,
52 exit,
53 lost,
c4937a91 54 lost_samples,
4a96f7a0 55 aux,
0ad21f68 56 itrace_start,
61750473 57 aux_output_hw_id,
0286039f 58 context_switch,
45694aa7 59 throttle,
9aa0bfa3 60 unthrottle,
45178a92 61 ksymbol,
246eba8e
AH
62 bpf,
63 text_poke;
9aa0bfa3 64
45694aa7 65 event_attr_op attr;
ffe77725 66 event_attr_op event_update;
47c3d109 67 event_op2 tracing_data;
d704ebda
ACM
68 event_oe finished_round;
69 event_op2 build_id,
a16ac023 70 id_index,
e9bf54d2 71 auxtrace_info,
5f3339d2 72 auxtrace_error,
46bc29b9 73 time_conv,
6640b6c2 74 thread_map,
374fb9e3 75 cpu_map,
d80518c9 76 stat_config,
2d8f0f18 77 stat,
e9def1b2 78 stat_round,
3812d298
AH
79 feature,
80 finished_init;
61a7773c 81 event_op4 compressed;
a16ac023 82 event_op3 auxtrace;
0a8cb85c 83 bool ordered_events;
45694aa7 84 bool ordering_requires_timestamps;
f3b3614a 85 bool namespace_events;
ab64069f 86 bool cgroup_events;
075ca1eb 87 bool no_warn;
79bcd34e 88 bool dont_split_sample_group;
114f709e 89 enum show_feature_header show_feat_hdr;
45694aa7
ACM
90};
91
ae737b61 92void perf_tool__init(struct perf_tool *tool, bool ordered_events);
564e5cbc
IR
93
94bool perf_tool__compressed_is_stub(const struct perf_tool *tool);
95
cecb1cf1
IR
96int process_event_sample_stub(const struct perf_tool *tool,
97 union perf_event *event,
98 struct perf_sample *sample,
99 struct evsel *evsel,
100 struct machine *machine);
101
45694aa7 102#endif /* __PERF_TOOL_H */