Skip to content

Commit 9f0cb91

Browse files
committed
tracing: arm: arm64: Hide trace events ipi_raise, ipi_entry and ipi_exit
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 <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Will Deacon <[email protected]> Cc: Russell King <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Valentin Schneider <[email protected]> Cc: Nicolas Pitre <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Steven Rostedt (Google) <[email protected]> Acked-by: Catalin Marinas <[email protected]>
1 parent a594dec commit 9f0cb91

File tree

4 files changed

+38
-28
lines changed

4 files changed

+38
-28
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ config ARM
102102
select HAVE_BUILDTIME_MCOUNT_SORT
103103
select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL
104104
select HAVE_DMA_CONTIGUOUS if MMU
105+
select HAVE_EXTRA_IPI_TRACEPOINTS
105106
select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
106107
select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
107108
select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU

arch/arm64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ config ARM64
136136
select CPU_PM if (SUSPEND || CPU_IDLE)
137137
select CPUMASK_OFFSTACK if NR_CPUS > 256
138138
select DCACHE_WORD_ACCESS
139+
select HAVE_EXTRA_IPI_TRACEPOINTS
139140
select DYNAMIC_FTRACE if FUNCTION_TRACER
140141
select DMA_BOUNCE_UNALIGNED_KMALLOC
141142
select DMA_DIRECT_REMAP

include/trace/events/ipi.h

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,6 @@
77

88
#include <linux/tracepoint.h>
99

10-
/**
11-
* ipi_raise - called when a smp cross call is made
12-
*
13-
* @mask: mask of recipient CPUs for the IPI
14-
* @reason: string identifying the IPI purpose
15-
*
16-
* It is necessary for @reason to be a static string declared with
17-
* __tracepoint_string.
18-
*/
19-
TRACE_EVENT(ipi_raise,
20-
21-
TP_PROTO(const struct cpumask *mask, const char *reason),
22-
23-
TP_ARGS(mask, reason),
24-
25-
TP_STRUCT__entry(
26-
__bitmask(target_cpus, nr_cpumask_bits)
27-
__field(const char *, reason)
28-
),
29-
30-
TP_fast_assign(
31-
__assign_bitmask(target_cpus, cpumask_bits(mask), nr_cpumask_bits);
32-
__entry->reason = reason;
33-
),
34-
35-
TP_printk("target_mask=%s (%s)", __get_bitmask(target_cpus), __entry->reason)
36-
);
37-
3810
TRACE_EVENT(ipi_send_cpu,
3911

4012
TP_PROTO(const unsigned int cpu, unsigned long callsite, void *callback),
@@ -79,6 +51,35 @@ TRACE_EVENT(ipi_send_cpumask,
7951
__get_cpumask(cpumask), __entry->callsite, __entry->callback)
8052
);
8153

54+
#ifdef CONFIG_HAVE_EXTRA_IPI_TRACEPOINTS
55+
/**
56+
* ipi_raise - called when a smp cross call is made
57+
*
58+
* @mask: mask of recipient CPUs for the IPI
59+
* @reason: string identifying the IPI purpose
60+
*
61+
* It is necessary for @reason to be a static string declared with
62+
* __tracepoint_string.
63+
*/
64+
TRACE_EVENT(ipi_raise,
65+
66+
TP_PROTO(const struct cpumask *mask, const char *reason),
67+
68+
TP_ARGS(mask, reason),
69+
70+
TP_STRUCT__entry(
71+
__bitmask(target_cpus, nr_cpumask_bits)
72+
__field(const char *, reason)
73+
),
74+
75+
TP_fast_assign(
76+
__assign_bitmask(target_cpus, cpumask_bits(mask), nr_cpumask_bits);
77+
__entry->reason = reason;
78+
),
79+
80+
TP_printk("target_mask=%s (%s)", __get_bitmask(target_cpus), __entry->reason)
81+
);
82+
8283
DECLARE_EVENT_CLASS(ipi_handler,
8384

8485
TP_PROTO(const char *reason),
@@ -127,6 +128,7 @@ DEFINE_EVENT(ipi_handler, ipi_exit,
127128

128129
TP_ARGS(reason)
129130
);
131+
#endif /* CONFIG_HAVE_EXTRA_IPI_TRACEPOINTS */
130132

131133
#endif /* _TRACE_IPI_H */
132134

kernel/trace/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ config HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
5353
config HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
5454
bool
5555

56+
config HAVE_EXTRA_IPI_TRACEPOINTS
57+
bool
58+
help
59+
For architectures that use ipi_raise, ipi_entry and ipi_exit
60+
tracepoints.
61+
5662
config HAVE_DYNAMIC_FTRACE_WITH_ARGS
5763
bool
5864
help

0 commit comments

Comments
 (0)