mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 22:03:17 +01:00
tracing: Fix synth event printk format for str fields
The printk format for synth event uses "%.*s" to print string fields,
but then only passes the pointer part as var arg.
Replace %.*s with %s as the C string is guaranteed to be null-terminated.
The output in print fmt should never have been updated as __get_str()
handles the string limit because it can access the length of the string in
the string meta data that is saved in the ring buffer.
Cc: [email protected]
Cc: Masami Hiramatsu <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Fixes: 8db4d6bfbb ("tracing: Change synthetic event string format to limit printed length")
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Douglas Raillard <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
This commit is contained in:
1 parent
8eb1518642
commit
4d38328eb4
1 file changed
+1
-1
@@ -305,7 +305,7 @@ static const char *synth_field_fmt(char *type)
|
||||
else if (strcmp(type, "gfp_t") == 0)
|
||||
fmt = "%x";
|
||||
else if (synth_field_is_string(type))
|
||||
fmt = "%.*s";
|
||||
fmt = "%s";
|
||||
else if (synth_field_is_stack(type))
|
||||
fmt = "%s";
|
||||
|
||||
|
||||
Reference in new issue
Block a user