162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci#ifndef __PERF_PRINT_EVENTS_H 362306a36Sopenharmony_ci#define __PERF_PRINT_EVENTS_H 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci#include <linux/perf_event.h> 662306a36Sopenharmony_ci#include <linux/types.h> 762306a36Sopenharmony_ci#include <stdbool.h> 862306a36Sopenharmony_ci 962306a36Sopenharmony_cistruct event_symbol; 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_cistruct print_callbacks { 1262306a36Sopenharmony_ci void (*print_start)(void *print_state); 1362306a36Sopenharmony_ci void (*print_end)(void *print_state); 1462306a36Sopenharmony_ci void (*print_event)(void *print_state, const char *topic, 1562306a36Sopenharmony_ci const char *pmu_name, 1662306a36Sopenharmony_ci const char *event_name, const char *event_alias, 1762306a36Sopenharmony_ci const char *scale_unit, 1862306a36Sopenharmony_ci bool deprecated, const char *event_type_desc, 1962306a36Sopenharmony_ci const char *desc, const char *long_desc, 2062306a36Sopenharmony_ci const char *encoding_desc); 2162306a36Sopenharmony_ci void (*print_metric)(void *print_state, 2262306a36Sopenharmony_ci const char *group, 2362306a36Sopenharmony_ci const char *name, 2462306a36Sopenharmony_ci const char *desc, 2562306a36Sopenharmony_ci const char *long_desc, 2662306a36Sopenharmony_ci const char *expr, 2762306a36Sopenharmony_ci const char *threshold, 2862306a36Sopenharmony_ci const char *unit); 2962306a36Sopenharmony_ci bool (*skip_duplicate_pmus)(void *print_state); 3062306a36Sopenharmony_ci}; 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci/** Print all events, the default when no options are specified. */ 3362306a36Sopenharmony_civoid print_events(const struct print_callbacks *print_cb, void *print_state); 3462306a36Sopenharmony_ciint print_hwcache_events(const struct print_callbacks *print_cb, void *print_state); 3562306a36Sopenharmony_civoid print_sdt_events(const struct print_callbacks *print_cb, void *print_state); 3662306a36Sopenharmony_civoid print_symbol_events(const struct print_callbacks *print_cb, void *print_state, 3762306a36Sopenharmony_ci unsigned int type, const struct event_symbol *syms, 3862306a36Sopenharmony_ci unsigned int max); 3962306a36Sopenharmony_civoid print_tool_events(const struct print_callbacks *print_cb, void *print_state); 4062306a36Sopenharmony_civoid print_tracepoint_events(const struct print_callbacks *print_cb, void *print_state); 4162306a36Sopenharmony_cibool is_event_supported(u8 type, u64 config); 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ci#endif /* __PERF_PRINT_EVENTS_H */ 44