define_trace.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Trace files that want to automate creationg of all tracepoints defined
  3. * in their file should include this file. The following are macros that the
  4. * trace file may define:
  5. *
  6. * TRACE_SYSTEM defines the system the tracepoint is for
  7. *
  8. * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h
  9. * This macro may be defined to tell define_trace.h what file to include.
  10. * Note, leave off the ".h".
  11. *
  12. * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace
  13. * then this macro can define the path to use. Note, the path is relative to
  14. * define_trace.h, not the file including it. Full path names for out of tree
  15. * modules must be used.
  16. */
  17. #ifdef CREATE_TRACE_POINTS
  18. /* Prevent recursion */
  19. #undef CREATE_TRACE_POINTS
  20. #include <linux/stringify.h>
  21. #undef TRACE_EVENT
  22. #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
  23. DEFINE_TRACE(name)
  24. #undef DECLARE_TRACE
  25. #define DECLARE_TRACE(name, proto, args) \
  26. DEFINE_TRACE(name)
  27. #undef TRACE_INCLUDE
  28. #undef __TRACE_INCLUDE
  29. #ifndef TRACE_INCLUDE_FILE
  30. # define TRACE_INCLUDE_FILE TRACE_SYSTEM
  31. # define UNDEF_TRACE_INCLUDE_FILE
  32. #endif
  33. #ifndef TRACE_INCLUDE_PATH
  34. # define __TRACE_INCLUDE(system) <trace/events/system.h>
  35. # define UNDEF_TRACE_INCLUDE_PATH
  36. #else
  37. # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
  38. #endif
  39. # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
  40. /* Let the trace headers be reread */
  41. #define TRACE_HEADER_MULTI_READ
  42. #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
  43. #ifdef CONFIG_EVENT_TRACING
  44. #include <trace/ftrace.h>
  45. #endif
  46. #undef TRACE_HEADER_MULTI_READ
  47. /* Only undef what we defined in this file */
  48. #ifdef UNDEF_TRACE_INCLUDE_FILE
  49. # undef TRACE_INCLUDE_FILE
  50. # undef UNDEF_TRACE_INCLUDE_FILE
  51. #endif
  52. #ifdef UNDEF_TRACE_INCLUDE_PATH
  53. # undef TRACE_INCLUDE_PATH
  54. # undef UNDEF_TRACE_INCLUDE_PATH
  55. #endif
  56. /* We may be processing more files */
  57. #define CREATE_TRACE_POINTS
  58. #endif /* CREATE_TRACE_POINTS */