[PATCH 13/17] scripts/code_cov_parse_info: warn if branch block is not zero

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Thu Feb 15 10:27:22 UTC 2024


From: Mauro Carvalho Chehab <mchehab at kernel.org>

The lcov's info format has a field to be used for report branch
block. This is unused on json format (newer gcc), being always
zero. JSON doesn't contain it, so the parser doesn't support
it to be non-zero anymore. Print a warning if this happens.

Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
---
 scripts/code_cov_parse_info | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/code_cov_parse_info b/scripts/code_cov_parse_info
index 50d10a30d7f9..ea4f64b34d2f 100755
--- a/scripts/code_cov_parse_info
+++ b/scripts/code_cov_parse_info
@@ -519,6 +519,10 @@ sub read_info($)
 			my $branch = $3;
 			my $taken = $4;
 
+			if ($block != 0) {
+				print "Warning: unexpected block $block at line $.\n";
+			}
+
 			my $where = "$ln,$block,$branch";
 
 			$taken = 0 if ($taken eq '-');
-- 
2.43.0



More information about the igt-dev mailing list