stderr.c 784 B

123456789101112131415161718192021222324252627282930
  1. #include "trace.h"
  2. #include "trace/control.h"
  3. void trace_print_events(FILE *stream, fprintf_function stream_printf)
  4. {
  5. TraceEventID i;
  6. for (i = 0; i < trace_event_count(); i++) {
  7. TraceEvent *ev = trace_event_id(i);
  8. stream_printf(stream, "%s [Event ID %u] : state %u\n",
  9. trace_event_get_name(ev), i, trace_event_get_state_dynamic(ev));
  10. }
  11. }
  12. void trace_event_set_state_dynamic_backend(TraceEvent *ev, bool state)
  13. {
  14. ev->dstate = state;
  15. }
  16. bool trace_backend_init(const char *events, const char *file)
  17. {
  18. if (file) {
  19. fprintf(stderr, "error: -trace file=...: "
  20. "option not supported by the selected tracing backend\n");
  21. return false;
  22. }
  23. trace_backend_init_events(events);
  24. return true;
  25. }