ipi.h 1.9 KB

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