Lines Matching full:trace

10 #include "trace.h"
51 * create_instance - create a trace instance with *instance_name
59 * destroy_instance - remove a trace instance and free the data
68 * save_trace_to_file - save the trace output of the instance to the file
72 const char *file = "trace"; in save_trace_to_file()
80 err_msg("Failed to open trace file\n"); in save_trace_to_file()
118 struct trace_instance *trace = context; in collect_registered_events() local
119 struct trace_seq *s = trace->seq; in collect_registered_events()
130 * trace_instance_destroy - destroy and free a rtla trace instance
132 void trace_instance_destroy(struct trace_instance *trace) in trace_instance_destroy() argument
134 if (trace->inst) { in trace_instance_destroy()
135 disable_tracer(trace->inst); in trace_instance_destroy()
136 destroy_instance(trace->inst); in trace_instance_destroy()
137 trace->inst = NULL; in trace_instance_destroy()
140 if (trace->seq) { in trace_instance_destroy()
141 free(trace->seq); in trace_instance_destroy()
142 trace->seq = NULL; in trace_instance_destroy()
145 if (trace->tep) { in trace_instance_destroy()
146 tep_free(trace->tep); in trace_instance_destroy()
147 trace->tep = NULL; in trace_instance_destroy()
152 * trace_instance_init - create an rtla trace instance
158 * Note that the trace instance is returned disabled. This allows
160 * to the kernel threads, before starting generating trace entries.
162 int trace_instance_init(struct trace_instance *trace, char *tool_name) in trace_instance_init() argument
164 trace->seq = calloc(1, sizeof(*trace->seq)); in trace_instance_init()
165 if (!trace->seq) in trace_instance_init()
168 trace_seq_init(trace->seq); in trace_instance_init()
170 trace->inst = create_instance(tool_name); in trace_instance_init()
171 if (!trace->inst) in trace_instance_init()
174 trace->tep = tracefs_local_events(NULL); in trace_instance_init()
175 if (!trace->tep) in trace_instance_init()
182 tracefs_trace_off(trace->inst); in trace_instance_init()
187 trace_instance_destroy(trace); in trace_instance_init()
194 int trace_instance_start(struct trace_instance *trace) in trace_instance_start() argument
196 return tracefs_trace_on(trace->inst); in trace_instance_start()
202 int trace_instance_stop(struct trace_instance *trace) in trace_instance_stop() argument
204 return tracefs_trace_off(trace->inst); in trace_instance_stop()
208 * trace_events_free - free a list of trace events
230 * trace_event_alloc - alloc and parse a single trace event
393 * trace_events_disable - disable all trace events
521 * trace_events_destroy - disable and free all trace events
533 int trace_is_off(struct trace_instance *tool, struct trace_instance *trace) in trace_is_off() argument
543 * The trace instance is only enabled when -t is set. IOW, when the system in trace_is_off()
546 if (trace && !tracefs_trace_is_on(trace->inst)) in trace_is_off()