With the addition of --trigger option, it is also possible to stop the trace from the -t tracing instance using the traceoff trigger. Make rtla tools to check if the trace is stopped also in the trace instance, stopping the execution of the tool. Link: https://lkml.kernel.org/r/59fc7c6f23dddd5c8b7ef1782cf3da51ea2ce0f5.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira <bristot@kernel.org> Cc: Clark Williams <williams@redhat.com> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
50 lines
1.7 KiB
C
50 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;
|
|
};
|
|
|
|
int trace_instance_init(struct trace_instance *trace, char *tool_name);
|
|
int trace_instance_start(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);
|
|
|
|
int enable_osnoise(struct trace_instance *trace);
|
|
int enable_timerlat(struct trace_instance *trace);
|
|
|
|
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_is_off(struct trace_instance *tool, struct trace_instance *trace);
|