summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@kernel.org>2022-11-21 09:57:46 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2024-02-15 21:04:46 +0100
commit35f1fb5ae1d5e5aa807f8f1730970913d09d77d1 (patch)
tree1f319c5e432eac9a7a994059339aa42483cd4454 /scripts
parent1ae3ef61128731cc6143adb84d539741daafd1da (diff)
scripts/code_cov_parse_info: prepare $all_branch to get function data
Right now, we store only the branch counts. We also need to store the functions that each branch belongs. So, add a new hash in order to allow adding function data later on. Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/code_cov_parse_info8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/code_cov_parse_info b/scripts/code_cov_parse_info
index 1be7fddf3..d28217cc1 100755
--- a/scripts/code_cov_parse_info
+++ b/scripts/code_cov_parse_info
@@ -233,7 +233,7 @@ sub parse_info_data($)
$was_used = 1 if ($taken > 0);
$record{$source}{$func}{brda}{$where} += $taken;
- $all_branch{$source}{"$where"} += $taken;
+ $all_branch{$source}{"$where"}{count} += $taken;
next;
}
@@ -448,7 +448,7 @@ sub gen_stats()
foreach my $where (keys(%{$all_branch{$source}})) {
$stats{"branch_count"}++;
- $stats{"branch_reached"}++ if ($all_branch{$source}{$where} != 0);
+ $stats{"branch_reached"}++ if ($all_branch{$source}{$where}{count} != 0);
}
}
@@ -607,7 +607,7 @@ sub generate_report($)
}
foreach my $source (keys(%{$report{$f}{"all_branch"}})) {
foreach my $where (keys(%{$report{$f}{"all_branch"}{$source}})) {
- $all_branch{$source}{"$where"} += $report{$f}{"all_branch"}{$source}{$where};
+ $all_branch{$source}{"$where"}{count} += $report{$f}{"all_branch"}{$source}{$where}{count};
}
}
for my $source(keys(%{$report{$f}{"files"}})) {
@@ -887,7 +887,7 @@ sub check_source_branches()
my @lines;
foreach my $where (sort keys %{$all_branch{$source}}) {
- my $taken = $all_branch{$source}{$where};
+ my $taken = $all_branch{$source}{$where}{count};
next if ($taken > 0);
next if !($where =~ m/^(-?\d+),(-?\d+),(-?\d+)/);