summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2024-04-25 01:00:15 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2024-04-27 03:07:21 +0200
commit47557db99a5decba2192303ed34ec1add5177b51 (patch)
treede606a974f8476b70a73f3100ddf5f14ce154907
parentperf test: Add a new test for 'perf annotate' (diff)
downloadlinux-47557db99a5decba2192303ed34ec1add5177b51.tar.xz
linux-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 <irogers@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20240424230015.1054013-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-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;