162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci#include <tracefs.h> 362306a36Sopenharmony_ci#include <stddef.h> 462306a36Sopenharmony_ci 562306a36Sopenharmony_cistruct trace_events { 662306a36Sopenharmony_ci struct trace_events *next; 762306a36Sopenharmony_ci char *system; 862306a36Sopenharmony_ci char *event; 962306a36Sopenharmony_ci char *filter; 1062306a36Sopenharmony_ci char *trigger; 1162306a36Sopenharmony_ci char enabled; 1262306a36Sopenharmony_ci char filter_enabled; 1362306a36Sopenharmony_ci char trigger_enabled; 1462306a36Sopenharmony_ci}; 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_cistruct trace_instance { 1762306a36Sopenharmony_ci struct tracefs_instance *inst; 1862306a36Sopenharmony_ci struct tep_handle *tep; 1962306a36Sopenharmony_ci struct trace_seq *seq; 2062306a36Sopenharmony_ci}; 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ciint trace_instance_init(struct trace_instance *trace, char *tool_name); 2362306a36Sopenharmony_ciint trace_instance_start(struct trace_instance *trace); 2462306a36Sopenharmony_civoid trace_instance_destroy(struct trace_instance *trace); 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_cistruct trace_seq *get_trace_seq(void); 2762306a36Sopenharmony_ciint enable_tracer_by_name(struct tracefs_instance *inst, const char *tracer_name); 2862306a36Sopenharmony_civoid disable_tracer(struct tracefs_instance *inst); 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ciint enable_osnoise(struct trace_instance *trace); 3162306a36Sopenharmony_ciint enable_timerlat(struct trace_instance *trace); 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_cistruct tracefs_instance *create_instance(char *instance_name); 3462306a36Sopenharmony_civoid destroy_instance(struct tracefs_instance *inst); 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ciint save_trace_to_file(struct tracefs_instance *inst, const char *filename); 3762306a36Sopenharmony_ciint collect_registered_events(struct tep_event *tep, struct tep_record *record, 3862306a36Sopenharmony_ci int cpu, void *context); 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_cistruct trace_events *trace_event_alloc(const char *event_string); 4162306a36Sopenharmony_civoid trace_events_disable(struct trace_instance *instance, 4262306a36Sopenharmony_ci struct trace_events *events); 4362306a36Sopenharmony_civoid trace_events_destroy(struct trace_instance *instance, 4462306a36Sopenharmony_ci struct trace_events *events); 4562306a36Sopenharmony_ciint trace_events_enable(struct trace_instance *instance, 4662306a36Sopenharmony_ci struct trace_events *events); 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ciint trace_event_add_filter(struct trace_events *event, char *filter); 4962306a36Sopenharmony_ciint trace_event_add_trigger(struct trace_events *event, char *trigger); 5062306a36Sopenharmony_ciint trace_is_off(struct trace_instance *tool, struct trace_instance *trace); 51