blob: e212efd64d1466f465cd4b6adac7a8a7d3edca5b [file] [log] [blame]
Lluís9a82b6a2011-08-31 20:31:51 +02001#include "trace.h"
2#include "trace/control.h"
3
4
5void trace_print_events(FILE *stream, fprintf_function stream_printf)
6{
Lluís Vilanovac6f18b92013-03-05 14:48:00 +01007 TraceEventID i;
Lluís9a82b6a2011-08-31 20:31:51 +02008
Lluís Vilanovac6f18b92013-03-05 14:48:00 +01009 for (i = 0; i < trace_event_count(); i++) {
10 TraceEvent *ev = trace_event_id(i);
Lluís9a82b6a2011-08-31 20:31:51 +020011 stream_printf(stream, "%s [Event ID %u] : state %u\n",
Lluís Vilanovac6f18b92013-03-05 14:48:00 +010012 trace_event_get_name(ev), i, trace_event_get_state_dynamic(ev));
Lluís9a82b6a2011-08-31 20:31:51 +020013 }
14}
15
Lluís Vilanovac6f18b92013-03-05 14:48:00 +010016void trace_event_set_state_dynamic_backend(TraceEvent *ev, bool state)
Lluís9a82b6a2011-08-31 20:31:51 +020017{
Lluís Vilanovac6f18b92013-03-05 14:48:00 +010018 ev->dstate = state;
Lluís9a82b6a2011-08-31 20:31:51 +020019}
20
21bool trace_backend_init(const char *events, const char *file)
22{
23 if (file) {
24 fprintf(stderr, "error: -trace file=...: "
25 "option not supported by the selected tracing backend\n");
26 return false;
27 }
28 trace_backend_init_events(events);
29 return true;
30}