[for-next][PATCH] tracing: Fix synthetic print fmt check for use of __get_str()

From: Steven Rostedt
Date: Thu Oct 08 2020 - 15:18:53 EST


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

Head SHA1: 9d8739bc05f6d0f3ad21dc5d56f1edfbb9aa7585


Steven Rostedt (VMware) (1):
tracing: Fix synthetic print fmt check for use of __get_str()

----
kernel/trace/trace_events_synth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---------------------------
commit 9d8739bc05f6d0f3ad21dc5d56f1edfbb9aa7585
Author: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
Date: Wed Oct 7 10:34:34 2020 -0400

tracing: Fix synthetic print fmt check for use of __get_str()

A cut and paste error had the check to use __get_str() test "is_dynamic"
twice, instead of checking "is_string && is_dynamic".

Link: https://lore.kernel.org/r/d34dccd5-96ba-a2d9-46ea-de8807525deb@xxxxxxxxxxxxx

Reported-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
Acked-by: Tom Zanussi <zanussi@xxxxxxxxxx>
Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>

diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c
index 742ce5f62d6d..3b2dcc42b8ee 100644
--- a/kernel/trace/trace_events_synth.c
+++ b/kernel/trace/trace_events_synth.c
@@ -491,7 +491,7 @@ static int __set_synth_event_print_fmt(struct synth_event *event,
pos += snprintf(buf + pos, LEN_OR_ZERO, "\"");

for (i = 0; i < event->n_fields; i++) {
- if (event->fields[i]->is_dynamic &&
+ if (event->fields[i]->is_string &&
event->fields[i]->is_dynamic)
pos += snprintf(buf + pos, LEN_OR_ZERO,
", __get_str(%s)", event->fields[i]->name);