tracing: sched: Hide numa balancing trace events
Steven Rostedt
maintainerPATCH 1/1 tracing: sched: Hide numa balancing trace events
From: Steven Rostedt <[email protected]>
The trace events sched_move_numa, sched_swap_numa and sched_stick_numa are only used when CONFIG_NUMA_BALANCING is enabled. Put an #ifdef guard around the definitions of these trace events so they are not defined when numa balancing is not enabled, otherwise they waste a bit of memory being unused.
--- include/trace/events/sched.h | 2 ++ 1 file changed, 2 insertions(+)
include/trace/events/sched.h +2 -0
@@ -628,6 +628,7 @@ TRACE_EVENT(sched_process_hang, );#endif /* CONFIG_DETECT_HUNG_TASK */ +#ifdef CONFIG_NUMA_BALANCING /* * Tracks migration of tasks from one runqueue to another. Can be used to * detect if automatic NUMA balancing is bouncing between nodes.
@@ -719,6 +720,7 @@ DEFINE_EVENT(sched_numa_pair_template, sched_swap_numa,TP_ARGS (src_tsk, src_cpu, dst_tsk, dst_cpu) ); +#endif /* CONFIG_NUMA_BALANCING */ #ifdef CONFIG_NUMA_BALANCING #define NUMAB_SKIP_REASON \
Signature · 1 line
2.47.2
Steven Rostedt
maintainerQuoted 8 lines · On Tue, 22 Jul 2025 10:48:20 -0400 Steven Rostedt <[email protected]> wrote:
From: Steven Rostedt <[email protected]>
The trace events
sched_move_numa,sched_swap_numaandsched_stick_numaare only used whenCONFIG_NUMA_BALANCINGis enabled. Put an #ifdef guard around the definitions of these trace events so they are not defined when numa balancing is not enabled, otherwise they waste a bit of memory being unused.
I just noticed that I already sent out a version of this patch here:
https://lore.kernel.org/linux-trace-kernel/[email protected]/
Which is a better version than this one.
Quoted 18 lines
Signed-off-by Steven Rostedt (Google) <[email protected]>--- include/trace/events/sched.h | 2 ++ 1 file changed, 2 insertions(+)include/trace/events/sched.h +1
-0@@ -628,6 +628,7 @@ TRACE_EVENT(sched_process_hang, );#endif /* CONFIG_DETECT_HUNG_TASK */ +#ifdef CONFIG_NUMA_BALANCING /* * Tracks migration of tasks from one runqueue to another. Can be used to * detect if automatic NUMA balancing is bouncing between nodes.
include/trace/events/sched.h DEFINE_EVENT(sched_numa_pair_template, sched_swap_numa, · line 725
Quoted 6 lines
include/trace/events/sched.h +1
-0@@ -719,6 +720,7 @@ DEFINE_EVENT(sched_numa_pair_template, sched_swap_numa,TP_ARGS (src_tsk, src_cpu, dst_tsk, dst_cpu) ); +#endif /* CONFIG_NUMA_BALANCING */ #ifdef CONFIG_NUMA_BALANCING
Because You can just remove the above two CPP directives.
So please ignore this one.
-- Steve
Quoted 1 line
include/trace/events/sched.h +0
-0#define NUMAB_SKIP_REASON \