diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 0abca8783bb3..78485edb9467 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -341,8 +341,7 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report if (evname != NULL) ret += fprintf(fp, " of event '%s'", evname); - 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"); }