ipi.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM ipi
  3. #if !defined(_TRACE_IPI_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_IPI_H
  5. #include <linux/tracepoint.h>
  6. /**
  7. * ipi_raise - called when a smp cross call is made
  8. *
  9. * @mask: mask of recipient CPUs for the IPI
  10. * @reason: string identifying the IPI purpose
  11. *
  12. * It is necessary for @reason to be a static string declared with
  13. * __tracepoint_string.
  14. */
  15. TRACE_EVENT(ipi_raise,
  16. TP_PROTO(const struct cpumask *mask, const char *reason),
  17. TP_ARGS(mask, reason),
  18. TP_STRUCT__entry(
  19. __bitmask(target_cpus, nr_cpumask_bits)
  20. __field(const char *, reason)
  21. ),
  22. TP_fast_assign(
  23. __assign_bitmask(target_cpus, cpumask_bits(mask), nr_cpumask_bits);
  24. __entry->reason = reason;
  25. ),
  26. TP_printk("target_mask=%s (%s)", __get_bitmask(target_cpus), __entry->reason)
  27. );
  28. DECLARE_EVENT_CLASS(ipi_handler,
  29. TP_PROTO(const char *reason),
  30. TP_ARGS(reason),
  31. TP_STRUCT__entry(
  32. __field(const char *, reason)
  33. ),
  34. TP_fast_assign(
  35. __entry->reason = reason;
  36. ),
  37. TP_printk("(%s)", __entry->reason)
  38. );
  39. /**
  40. * ipi_entry - called immediately before the IPI handler
  41. *
  42. * @reason: string identifying the IPI purpose
  43. *
  44. * It is necessary for @reason to be a static string declared with
  45. * __tracepoint_string, ideally the same as used with trace_ipi_raise
  46. * for that IPI.
  47. */
  48. DEFINE_EVENT(ipi_handler, ipi_entry,
  49. TP_PROTO(const char *reason),
  50. TP_ARGS(reason)
  51. );
  52. /**
  53. * ipi_exit - called immediately after the IPI handler returns
  54. *
  55. * @reason: string identifying the IPI purpose
  56. *
  57. * It is necessary for @reason to be a static string declared with
  58. * __tracepoint_string, ideally the same as used with trace_ipi_raise for
  59. * that IPI.
  60. */
  61. DEFINE_EVENT(ipi_handler, ipi_exit,
  62. TP_PROTO(const char *reason),
  63. TP_ARGS(reason)
  64. );
  65. #endif /* _TRACE_IPI_H */
  66. /* This part must be outside protection */
  67. #include <trace/define_trace.h>