From nobody Mon Feb 9 20:12:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1580234587033904.3986140127295; Tue, 28 Jan 2020 10:03:07 -0800 (PST) Received: from localhost ([::1]:34842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwVCb-0000xi-Ia for importer@patchew.org; Tue, 28 Jan 2020 13:03:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57995) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwV4B-0006Q6-KJ for qemu-devel@nongnu.org; Tue, 28 Jan 2020 12:54:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwV49-00088B-2D for qemu-devel@nongnu.org; Tue, 28 Jan 2020 12:54:22 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:56048) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iwV47-00080E-Sr for qemu-devel@nongnu.org; Tue, 28 Jan 2020 12:54:20 -0500 Received: by mail-wm1-x32d.google.com with SMTP id q9so3483870wmj.5 for ; Tue, 28 Jan 2020 09:54:18 -0800 (PST) Received: from localhost.localdomain (93-36-56-206.ip58.fastwebnet.it. [93.36.56.206]) by smtp.gmail.com with ESMTPSA id o4sm27046968wrx.25.2020.01.28.09.54.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 09:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zla3h/TZTZZ2FJmQlbkLgAItmfO88rZ4mtPOcgpOO7o=; b=abQFFxVxu41nvvH9iqBOmtDbSbqC+lpXQYIBo3rSjJ+YlasWi4OPP7kAwEV3bIsuo9 LJOllBDQSWVKV+0KNBgJcnTU9KLp9RPDP9GHGgcVrUX2bhtf+aJVe5r6PY7AkkTqrXjD Dh9Xl8zGKmgNvRys5GrQJmW1vdp7/A6fukGy/R6B5G2JqXh7fAZ5k2D/WH2hqja3mwl6 dKPxW3Bc7INiShS13UHidysb3jb+4XvZ89iLg38J8uymBylcqXsfGyDaazvpgWUvXYJS n+EvJqRGaxejji+sOsEOuhxoshVSJDYVy9/6XmHpwFr3LmF/jDxaUbAUn9WTBtjXR9Ri UWEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zla3h/TZTZZ2FJmQlbkLgAItmfO88rZ4mtPOcgpOO7o=; b=sVpuZxqAAD8nQvglWa5tNztsXTz5vxckjTfRUdFww2IKmJJdsJ7bsoQnm+f+Sm/M0n /x28WGLHGW44JegA2ZwuKfpGHNc5I+y/lOaFkZw/IVGNoiHU3/YfS4z6FV7wincF9mL6 cdUQsig7BvDgme1Lvw4YggyQSHRTSu50cVMOD4uO4aWXuIfOAylPtgnOANfPNUN0jEn4 y3xcb04hWN0M/ZkZkhOHdvTxtqHpROff5divl/4fHlq6/7JAgTzLa1FbL+KoOIVQMjCV S0djrnPeR4rADkG1dfCX/obwL+DsfjYzKki8IwRpB8LHKQh+rGeSA/uyfrMZA7yOr+r+ THAw== X-Gm-Message-State: APjAAAUq/XQzTYqCk6ATsQgedXgShkOT5BprPD6qelSPtgvzBmqqfLej uqVC4D7z22cE/5QJfCT1s2X0Oizw X-Google-Smtp-Source: APXvYqyQ/iz11+YmQI3A1an9z+arJ6+y6ksgHQdzlGHdU5T/GQ/H7NGVOI8lAL7fnL2jOz+C8WGf8w== X-Received: by 2002:a7b:cc6a:: with SMTP id n10mr6351282wmj.170.1580234056476; Tue, 28 Jan 2020 09:54:16 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 011/142] meson: use coverage option Date: Tue, 28 Jan 2020 18:51:31 +0100 Message-Id: <20200128175342.9066-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200128175342.9066-1-pbonzini@redhat.com> References: <20200128175342.9066-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- Makefile | 14 -------------- Makefile.target | 16 ---------------- configure | 10 ++-------- docs/devel/testing.rst | 7 +++---- 4 files changed, 5 insertions(+), 42 deletions(-) diff --git a/Makefile b/Makefile index 3b127ef5c8..9aa0808649 100644 --- a/Makefile +++ b/Makefile @@ -692,14 +692,6 @@ module_block.h: $(SRC_PATH)/scripts/modules/module_blo= ck.py config-host.mak $(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \ "GEN","$@") =20 -ifdef CONFIG_GCOV -.PHONY: clean-coverage -clean-coverage: - $(call quiet-command, \ - find . \( -name '*.gcda' -o -name '*.gcov' \) -type f -exec rm {} +, \ - "CLEAN", "coverage files") -endif - clean: recurse-clean # avoid old build problems by removing potentially incorrect old files rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h ge= n-op-arm.h @@ -1170,9 +1162,6 @@ endif echo '') @echo 'Cleaning targets:' @echo ' clean - Remove most generated files but keep the conf= ig' -ifdef CONFIG_GCOV - @echo ' clean-coverage - Remove coverage files' -endif @echo ' distclean - Remove all generated files' @echo ' dist - Build a distributable tarball' @echo '' @@ -1184,9 +1173,6 @@ endif @echo 'Documentation targets:' @echo ' html info pdf txt' @echo ' - Build documentation in specified format' -ifdef CONFIG_GCOV - @echo ' coverage-report - Create code coverage report' -endif @echo '' ifdef CONFIG_WIN32 @echo 'Windows targets:' diff --git a/Makefile.target b/Makefile.target index 6e61f607b1..3bb5d75eb9 100644 --- a/Makefile.target +++ b/Makefile.target @@ -240,19 +240,3 @@ endif =20 generated-files-y +=3D config-target.h Makefile: $(generated-files-y) - -# Reports/Analysis -# -# The target specific coverage report only cares about target specific -# blobs and not the shared code. -# - -%/coverage-report.html: - @mkdir -p $* - $(call quiet-command,\ - gcovr -r $(SRC_PATH) --object-directory $(CURDIR) \ - -p --html --html-details -o $@, \ - "GEN", "coverage-report.html") - -.PHONY: coverage-report -coverage-report: $(CURDIR)/reports/coverage/coverage-report.html diff --git a/configure b/configure index a9ab67bf26..c3409938f2 100755 --- a/configure +++ b/configure @@ -418,7 +418,6 @@ tcg_interpreter=3D"no" bigendian=3D"no" mingw32=3D"no" gcov=3D"no" -gcov_tool=3D"gcov" EXESUF=3D"" DSOSUF=3D".so" LDFLAGS_SHARED=3D"-shared" @@ -980,8 +979,6 @@ for opt do ;; --meson=3D*) meson=3D"$optarg" ;; - --gcov=3D*) gcov_tool=3D"$optarg" - ;; --smbd=3D*) smbd=3D"$optarg" ;; --extra-cflags=3D*) @@ -1739,7 +1736,6 @@ Advanced options (experts only): --with-coroutine=3DBACKEND coroutine backend. Supported options: ucontext, sigaltstack, windows --enable-gcov enable test coverage analysis with gcov - --gcov=3DGCOV use specified gcov [$gcov_tool] --disable-blobs disable installing provided firmware blobs --with-vss-sdk=3DSDK-path enable Windows VSS support in QEMU Guest Agent --with-win-sdk=3DSDK-path path to Windows Platform SDK (to build VSS .t= lb) @@ -6111,8 +6107,7 @@ esac write_c_skeleton =20 if test "$gcov" =3D "yes" ; then - CFLAGS=3D"-fprofile-arcs -ftest-coverage -g $CFLAGS" - LDFLAGS=3D"-fprofile-arcs -ftest-coverage $LDFLAGS" + : elif test "$fortify_source" =3D "yes" ; then CFLAGS=3D"-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3D2 $CFLAGS" elif test "$debug" =3D "no"; then @@ -6587,7 +6582,6 @@ echo "debug stack usage $debug_stack_usage" echo "mutex debugging $debug_mutex" echo "crypto afalg $crypto_afalg" echo "GlusterFS support $glusterfs" -echo "gcov $gcov_tool" echo "gcov enabled $gcov" echo "TPM support $tpm" echo "libssh support $libssh" @@ -7537,7 +7531,6 @@ echo "TASN1_CFLAGS=3D$tasn1_cflags" >> $config_host_m= ak echo "POD2MAN=3D$POD2MAN" >> $config_host_mak if test "$gcov" =3D "yes" ; then echo "CONFIG_GCOV=3Dy" >> $config_host_mak - echo "GCOV=3D$gcov_tool" >> $config_host_mak fi =20 if test "$libudev" !=3D "no"; then @@ -8125,6 +8118,7 @@ NINJA=3D$PWD/ninjatool $python $meson setup \ $(test "$strip_opt" =3D yes && echo --strip) \ --buildtype $(if test "$debug" =3D yes; then echo debug; else echo debugo= ptimized; fi) \ -Db_pie=3D$(if test "$pie" =3D yes; then echo true; else echo fals= e; fi) \ + -Db_coverage=3D$(if test "$gcov" =3D yes; then echo true; else ech= o false; fi) \ $cross_arg \ "$PWD" "$source_path" =20 diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index ab5be0c729..053ce37da2 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -163,13 +163,12 @@ instrumenting the tested code. To use it, configure Q= EMU with ``--enable-gcov`` option and build. Then run ``make check`` as usual. =20 If you want to gather coverage information on a single test the ``make -clean-coverage`` target can be used to delete any existing coverage +clean-gcda`` target can be used to delete any existing coverage information before running a single test. =20 You can generate a HTML coverage report by executing ``make -coverage-report`` which will create -./reports/coverage/coverage-report.html. If you want to create it -elsewhere simply execute ``make /foo/bar/baz/coverage-report.html``. +coverage-html`` which will create +``meson-logs/coveragereport/index.html``. =20 Further analysis can be conducted by running the ``gcov`` command directly on the various .gcda output files. Please read the ``gcov`` --=20 2.21.0