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