diff options
| author | Namhyung Kim <[email protected]> | 2024-04-11 03:32:56 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2024-04-12 15:02:06 +0000 |
| commit | 6cdd977ec24e1538b35a08bde823a74b69e829f2 (patch) | |
| tree | ba2501e9fde4c2c30e431a48634b9445069ad0aa /tools/perf/util/annotate.c | |
| parent | perf report: Add a menu item to annotate data type in TUI (diff) | |
| download | kernel-6cdd977ec24e1538b35a08bde823a74b69e829f2.tar.gz kernel-6cdd977ec24e1538b35a08bde823a74b69e829f2.zip | |
perf report: Do not collect sample histogram unnecessarily
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 if data type
profiling is selected and make sure the annotation has the 'struct
annotated_source' instantiated before calling symbol__disassemble().
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.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index ec79c120a7d2..7595c8fbc2c5 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 |
