aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorNamhyung Kim <[email protected]>2024-04-24 23:00:15 +0000
committerArnaldo Carvalho de Melo <[email protected]>2024-04-27 01:07:21 +0000
commit47557db99a5decba2192303ed34ec1add5177b51 (patch)
treede606a974f8476b70a73f3100ddf5f14ce154907 /tools/perf/util/annotate.c
parentperf test: Add a new test for 'perf annotate' (diff)
downloadkernel-47557db99a5decba2192303ed34ec1add5177b51.tar.gz
kernel-47557db99a5decba2192303ed34ec1add5177b51.zip
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 <[email protected]> Signed-off-by: Namhyung Kim <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r--tools/perf/util/annotate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index dca2c08ab8c5..f5b6b5e5e757 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(&notes->src->source))
+ if (notes->src && !list_empty(&notes->src->source))
return 0;
args.arch = arch;