[PATCH] tracing: Fix logged instance name on creation failure

From
Vincent Donnefort <vdonnefort@google.com>
Date
2026-08-07 08:54:27
Also in
lkml
When boot instance creation fails, the kernel incorrectly logs "(null)"
as the instance name because strsep() consumes curr_str entirely during
parsing.

Print the properly parsed name variable instead. And while at it log
the error code.

Fixes: cb1f98c5e574 ("tracing: Add creation of instances at boot command line")
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 01a5e87af299..26ae682021c8 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -9726,7 +9726,8 @@ __init static void enable_instances(void)
 
 		tr = trace_array_create_systems(name, NULL, addr, size);
 		if (IS_ERR(tr)) {
-			pr_warn("Tracing: Failed to create instance buffer %s\n", curr_str);
+			pr_warn("Tracing: Failed to create instance buffer '%s' (%ld)\n", name,
+				PTR_ERR(tr));
 			continue;
 		}
 
base-commit: 075b74841bd0065a3bda3440873c747938e69b68
-- 
2.55.0.654.g21b8a5bc05-goog
Thread (2 messages) 2 messages, 2 authors, last reply 2026-08-07
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help