18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __PERF_TOOL_H
38c2ecf20Sopenharmony_ci#define __PERF_TOOL_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <stdbool.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#include <linux/types.h>
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cistruct perf_session;
108c2ecf20Sopenharmony_ciunion perf_event;
118c2ecf20Sopenharmony_cistruct evlist;
128c2ecf20Sopenharmony_cistruct evsel;
138c2ecf20Sopenharmony_cistruct perf_sample;
148c2ecf20Sopenharmony_cistruct perf_tool;
158c2ecf20Sopenharmony_cistruct machine;
168c2ecf20Sopenharmony_cistruct ordered_events;
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_citypedef int (*event_sample)(struct perf_tool *tool, union perf_event *event,
198c2ecf20Sopenharmony_ci			    struct perf_sample *sample,
208c2ecf20Sopenharmony_ci			    struct evsel *evsel, struct machine *machine);
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_citypedef int (*event_op)(struct perf_tool *tool, union perf_event *event,
238c2ecf20Sopenharmony_ci			struct perf_sample *sample, struct machine *machine);
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_citypedef int (*event_attr_op)(struct perf_tool *tool,
268c2ecf20Sopenharmony_ci			     union perf_event *event,
278c2ecf20Sopenharmony_ci			     struct evlist **pevlist);
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_citypedef int (*event_op2)(struct perf_session *session, union perf_event *event);
308c2ecf20Sopenharmony_citypedef s64 (*event_op3)(struct perf_session *session, union perf_event *event);
318c2ecf20Sopenharmony_citypedef int (*event_op4)(struct perf_session *session, union perf_event *event, u64 data);
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_citypedef int (*event_oe)(struct perf_tool *tool, union perf_event *event,
348c2ecf20Sopenharmony_ci			struct ordered_events *oe);
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_cienum show_feature_header {
378c2ecf20Sopenharmony_ci	SHOW_FEAT_NO_HEADER = 0,
388c2ecf20Sopenharmony_ci	SHOW_FEAT_HEADER,
398c2ecf20Sopenharmony_ci	SHOW_FEAT_HEADER_FULL_INFO,
408c2ecf20Sopenharmony_ci};
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_cistruct perf_tool {
438c2ecf20Sopenharmony_ci	event_sample	sample,
448c2ecf20Sopenharmony_ci			read;
458c2ecf20Sopenharmony_ci	event_op	mmap,
468c2ecf20Sopenharmony_ci			mmap2,
478c2ecf20Sopenharmony_ci			comm,
488c2ecf20Sopenharmony_ci			namespaces,
498c2ecf20Sopenharmony_ci			cgroup,
508c2ecf20Sopenharmony_ci			fork,
518c2ecf20Sopenharmony_ci			exit,
528c2ecf20Sopenharmony_ci			lost,
538c2ecf20Sopenharmony_ci			lost_samples,
548c2ecf20Sopenharmony_ci			aux,
558c2ecf20Sopenharmony_ci			itrace_start,
568c2ecf20Sopenharmony_ci			context_switch,
578c2ecf20Sopenharmony_ci			throttle,
588c2ecf20Sopenharmony_ci			unthrottle,
598c2ecf20Sopenharmony_ci			ksymbol,
608c2ecf20Sopenharmony_ci			bpf,
618c2ecf20Sopenharmony_ci			text_poke;
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci	event_attr_op	attr;
648c2ecf20Sopenharmony_ci	event_attr_op	event_update;
658c2ecf20Sopenharmony_ci	event_op2	tracing_data;
668c2ecf20Sopenharmony_ci	event_oe	finished_round;
678c2ecf20Sopenharmony_ci	event_op2	build_id,
688c2ecf20Sopenharmony_ci			id_index,
698c2ecf20Sopenharmony_ci			auxtrace_info,
708c2ecf20Sopenharmony_ci			auxtrace_error,
718c2ecf20Sopenharmony_ci			time_conv,
728c2ecf20Sopenharmony_ci			thread_map,
738c2ecf20Sopenharmony_ci			cpu_map,
748c2ecf20Sopenharmony_ci			stat_config,
758c2ecf20Sopenharmony_ci			stat,
768c2ecf20Sopenharmony_ci			stat_round,
778c2ecf20Sopenharmony_ci			feature;
788c2ecf20Sopenharmony_ci	event_op4	compressed;
798c2ecf20Sopenharmony_ci	event_op3	auxtrace;
808c2ecf20Sopenharmony_ci	bool		ordered_events;
818c2ecf20Sopenharmony_ci	bool		ordering_requires_timestamps;
828c2ecf20Sopenharmony_ci	bool		namespace_events;
838c2ecf20Sopenharmony_ci	bool		cgroup_events;
848c2ecf20Sopenharmony_ci	bool		no_warn;
858c2ecf20Sopenharmony_ci	enum show_feature_header show_feat_hdr;
868c2ecf20Sopenharmony_ci};
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#endif /* __PERF_TOOL_H */
89