]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tracing: arm: arm64: Hide trace events ipi_raise, ipi_entry and ipi_exit
authorSteven Rostedt <rostedt@goodmis.org>
Tue, 22 Jul 2025 14:37:14 +0000 (10:37 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 23 Jul 2025 18:58:55 +0000 (14:58 -0400)
The ipi tracepoints are mostly generic, but the tracepoints ipi_raise,
ipi_entry and ipi_exit are only used by arm and arm64. This means these
trace events are wasting memory in all the other architectures that do not
use them.

Add CONFIG_HAVE_EXTRA_IPI_TRACEPOINTS and have arm and arm64 select it to
enable these trace events. The config makes it easy if other architectures
decide to trace these as well.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Will Deacon <will@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Nicolas Pitre <nico@fluxnic.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/20250722103714.64eba013@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm/Kconfig
arch/arm64/Kconfig
include/trace/events/ipi.h
kernel/trace/Kconfig

index 3072731fe09c5911996d2e5fcc384c424f72f638..e8f98217d0fc8c7f0ef24f3ffabe5b563bd3aad3 100644 (file)
@@ -102,6 +102,7 @@ config ARM
        select HAVE_BUILDTIME_MCOUNT_SORT
        select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL
        select HAVE_DMA_CONTIGUOUS if MMU
+       select HAVE_EXTRA_IPI_TRACEPOINTS
        select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
        select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
        select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
index 393d71124f5d29fb03540554f3ba718259028864..a027cb81dfcc84fb3c3b7cf742b8e1a52d0c213c 100644 (file)
@@ -136,6 +136,7 @@ config ARM64
        select CPU_PM if (SUSPEND || CPU_IDLE)
        select CPUMASK_OFFSTACK if NR_CPUS > 256
        select DCACHE_WORD_ACCESS
+       select HAVE_EXTRA_IPI_TRACEPOINTS
        select DYNAMIC_FTRACE if FUNCTION_TRACER
        select DMA_BOUNCE_UNALIGNED_KMALLOC
        select DMA_DIRECT_REMAP
index 3de9bfc982cea396b2937f282a14ebe28c25c403..9912f0ded81d530123ed49b2ce4eb46b5aa0ce6e 100644 (file)
@@ -7,34 +7,6 @@
 
 #include <linux/tracepoint.h>
 
-/**
- * ipi_raise - called when a smp cross call is made
- *
- * @mask: mask of recipient CPUs for the IPI
- * @reason: string identifying the IPI purpose
- *
- * It is necessary for @reason to be a static string declared with
- * __tracepoint_string.
- */
-TRACE_EVENT(ipi_raise,
-
-       TP_PROTO(const struct cpumask *mask, const char *reason),
-
-       TP_ARGS(mask, reason),
-
-       TP_STRUCT__entry(
-               __bitmask(target_cpus, nr_cpumask_bits)
-               __field(const char *, reason)
-       ),
-
-       TP_fast_assign(
-               __assign_bitmask(target_cpus, cpumask_bits(mask), nr_cpumask_bits);
-               __entry->reason = reason;
-       ),
-
-       TP_printk("target_mask=%s (%s)", __get_bitmask(target_cpus), __entry->reason)
-);
-
 TRACE_EVENT(ipi_send_cpu,
 
        TP_PROTO(const unsigned int cpu, unsigned long callsite, void *callback),
@@ -79,6 +51,35 @@ TRACE_EVENT(ipi_send_cpumask,
                  __get_cpumask(cpumask), __entry->callsite, __entry->callback)
 );
 
+#ifdef CONFIG_HAVE_EXTRA_IPI_TRACEPOINTS
+/**
+ * ipi_raise - called when a smp cross call is made
+ *
+ * @mask: mask of recipient CPUs for the IPI
+ * @reason: string identifying the IPI purpose
+ *
+ * It is necessary for @reason to be a static string declared with
+ * __tracepoint_string.
+ */
+TRACE_EVENT(ipi_raise,
+
+       TP_PROTO(const struct cpumask *mask, const char *reason),
+
+       TP_ARGS(mask, reason),
+
+       TP_STRUCT__entry(
+               __bitmask(target_cpus, nr_cpumask_bits)
+               __field(const char *, reason)
+       ),
+
+       TP_fast_assign(
+               __assign_bitmask(target_cpus, cpumask_bits(mask), nr_cpumask_bits);
+               __entry->reason = reason;
+       ),
+
+       TP_printk("target_mask=%s (%s)", __get_bitmask(target_cpus), __entry->reason)
+);
+
 DECLARE_EVENT_CLASS(ipi_handler,
 
        TP_PROTO(const char *reason),
@@ -127,6 +128,7 @@ DEFINE_EVENT(ipi_handler, ipi_exit,
 
        TP_ARGS(reason)
 );
+#endif /* CONFIG_HAVE_EXTRA_IPI_TRACEPOINTS */
 
 #endif /* _TRACE_IPI_H */
 
index a3f35c7d83b6c5e669635f9e3f9ac5347ff72337..35448f7233fe61e92995e67ab01257f531a3519b 100644 (file)
@@ -53,6 +53,12 @@ config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
 config HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
        bool
 
+config HAVE_EXTRA_IPI_TRACEPOINTS
+       bool
+       help
+        For architectures that use ipi_raise, ipi_entry and ipi_exit
+        tracepoints.
+
 config HAVE_DYNAMIC_FTRACE_WITH_ARGS
        bool
        help