control.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Interface for configuring and controlling the state of tracing events.
  3. *
  4. * Copyright (C) 2011 Lluís Vilanova <vilanova@ac.upc.edu>
  5. *
  6. * This work is licensed under the terms of the GNU GPL, version 2. See
  7. * the COPYING file in the top-level directory.
  8. */
  9. #ifndef TRACE_CONTROL_H
  10. #define TRACE_CONTROL_H
  11. #include "qemu-common.h"
  12. /** Print the state of all events. */
  13. void trace_print_events(FILE *stream, fprintf_function stream_printf);
  14. /** Set the state of an event.
  15. *
  16. * @return Whether the state changed.
  17. */
  18. bool trace_event_set_state(const char *name, bool state);
  19. /** Initialize the tracing backend.
  20. *
  21. * @events Name of file with events to be enabled at startup; may be NULL.
  22. * Corresponds to commandline option "-trace events=...".
  23. * @file Name of trace output file; may be NULL.
  24. * Corresponds to commandline option "-trace file=...".
  25. * @return Whether the backend could be successfully initialized.
  26. */
  27. bool trace_backend_init(const char *events, const char *file);
  28. /** Generic function to initialize the state of events.
  29. *
  30. * @fname Name of file with events to enable; may be NULL.
  31. */
  32. void trace_backend_init_events(const char *fname);
  33. #endif /* TRACE_CONTROL_H */