[igt-dev] [PATCH i-g-t 12/12] code_cov_parse_info: add support for filtering Xe driver data

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Tue Jan 17 14:06:07 UTC 2023


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

Just like it does for i915, add an option to get code coverage
data from Xe driver.

For now, it won't be taking DRM core stuff into account; just
the Xe driver code itself.

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

diff --git a/scripts/code_cov_parse_info b/scripts/code_cov_parse_info
index 2c3283cc1119..d133ef1a18d4 100755
--- a/scripts/code_cov_parse_info
+++ b/scripts/code_cov_parse_info
@@ -1387,6 +1387,7 @@ my $branch_filters;
 my $show_files;
 my $show_lines;
 my $only_i915;
+my $only_xe;
 my $only_drm;
 my $check_branches;
 
@@ -1399,6 +1400,7 @@ GetOptions(
 	"verbose|v" => \$verbose,
 	"ignore-unused|ignore_unused" => \$ignore_unused,
 	"only-i915|only_i915" => \$only_i915,
+	"only-xe|only_xe" => \$only_xe,
 	"only-drm|only_drm" => \$only_drm,
 	"func-filters|f=s" => \$func_filters,
 	"include-func=s" => \@func_include_regexes,
@@ -1448,6 +1450,14 @@ if ($only_i915) {
 	push @src_include_regexes, "drm/vgem";
 }
 
+if ($only_xe) {
+	# Please keep in sync with the documentation
+	push @src_exclude_regexes, "selftest";
+	push @src_include_regexes, "drm/xe";
+#	push @src_include_regexes, "drm/ttm";
+#	push @src_include_regexes, "drm/vgem";
+}
+
 if ($only_drm) {
 	# Please keep in sync with the documentation
 	push @src_exclude_regexes, "trace.*\.h\$";
@@ -1493,7 +1503,9 @@ foreach my $f (@ARGV) {
 
 	if ($gen_report) {
 		$f =~ s,.*/,,;
+		$f =~ s/\.gz$//;
 		$f =~ s/\.info$//;
+		$f =~ s/\.json$//;
 
 		gen_stats();
 
@@ -1694,6 +1706,19 @@ Excluding files that match:
 
 	- selftest
 
+=item B<--only-xe> or B<--only_xe>
+
+Filters out C files and headers outside drm core and drm/i915.
+
+E. g. code coverage results will include only the files that that match
+the following regular expressions:
+
+	- drm/xe/
+
+Excluding files that match:
+
+	- selftest
+
 =item B<--func-filters>  B<[filter's file]> or B<-f>  B<[filter's file]>
 
 Use a file containing regular expressions (regex) to filter functions.
-- 
2.39.0



More information about the igt-dev mailing list