mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-18 19:21:38 -04:00
Currently a lot of code is duplicated between the different rtla tools, making maintenance more difficult, and encouraging divergence such as features that are only implemented for certain tools even though they could be more broadly applicable. Merge the various main() functions into a common run_tool() with an ops struct for tool-specific details. Implement enough support for actions on osnoise to not need to keep the old params->trace_output path. Cc: John Kacur <jkacur@redhat.com> Cc: Costa Shulyupin <costa.shul@redhat.com> Link: https://lore.kernel.org/20250907022325.243930-5-crwood@redhat.com Reviewed-by: Tomas Glozar <tglozar@redhat.com> Signed-off-by: Crystal Wood <crwood@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
51 lines
1.7 KiB
C
51 lines
1.7 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <tracefs.h>
|
|
#include <stddef.h>
|
|
|
|
struct trace_events {
|
|
struct trace_events *next;
|
|
char *system;
|
|
char *event;
|
|
char *filter;
|
|
char *trigger;
|
|
char enabled;
|
|
char filter_enabled;
|
|
char trigger_enabled;
|
|
};
|
|
|
|
struct trace_instance {
|
|
struct tracefs_instance *inst;
|
|
struct tep_handle *tep;
|
|
struct trace_seq *seq;
|
|
unsigned long long missed_events;
|
|
unsigned long long processed_events;
|
|
};
|
|
|
|
int trace_instance_init(struct trace_instance *trace, char *tool_name);
|
|
int trace_instance_start(struct trace_instance *trace);
|
|
int trace_instance_stop(struct trace_instance *trace);
|
|
void trace_instance_destroy(struct trace_instance *trace);
|
|
|
|
struct trace_seq *get_trace_seq(void);
|
|
int enable_tracer_by_name(struct tracefs_instance *inst, const char *tracer_name);
|
|
void disable_tracer(struct tracefs_instance *inst);
|
|
|
|
struct tracefs_instance *create_instance(char *instance_name);
|
|
void destroy_instance(struct tracefs_instance *inst);
|
|
|
|
int save_trace_to_file(struct tracefs_instance *inst, const char *filename);
|
|
int collect_registered_events(struct tep_event *tep, struct tep_record *record,
|
|
int cpu, void *context);
|
|
|
|
struct trace_events *trace_event_alloc(const char *event_string);
|
|
void trace_events_disable(struct trace_instance *instance,
|
|
struct trace_events *events);
|
|
void trace_events_destroy(struct trace_instance *instance,
|
|
struct trace_events *events);
|
|
int trace_events_enable(struct trace_instance *instance,
|
|
struct trace_events *events);
|
|
|
|
int trace_event_add_filter(struct trace_events *event, char *filter);
|
|
int trace_event_add_trigger(struct trace_events *event, char *trigger);
|
|
int trace_set_buffer_size(struct trace_instance *trace, int size);
|