simple.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Simple trace backend
  3. *
  4. * Copyright IBM, Corp. 2010
  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. */
  10. #ifndef TRACE_SIMPLE_H
  11. #define TRACE_SIMPLE_H
  12. #include <stdint.h>
  13. #include <stdbool.h>
  14. #include <stdio.h>
  15. typedef uint64_t TraceEventID;
  16. typedef struct {
  17. const char *tp_name;
  18. bool state;
  19. } TraceEvent;
  20. void trace0(TraceEventID event);
  21. void trace1(TraceEventID event, uint64_t x1);
  22. void trace2(TraceEventID event, uint64_t x1, uint64_t x2);
  23. void trace3(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3);
  24. void trace4(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4);
  25. void trace5(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5);
  26. void trace6(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6);
  27. void st_print_trace(FILE *stream, fprintf_function stream_printf);
  28. void st_print_trace_file_status(FILE *stream, fprintf_function stream_printf);
  29. void st_set_trace_file_enabled(bool enable);
  30. bool st_set_trace_file(const char *file);
  31. void st_flush_trace_buffer(void);
  32. #endif /* TRACE_SIMPLE_H */