^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef __PERF_TOOL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define __PERF_TOOL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <stdbool.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) struct perf_session;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) union perf_event;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) struct evlist;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) struct evsel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) struct perf_sample;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) struct perf_tool;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct machine;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct ordered_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) typedef int (*event_sample)(struct perf_tool *tool, union perf_event *event,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct perf_sample *sample,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct evsel *evsel, struct machine *machine);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) typedef int (*event_op)(struct perf_tool *tool, union perf_event *event,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct perf_sample *sample, struct machine *machine);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) typedef int (*event_attr_op)(struct perf_tool *tool,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) union perf_event *event,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct evlist **pevlist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) typedef int (*event_op2)(struct perf_session *session, union perf_event *event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) typedef s64 (*event_op3)(struct perf_session *session, union perf_event *event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) typedef int (*event_op4)(struct perf_session *session, union perf_event *event, u64 data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) typedef int (*event_oe)(struct perf_tool *tool, union perf_event *event,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct ordered_events *oe);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) enum show_feature_header {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) SHOW_FEAT_NO_HEADER = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) SHOW_FEAT_HEADER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) SHOW_FEAT_HEADER_FULL_INFO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct perf_tool {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) event_sample sample,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) read;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) event_op mmap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) mmap2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) comm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) namespaces,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) cgroup,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) fork,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) exit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) lost,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) lost_samples,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) aux,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) itrace_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) context_switch,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) throttle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) unthrottle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) ksymbol,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) bpf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) text_poke;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) event_attr_op attr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) event_attr_op event_update;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) event_op2 tracing_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) event_oe finished_round;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) event_op2 build_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) id_index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) auxtrace_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) auxtrace_error,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) time_conv,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) thread_map,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) cpu_map,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) stat_config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) stat,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) stat_round,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) feature;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) event_op4 compressed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) event_op3 auxtrace;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) bool ordered_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) bool ordering_requires_timestamps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) bool namespace_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) bool cgroup_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) bool no_warn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) enum show_feature_header show_feat_hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #endif /* __PERF_TOOL_H */