diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 26d8fc27e427e..fc7855262162d 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -476,8 +476,7 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report if (rep->time_str) ret += fprintf(fp, " (time slices: %s)", rep->time_str); - if (symbol_conf.show_ref_callgraph && - strstr(evname, "call-graph=no")) { + if (symbol_conf.show_ref_callgraph && evname && strstr(evname, "call-graph=no")) { ret += fprintf(fp, ", show reference callgraph"); }