aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2024-04-09 13:58:26 -0700
committerNamhyung Kim <namhyung@kernel.org>2024-04-09 13:58:26 -0700
commitd21460045d9786f7d992412a0d945415feba23a5 (patch)
tree5623d307098e2c9809036f40adc843cbdb364156
parent6f4aad9876108b0ee045b241d7335b1089050970 (diff)
downloadlinux-perf-perf/annotate-data-tui-v1.tar.gz
perf report: Do not collect sample histogram unnecessarilyperf/annotate-data-tui-v1
The data type profiling alone doesn't need the sample histogram for functions. It only needs the histogram for the types. Let's remove the condition in the report_callback to check the data type profiling and make sure the annotation has the annotated_source before calling symbol__disassemble(). Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-rw-r--r--tools/perf/builtin-report.c2
-rw-r--r--tools/perf/util/annotate.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index aaa6427a122474..dafba6e030ef70 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -172,7 +172,7 @@ static int hist_iter__report_callback(struct hist_entry_iter *iter,
struct mem_info *mi;
struct branch_info *bi;
- if (!ui__has_annotation() && !rep->symbol_ipc && !rep->data_type)
+ if (!ui__has_annotation() && !rep->symbol_ipc)
return 0;
if (sort__mode == SORT_MODE__BRANCH) {
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 11da27801d8834..7e034d2f2adb0c 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -908,6 +908,13 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel,
args.arch = arch;
args.ms = *ms;
+
+ if (notes->src == NULL) {
+ notes->src = annotated_source__new();
+ if (notes->src == NULL)
+ return -1;
+ }
+
if (annotate_opts.full_addr)
notes->src->start = map__objdump_2mem(ms->map, ms->sym->start);
else