Lines Matching defs: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";
80 err_msg("Failed to open trace file\n");
118 struct trace_instance *trace = context;
119 struct trace_seq *s = trace->seq;
130 * trace_instance_destroy - destroy and free a rtla trace instance
132 void trace_instance_destroy(struct trace_instance *trace)
134 if (trace->inst) {
135 disable_tracer(trace->inst);
136 destroy_instance(trace->inst);
137 trace->inst = NULL;
140 if (trace->seq) {
141 free(trace->seq);
142 trace->seq = NULL;
145 if (trace->tep) {
146 tep_free(trace->tep);
147 trace->tep = NULL;
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)
164 trace->seq = calloc(1, sizeof(*trace->seq));
165 if (!trace->seq)
168 trace_seq_init(trace->seq);
170 trace->inst = create_instance(tool_name);
171 if (!trace->inst)
174 trace->tep = tracefs_local_events(NULL);
175 if (!trace->tep)
182 tracefs_trace_off(trace->inst);
187 trace_instance_destroy(trace);
194 int trace_instance_start(struct trace_instance *trace)
196 return tracefs_trace_on(trace->inst);
200 * trace_events_free - free a list of trace events
222 * trace_event_alloc - alloc and parse a single trace event
385 * trace_events_disable - disable all trace events
513 * trace_events_destroy - disable and free all trace events
525 int trace_is_off(struct trace_instance *tool, struct trace_instance *trace)
535 * The trace instance is only enabled when -t is set. IOW, when the system
538 if (trace && !tracefs_trace_is_on(trace->inst))
547 int trace_set_buffer_size(struct trace_instance *trace, int size)
551 debug_msg("Setting trace buffer size to %d Kb\n", size);
552 retval = tracefs_instance_set_buffer_size(trace->inst, size, -1);
554 err_msg("Error setting trace buffer size\n");