summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/block-range.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/block-range.c')
-rw-r--r--tools/perf/util/block-range.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/perf/util/block-range.c b/tools/perf/util/block-range.c
index 680e92774d..15c42196c2 100644
--- a/tools/perf/util/block-range.c
+++ b/tools/perf/util/block-range.c
@@ -311,6 +311,7 @@ done:
double block_range__coverage(struct block_range *br)
{
struct symbol *sym;
+ struct annotated_branch *branch;
if (!br) {
if (block_ranges.blocks)
@@ -323,5 +324,9 @@ double block_range__coverage(struct block_range *br)
if (!sym)
return -1;
- return (double)br->coverage / symbol__annotation(sym)->max_coverage;
+ branch = symbol__annotation(sym)->branch;
+ if (!branch)
+ return -1;
+
+ return (double)br->coverage / branch->max_coverage;
}