Skip to contentSkip to conversation

tracing: Hide tracepoints when not used for v6.17

PATCH New Steven Rostedt 1 participant 3 messages Jul 26, 2025 Tracing

lore
Share & tools
lore
#0 lore raw

cover tracing: Hide tracepoints when not used for v6.17

git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
unused-tracepoints/for-next

Head SHA1: c2dbaf0af05193fa69f267c37d1f825c1c3a59ab

Steven Rostedt (2):
powerpc/thp: tracing: Hide hugepage events under CONFIG_PPC_BOOK3S_64
tracing: sched: Hide numa events under CONFIG_NUMA_BALANCING

----

 include/trace/events/sched.h | 2 +-
 include/trace/events/thp.h   | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
#1 lore raw

PATCH 1/2 powerpc/thp: tracing: Hide hugepage events under CONFIG_PPC_BOOK3S_64

From: Steven Rostedt <[email protected]>

The events hugepage_set_pmd, hugepage_set_pud, hugepage_update_pmd and hugepage_update_pud are only called when CONFIG_PPC_BOOK3S_64 is defined. As each event can take up to 5K regardless if they are used or not, it's best not to define them when they are not used. Add #ifdef around these events when they are not used.

---
 include/trace/events/thp.h | 2 ++
 1 file changed, 2 insertions(+)
include/trace/events/thp.h +2 -0
index f50048af5fcc..c8fe879d5828 100644
@@ -8,6 +8,7 @@
 #include <linux/types.h>
 #include <linux/tracepoint.h>
 
+#ifdef CONFIG_PPC_BOOK3S_64
 DECLARE_EVENT_CLASS(hugepage_set,
 
 	    TP_PROTO(unsigned long addr, unsigned long pte),
@@ -66,6 +67,7 @@ DEFINE_EVENT(hugepage_update, hugepage_update_pud,
 	    TP_PROTO(unsigned long addr, unsigned long pud, unsigned long clr, unsigned long set),
 	    TP_ARGS(addr, pud, clr, set)
 );
+#endif /* CONFIG_PPC_BOOK3S_64 */
 
 DECLARE_EVENT_CLASS(migration_pmd,
 
Signature · 1 line
2.47.2
#2 lore raw

PATCH 2/2 tracing: sched: Hide numa events under CONFIG_NUMA_BALANCING

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

The events sched_move_numa, sched_stick_numa and sched_swap_numa are only called when CONFIG_NUMA_BALANCING is configured. As each event can take up to 5K of memory in text and meta data regardless if they are used or not, they should not be defined when unused.

Move the #ifdef CONFIG_NUMA_BALANCING to hide these events as well.

---
 include/trace/events/sched.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/trace/events/sched.h +1 -1
index 4e6b2910cec3..0243f32e068a 100644
@@ -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.
@@ -720,7 +721,6 @@ DEFINE_EVENT(sched_numa_pair_template, sched_swap_numa,
 	TP_ARGS(src_tsk, src_cpu, dst_tsk, dst_cpu)
 );
 
-#ifdef CONFIG_NUMA_BALANCING
 #define NUMAB_SKIP_REASON					\
 	EM( NUMAB_SKIP_UNSUITABLE,		"unsuitable" )	\
 	EM( NUMAB_SKIP_SHARED_RO,		"shared_ro" )	\
Signature · 1 line
2.47.2