aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2023-11-03 12:19:05 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-11-09 13:49:33 -0300
commit2b215ec71b888ec2f3ca86846ce3a7f20b0d5e4d (patch)
tree1d7e55dbc99c151512a285b7628c67004f306863 /tools/perf/builtin-annotate.c
parentperf annotate: Split branch stack cycles info from 'struct annotation' (diff)
downloadwireguard-linux-2b215ec71b888ec2f3ca86846ce3a7f20b0d5e4d.tar.xz
wireguard-linux-2b215ec71b888ec2f3ca86846ce3a7f20b0d5e4d.zip
perf annotate: Move max_coverage from 'struct annotation' to 'struct annotated_branch'
The max_coverage field is only used when branch stack info is available so it'd be natural to move to 'struct annotated_branch'. Reviewed-by: Ian Rogers <irogers@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr> 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-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index aeeb801f1ed7..a9129b51d511 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -94,6 +94,7 @@ static void process_basic_block(struct addr_map_symbol *start,
struct annotation *notes = sym ? symbol__annotation(sym) : NULL;
struct block_range_iter iter;
struct block_range *entry;
+ struct annotated_branch *branch;
/*
* Sanity; NULL isn't executable and the CPU cannot execute backwards
@@ -105,6 +106,8 @@ static void process_basic_block(struct addr_map_symbol *start,
if (!block_range_iter__valid(&iter))
return;
+ branch = annotation__get_branch(notes);
+
/*
* First block in range is a branch target.
*/
@@ -118,8 +121,8 @@ static void process_basic_block(struct addr_map_symbol *start,
entry->coverage++;
entry->sym = sym;
- if (notes)
- notes->max_coverage = max(notes->max_coverage, entry->coverage);
+ if (branch)
+ branch->max_coverage = max(branch->max_coverage, entry->coverage);
} while (block_range_iter__next(&iter));