summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/block-info.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2023-11-03 20:19:04 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-11-09 17:49:33 +0100
commitb7f87e32590bf48eca84f729d3422be7b8dc22d3 (patch)
treed7d794499a6f7e81d35775313102381ef2a480f9 /tools/perf/util/block-info.c
parentperf annotate: Split branch stack cycles information out of 'struct annotatio... (diff)
downloadlinux-b7f87e32590bf48eca84f729d3422be7b8dc22d3.tar.xz
linux-b7f87e32590bf48eca84f729d3422be7b8dc22d3.zip
perf annotate: Split branch stack cycles info from 'struct annotation'
The cycles info is only meaningful when sample has branch stacks. To save the memory for normal cases, move those fields to a new 'struct annotated_branch' and dynamically allocate it when needed. Also move cycles_hist from annotated_source as it's related here. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20231103191907.54531-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/block-info.c')
-rw-r--r--tools/perf/util/block-info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/block-info.c b/tools/perf/util/block-info.c
index 591fc1edd385..08f82c1f166c 100644
--- a/tools/perf/util/block-info.c
+++ b/tools/perf/util/block-info.c
@@ -129,9 +129,9 @@ int block_info__process_sym(struct hist_entry *he, struct block_hist *bh,
al.sym = he->ms.sym;
notes = symbol__annotation(he->ms.sym);
- if (!notes || !notes->src || !notes->src->cycles_hist)
+ if (!notes || !notes->branch || !notes->branch->cycles_hist)
return 0;
- ch = notes->src->cycles_hist;
+ ch = notes->branch->cycles_hist;
for (unsigned int i = 0; i < symbol__size(he->ms.sym); i++) {
if (ch[i].num_aggr) {
struct block_info *bi;