Skip to contentSkip to conversation

tracing: Updates for 6.15

PATCH New Steven Rostedt 1 participant 4 messages Mar 1, 2025

Subsystems (2)
lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

cover tracing: Updates for 6.15

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

Head SHA1: a9a69ea8e363ccc7dbd49baec9f557cca79bcbe9

Hengqi Chen (1):
tracing: Remove orphaned event_trace_printk

Steven Rostedt (1):
tracing: gfp: Remove duplication of recording GFP flags

Zhouyi Zhou (1):
ring-buffer: Fix typo in comment about header page pointer

----

 include/linux/trace_events.h   | 18 ------------------
 include/trace/events/mmflags.h | 41 ++++++++++-------------------------------
 kernel/trace/ring_buffer.c     |  2 +-
 3 files changed, 11 insertions(+), 50 deletions(-)
author maintainer
#1 lore raw

PATCH 1/3 ring-buffer: Fix typo in comment about header page pointer

From: Zhouyi Zhou <[email protected]>

Fix typo in comment about header page pointer in function rb_get_reader_page.

---
 kernel/trace/ring_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ring_buffer.c +1 -1
index bb6089c2951e..9d4d951090d3 100644
@@ -5318,7 +5318,7 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
 	 * moving it. The page before the header page has the
 	 * flag bit '1' set if it is pointing to the page we want.
 	 * but if the writer is in the process of moving it
-	 * than it will be '2' or already moved '0'.
+	 * then it will be '2' or already moved '0'.
 	 */
 
 	ret = rb_head_page_replace(reader, cpu_buffer->reader_page);
Signature · 1 line
2.47.2
author maintainer
#2 lore raw

PATCH 2/3 tracing: Remove orphaned event_trace_printk

In reply to Steven Rostedt

From: Hengqi Chen <[email protected]>

The event_trace_printk macro has no callers since commit b8e65554d80b ("tracing: remove deprecated TRACE_FORMAT"). So drop it.

---
 include/linux/trace_events.h | 18 ------------------
 1 file changed, 18 deletions(-)
include/linux/trace_events.h +0 -18
index 5caea596fef0..fa9cf4292dff 100644
@@ -859,24 +859,6 @@ int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set);
 int trace_set_clr_event(const char *system, const char *event, int set);
 int trace_array_set_clr_event(struct trace_array *tr, const char *system,
 		const char *event, bool enable);
-/*
- * The double __builtin_constant_p is because gcc will give us an error
- * if we try to allocate the static variable to fmt if it is not a
- * constant. Even with the outer if statement optimizing out.
- */
-#define event_trace_printk(ip, fmt, args...)				\
-do {									\
-	__trace_printk_check_format(fmt, ##args);			\
-	tracing_record_cmdline(current);				\
-	if (__builtin_constant_p(fmt)) {				\
-		static const char *trace_printk_fmt			\
-		  __section("__trace_printk_fmt") =			\
-			__builtin_constant_p(fmt) ? fmt : NULL;		\
-									\
-		__trace_bprintk(ip, trace_printk_fmt, ##args);		\
-	} else								\
-		__trace_printk(ip, fmt, ##args);			\
-} while (0)
 
 #ifdef CONFIG_PERF_EVENTS
 struct perf_event;
Signature · 1 line
2.47.2
author maintainer
#3 lore raw

PATCH 3/3 tracing: gfp: Remove duplication of recording GFP flags

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

The gfp_flags when recorded in the trace require being converted from their numbers to values. Various macros are used to help facilitate this, but there's two sets of macros that need to keep track of the same GFP flags to stay in sync.

Commit 60295b944ff68 ("tracing: gfp: Fix the GFP enum values shown for user space tracing tools") added a TRACE_GFP_FLAGS macro that holds the enum ___GFP_*_BIT defined bits, and creates the TRACE_DEFINE_ENUM() wrapper around them.

The __def_gfpflag_names() macro creates the mapping of various flags or multiple flags to give them human readable names via the __print_flags() tracing helper macro.

As the TRACE_GFP_FLAGS is a subset of the __def_gfpflags_names(), it can be used to cover the individual bit names, by redefining the internal macro TRACE_GFP_EM():

  #undef TRACE_GFP_EM
  #define TRACE_GFP_EM(a) gfpflag_string(__GFP_##a),

This will remove the bits that are duplicate between the two macros. If a new bit is created, only the TRACE_GFP_FLAGS needs to be updated and that will also update the __def_gfpflags_names() macro.

Cc Masami Hiramatsu <[email protected]>
Cc Mathieu Desnoyers <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Michael Petlan <[email protected]>
Cc Veronika Molnarova <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Linus Torvalds <[email protected]>
---
 include/trace/events/mmflags.h | 41 +++++++++-------------------------
 1 file changed, 10 insertions(+), 31 deletions(-)
include/trace/events/mmflags.h +10 -31
index 72fbfe3caeaf..82371177ef79 100644
@@ -78,6 +78,13 @@ TRACE_DEFINE_ENUM(___GFP_LAST_BIT);
 
 #define gfpflag_string(flag) {(__force unsigned long)flag, #flag}
 
+/*
+ * For the values that match the bits, use the TRACE_GFP_FLAGS
+ * which will allow any updates to be included automatically.
+ */
+#undef TRACE_GFP_EM
+#define TRACE_GFP_EM(a) gfpflag_string(__GFP_##a),
+
 #define __def_gfpflag_names			\
 	gfpflag_string(GFP_TRANSHUGE),		\
 	gfpflag_string(GFP_TRANSHUGE_LIGHT),	\
@@ -91,41 +98,13 @@ TRACE_DEFINE_ENUM(___GFP_LAST_BIT);
 	gfpflag_string(GFP_NOIO),		\
 	gfpflag_string(GFP_NOWAIT),		\
 	gfpflag_string(GFP_DMA),		\
-	gfpflag_string(__GFP_HIGHMEM),		\
 	gfpflag_string(GFP_DMA32),		\
-	gfpflag_string(__GFP_HIGH),		\
-	gfpflag_string(__GFP_IO),		\
-	gfpflag_string(__GFP_FS),		\
-	gfpflag_string(__GFP_NOWARN),		\
-	gfpflag_string(__GFP_RETRY_MAYFAIL),	\
-	gfpflag_string(__GFP_NOFAIL),		\
-	gfpflag_string(__GFP_NORETRY),		\
-	gfpflag_string(__GFP_COMP),		\
-	gfpflag_string(__GFP_ZERO),		\
-	gfpflag_string(__GFP_NOMEMALLOC),	\
-	gfpflag_string(__GFP_MEMALLOC),		\
-	gfpflag_string(__GFP_HARDWALL),		\
-	gfpflag_string(__GFP_THISNODE),		\
-	gfpflag_string(__GFP_RECLAIMABLE),	\
-	gfpflag_string(__GFP_MOVABLE),		\
-	gfpflag_string(__GFP_ACCOUNT),		\
-	gfpflag_string(__GFP_WRITE),		\
 	gfpflag_string(__GFP_RECLAIM),		\
-	gfpflag_string(__GFP_DIRECT_RECLAIM),	\
-	gfpflag_string(__GFP_KSWAPD_RECLAIM),	\
-	gfpflag_string(__GFP_ZEROTAGS)
-
-#ifdef CONFIG_KASAN_HW_TAGS
-#define __def_gfpflag_names_kasan ,			\
-	gfpflag_string(__GFP_SKIP_ZERO),		\
-	gfpflag_string(__GFP_SKIP_KASAN)
-#else
-#define __def_gfpflag_names_kasan
-#endif
+	TRACE_GFP_FLAGS				\
+	{ 0, "none" }
 
 #define show_gfp_flags(flags)						\
-	(flags) ? __print_flags(flags, "|",				\
-	__def_gfpflag_names __def_gfpflag_names_kasan			\
+	(flags) ? __print_flags(flags, "|", __def_gfpflag_names		\
 	) : "none"
 
 #ifdef CONFIG_MMU
Signature · 1 line
2.47.2