trace_benchmark.h 836 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM benchmark
  3. #if !defined(_TRACE_BENCHMARK_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_BENCHMARK_H
  5. #include <linux/tracepoint.h>
  6. extern void trace_benchmark_reg(void);
  7. extern void trace_benchmark_unreg(void);
  8. #define BENCHMARK_EVENT_STRLEN 128
  9. TRACE_EVENT_FN(benchmark_event,
  10. TP_PROTO(const char *str),
  11. TP_ARGS(str),
  12. TP_STRUCT__entry(
  13. __array( char, str, BENCHMARK_EVENT_STRLEN )
  14. ),
  15. TP_fast_assign(
  16. memcpy(__entry->str, str, BENCHMARK_EVENT_STRLEN);
  17. ),
  18. TP_printk("%s", __entry->str),
  19. trace_benchmark_reg, trace_benchmark_unreg
  20. );
  21. #endif /* _TRACE_BENCHMARK_H */
  22. #undef TRACE_INCLUDE_FILE
  23. #undef TRACE_INCLUDE_PATH
  24. #define TRACE_INCLUDE_PATH .
  25. #define TRACE_INCLUDE_FILE trace_benchmark
  26. /* This part must be outside protection */
  27. #include <trace/define_trace.h>