Do not segfault if the event cannot be found for some reason and tep_find_event_by_record() returns NULL. No extra warning is added since there are others ("UNKNOWN EVENT") which already make it clear that something is wrong: kworker/u8:0-7 [003] 1.245773: sched_stat_runtime: comm=kworker/u8:... [UNKNOWN EVENT][UNKNOWN EVENT][UNKNOWN EVENT] kworker/u8:0-7 [003] 1.245776: sched_switch: kworker/u8:0:7 [120] W... Signed-off-by: Vincent Whitchurch <vincent.whitchurch@xxxxxxxx> --- tracecmd/trace-read.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c index 6f43c1d..145c823 100644 --- a/tracecmd/trace-read.c +++ b/tracecmd/trace-read.c @@ -890,7 +890,8 @@ void trace_show_data(struct tracecmd_input *handle, struct tep_record *record) trace_seq_printf(&s, " %-8s", buf); } - print_event_name(&s, event); + if (event) + print_event_name(&s, event); tep_print_event(pevent, &s, record, "%s", format_type); if (s.len && *(s.buffer + s.len - 1) == '\n') -- 2.20.1