diff mbox series

libtraceevent/sched_switch: Do not have sched_switch plugin complain about target_cpu

Message ID 20210909160656.21f27793@gandalf.local.home (mailing list archive)
State Accepted
Commit 4a31090a8a36137935e36885092aeda5a70a931a
Headers show
Series libtraceevent/sched_switch: Do not have sched_switch plugin complain about target_cpu | expand

Commit Message

Steven Rostedt Sept. 9, 2021, 8:06 p.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

Older kernels did not have "target_cpu" as a field for wake up events. Do
not complain if it doesn't exist.

Fixes: 159f118588 ("libtraceevent: Do not print message if wakeup success field is missing")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 plugins/plugin_sched_switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/plugins/plugin_sched_switch.c b/plugins/plugin_sched_switch.c
index 73145ff..8752cae 100644
--- a/plugins/plugin_sched_switch.c
+++ b/plugins/plugin_sched_switch.c
@@ -73,7 +73,7 @@  static int sched_wakeup_handler(struct trace_seq *s,
 	if (tep_get_field_val(s, event, "success", record, &val, 0) == 0)
 		trace_seq_printf(s, " success=%lld", val);
 
-	if (tep_get_field_val(s, event, "target_cpu", record, &val, 1) == 0)
+	if (tep_get_field_val(s, event, "target_cpu", record, &val, 0) == 0)
 		trace_seq_printf(s, " CPU:%03llu", val);
 
 	return 0;