From: Namhyung Kim Date: Wed, 24 Apr 2024 23:00:15 +0000 (-0700) Subject: perf annotate-data: Check if 'struct annotation_source' was allocated on 'perf report... X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=47557db99a5decba2192303ed34ec1add5177b51;p=linux.git perf annotate-data: Check if 'struct annotation_source' was allocated on 'perf report' TUI As it removed the sample accounting for code when no symbol sort key is given for 'perf report' TUI, it might not have allocated the 'struct annotated_source' yet. Let's check if it's NULL first. Fixes: 6cdd977ec24e1538 ("perf report: Do not collect sample histogram unnecessarily") Reviewed-by: Ian Rogers Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20240424230015.1054013-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index dca2c08ab8c59..f5b6b5e5e7571 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -906,7 +906,7 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel, if (parch) *parch = arch; - if (!list_empty(¬es->src->source)) + if (notes->src && !list_empty(¬es->src->source)) return 0; args.arch = arch;