tracing: Add NULL trace-array check in print_synth_event()
authorMasami Hiramatsu <mhiramat@kernel.org>
Fri, 10 Jan 2020 16:06:05 +0000 (01:06 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 13 Jan 2020 18:19:41 +0000 (13:19 -0500)
Add NULL trace-array check in print_synth_event(), because
if we enable tp_printk option, iter->tr can be NULL.

Link: http://lkml.kernel.org/r/157867236536.17873.12529350542460184019.stgit@devnote2
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_hist.c

index 4f4759c6e9726465aa6f573ec667f65a620413ed..1cb4c4c8e5b7311ee5b10e8ece2dd11c45a170bb 100644 (file)
@@ -833,7 +833,7 @@ static enum print_line_t print_synth_event(struct trace_iterator *iter,
                fmt = synth_field_fmt(se->fields[i]->type);
 
                /* parameter types */
-               if (tr->trace_flags & TRACE_ITER_VERBOSE)
+               if (tr && tr->trace_flags & TRACE_ITER_VERBOSE)
                        trace_seq_printf(s, "%s ", fmt);
 
                snprintf(print_fmt, sizeof(print_fmt), "%%s=%s%%s", fmt);