Skip to contentSkip to conversation

tracing-remove-size-parameter-in-__trace_puts.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Feb 1

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: tracing: remove size parameter in __trace_puts()
has been removed from the -mm tree. Its filename was
tracing-remove-size-parameter-in-__trace_puts.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Steven Rostedt <[email protected]>
Subject: tracing: remove size parameter in __trace_puts()
Date: Thu, 15 Jan 2026 23:25:08 -0500

The __trace_puts() function takes a string pointer and the size of the string itself. All users currently simply pass in the strlen() of the string it is also passing in. There's no reason to pass in the size. Instead have the __trace_puts() function do the strlen() within the function itself.

This fixes a header recursion issue where using strlen() in the macro calling __trace_puts() requires adding #include <linux/string.h> in order to use strlen(). Removing the use of strlen() from the header fixes the recursion issue.

---

 include/linux/kernel.h |    4 ++--
 kernel/trace/trace.c   |    7 +++----
 kernel/trace/trace.h   |    2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)
include/linux/kernel.h renamed from include/linux/kernel.h~tracing-remove-size-parameter-in-__trace_puts +2 -2
@@ -328,10 +328,10 @@ int __trace_printk(unsigned long ip, con
 	if (__builtin_constant_p(str))					\
 		__trace_bputs(_THIS_IP_, trace_printk_fmt);		\
 	else								\
-		__trace_puts(_THIS_IP_, str, strlen(str));		\
+		__trace_puts(_THIS_IP_, str);				\
 })
 extern int __trace_bputs(unsigned long ip, const char *str);
-extern int __trace_puts(unsigned long ip, const char *str, int size);
+extern int __trace_puts(unsigned long ip, const char *str);
 
 extern void trace_dump_stack(int skip);
 
kernel/trace/trace.c renamed from kernel/trace/trace.c~tracing-remove-size-parameter-in-__trace_puts +3 -4
@@ -1178,11 +1178,10 @@ EXPORT_SYMBOL_GPL(__trace_array_puts);
  * __trace_puts - write a constant string into the trace buffer.
  * @ip:	   The address of the caller
  * @str:   The constant string to write
- * @size:  The size of the string.
  */
-int __trace_puts(unsigned long ip, const char *str, int size)
+int __trace_puts(unsigned long ip, const char *str)
 {
-	return __trace_array_puts(printk_trace, ip, str, size);
+	return __trace_array_puts(printk_trace, ip, str, strlen(str));
 }
 EXPORT_SYMBOL_GPL(__trace_puts);
 
@@ -1201,7 +1200,7 @@ int __trace_bputs(unsigned long ip, cons
 	int size = sizeof(struct bputs_entry);
 
 	if (!printk_binsafe(tr))
-		return __trace_puts(ip, str, strlen(str));
+		return __trace_puts(ip, str);
 
 	if (!(tr->trace_flags & TRACE_ITER(PRINTK)))
 		return 0;
kernel/trace/trace.h renamed from kernel/trace/trace.h~tracing-remove-size-parameter-in-__trace_puts +1 -1
@@ -2116,7 +2116,7 @@ extern void tracing_log_err(struct trace
  * about performance). The internal_trace_puts() is for such
  * a purpose.
  */
-#define internal_trace_puts(str) __trace_puts(_THIS_IP_, str, strlen(str))
+#define internal_trace_puts(str) __trace_puts(_THIS_IP_, str)
 
 #undef FTRACE_ENTRY
 #define FTRACE_ENTRY(call, struct_name, id, tstruct, print)	\

_

Patches currently in -mm which might be from [email protected] are