]> git.proxmox.com Git - qemu.git/blob - trace/stderr.c
Merge remote-tracking branch 'kraxel/usb.26' into staging
[qemu.git] / trace / stderr.c
1 #include "trace.h"
2 #include "trace/control.h"
3
4
5 void trace_print_events(FILE *stream, fprintf_function stream_printf)
6 {
7 unsigned int i;
8
9 for (i = 0; i < NR_TRACE_EVENTS; i++) {
10 stream_printf(stream, "%s [Event ID %u] : state %u\n",
11 trace_list[i].tp_name, i, trace_list[i].state);
12 }
13 }
14
15 bool trace_event_set_state(const char *name, bool state)
16 {
17 unsigned int i;
18
19 for (i = 0; i < NR_TRACE_EVENTS; i++) {
20 if (!strcmp(trace_list[i].tp_name, name)) {
21 trace_list[i].state = state;
22 return true;
23 }
24 }
25 return false;
26 }
27
28 bool trace_backend_init(const char *events, const char *file)
29 {
30 if (file) {
31 fprintf(stderr, "error: -trace file=...: "
32 "option not supported by the selected tracing backend\n");
33 return false;
34 }
35 trace_backend_init_events(events);
36 return true;
37 }