[igt-dev] [PATCH v3 03/12] scripts/code_cov_gen_report: add support for filtering info files

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Thu Apr 14 12:24:53 UTC 2022


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

Now that we have a script that allows filtering the results,
add support for it when generating code coverage reports.

Reviewed-by: Andrzej Hajda <andrzej.hajda at intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
---

To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
See [PATCH v3 00/12] at: https://lore.kernel.org/all/cover.1649939026.git.mchehab@kernel.org/

 scripts/code_cov_gen_report | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/scripts/code_cov_gen_report b/scripts/code_cov_gen_report
index 05efebe19ee4..b7c90b114cde 100755
--- a/scripts/code_cov_gen_report
+++ b/scripts/code_cov_gen_report
@@ -16,6 +16,8 @@ Usage:
     $(basename $0)
 	--read <file or dir> --kernel-source <dir> --kernel-object <dir>
 	--output-dir <dir> [--info or --tar] [--force-override]
+	[--print] [--stat] [--ignore-unused] [--only-i915] [--only-drm]
+	[--show-files] [--func-filters <file>] [--source-filters <file>]
 
 --kernel-object is only needed when Kernel was built with make O=dir
 "
@@ -28,6 +30,7 @@ KSRC=
 KOBJ=
 DEST_DIR=
 FORCE=
+PARSE_ARGS=
 
 while [ "$1" != "" ]; do
 	case $1 in
@@ -69,6 +72,17 @@ while [ "$1" != "" ]; do
 			shift
 		fi
 		;;
+	--print|--stat|--ignore-unused|--only-i915|--only-drm|--show-files)
+		PARSE_ARGS="$PARSE_ARGS $1"
+		;;
+	--func-filters|--source-filters)
+		if [ "$2" == "" ]; then
+			usage 1
+		else
+			PARSE_ARGS="$PARSE_ARGS $1 $2"
+			shift
+		fi
+		;;
 	--force-override|-f)
 		FORCE=1
 		;;
@@ -166,5 +180,10 @@ else
 	fi
 fi
 
+if [ "x$PARSE_ARGS" != "x" ]; then
+	${SCRIPT_DIR}/$PARSE_INFO $PARSE_ARGS --output filtered_${TITLE}.info ${TITLE}.info
+	TITLE=filtered_${TITLE}
+fi
+
 echo "Generating HTML files..."
 genhtml -q ${TITLE}.info
-- 
2.35.1



More information about the igt-dev mailing list