From nobody Mon Feb 9 12:26:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1596741817; cv=none; d=zohomail.com; s=zohoarc; b=XJJB+LE/ZccurCm8lJwwZI1cJXTzedhmWZbz3u+33X9coV5UEtfcXiK1liUIBYyhfOgKpg37W5kqMClTEO/60PoSL3YYj+IiVJ8hdhgfe0WEf5D99JHjLbdrT+Wjd3Lpt0IkT9KmK1fSUg4fA7NW6q8btXHf/3pcETVqYLeJbnM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596741817; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+7TUck7514fAQUs+9d+qwIGNj7sahshkHYcFDcaHUN8=; b=CtCZCkQHq1ktw/1YnA7W7boG6oQuWzzOUXqErsFTjn3gbJTgbpxWo2nBt0nVzVifQl3LCmlBY2ge0IsK81cKn1jg9dfZQ8wNgjdPy/6H+zF8e7SzVq8q+/zQoW2Yjo5m0usTc42HqQ/gBXsGJCj/q8kbrIudxi659oCDuOvcVjo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159674181759014.935036467260943; Thu, 6 Aug 2020 12:23:37 -0700 (PDT) Received: from localhost ([::1]:59450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3lUG-0000Kq-DB for importer@patchew.org; Thu, 06 Aug 2020 15:23:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3lNz-00047R-40 for qemu-devel@nongnu.org; Thu, 06 Aug 2020 15:17:07 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:49973 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k3lNv-0006PO-VW for qemu-devel@nongnu.org; Thu, 06 Aug 2020 15:17:06 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-277-kxx00iFpMsCpIF4aT5FQaA-1; Thu, 06 Aug 2020 15:17:01 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BBCCD800468 for ; Thu, 6 Aug 2020 19:17:00 +0000 (UTC) Received: from 640k.localdomain.com (unknown [10.36.110.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A3DC69315; Thu, 6 Aug 2020 19:16:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596741423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+7TUck7514fAQUs+9d+qwIGNj7sahshkHYcFDcaHUN8=; b=CaJKObr+bp04nmTW1A/TRa2u79pp1SBDvNYRTNNQqVhJUygbDQU/C0lvKXEI1tQSJ+g+uM 3KIPZVpA5QAfDADY4spBiB1SD/qnOTeL1tNG427uzU0G9KzSkyOBP4n0hhNjD8Z+gdPXsx CMiUgfETDGSxivqpFHYpHUXyk8Pb9qA= X-MC-Unique: kxx00iFpMsCpIF4aT5FQaA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 018/143] meson: use coverage option Date: Thu, 6 Aug 2020 21:14:14 +0200 Message-Id: <1596741379-12902-19-git-send-email-pbonzini@redhat.com> In-Reply-To: <1596741379-12902-1-git-send-email-pbonzini@redhat.com> References: <1596741379-12902-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=207.211.31.81; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/06 05:03:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: pass (identity @redhat.com) From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- Makefile | 14 -------------- Makefile.target | 16 ---------------- configure | 9 ++------- docs/devel/testing.rst | 7 +++---- meson.build | 2 +- 5 files changed, 6 insertions(+), 42 deletions(-) diff --git a/Makefile b/Makefile index c0c3b8b..18f6aa7 100644 --- a/Makefile +++ b/Makefile @@ -765,14 +765,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 @@ -1275,9 +1267,6 @@ endif echo '') @echo 'Cleaning targets:' $(call print-help,clean,Remove most generated files but keep the config) -ifdef CONFIG_GCOV - $(call print-help,clean-coverage,Remove coverage files) -endif $(call print-help,distclean,Remove all generated files) $(call print-help,dist,Build a distributable tarball) @echo '' @@ -1288,9 +1277,6 @@ endif @echo '' @echo 'Documentation targets:' $(call print-help,html info pdf txt,Build documentation in specified form= at) -ifdef CONFIG_GCOV - $(call print-help,coverage-report,Create code coverage report) -endif @echo '' ifdef CONFIG_WIN32 @echo 'Windows targets:' diff --git a/Makefile.target b/Makefile.target index ffa2657..d61a6a9 100644 --- a/Makefile.target +++ b/Makefile.target @@ -269,19 +269,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 23b990e..bdd35d2 100755 --- a/configure +++ b/configure @@ -424,7 +424,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" @@ -1008,8 +1007,6 @@ for opt do ;; --meson=3D*) meson=3D"$optarg" ;; - --gcov=3D*) gcov_tool=3D"$optarg" - ;; --smbd=3D*) smbd=3D"$optarg" ;; --extra-cflags=3D*) @@ -1816,7 +1813,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) @@ -6530,8 +6526,7 @@ fi write_c_skeleton =20 if test "$gcov" =3D "yes" ; then - QEMU_CFLAGS=3D"-fprofile-arcs -ftest-coverage -g $QEMU_CFLAGS" - QEMU_LDFLAGS=3D"-fprofile-arcs -ftest-coverage $QEMU_LDFLAGS" + : elif test "$fortify_source" =3D "yes" ; then QEMU_CFLAGS=3D"-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3D2 $QEMU_CFLAGS" debug=3Dno @@ -7804,7 +7799,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 @@ -8444,6 +8438,7 @@ NINJA=3D$PWD/ninjatool $python $meson setup \ -Dwerror=3D$(if test "$werror" =3D yes; then echo true; else echo = false; fi) \ -Dstrip=3D$(if test "$strip_opt" =3D yes; then echo true; else ech= o false; 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 c1ff243..a426469 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -164,13 +164,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`` diff --git a/meson.build b/meson.build index 48baf20..ed61853 100644 --- a/meson.build +++ b/meson.build @@ -197,7 +197,7 @@ summary_info +=3D {'debug stack usage': config_host.has= _key('CONFIG_DEBUG_STACK_US summary_info +=3D {'mutex debugging': config_host.has_key('CONFIG_DEBUG_= MUTEX')} summary_info +=3D {'crypto afalg': config_host.has_key('CONFIG_AF_ALG= ')} summary_info +=3D {'GlusterFS support': config_host.has_key('CONFIG_GLUSTE= RFS')} -summary_info +=3D {'gcov': config_host.has_key('CONFIG_GCOV')} +summary_info +=3D {'gcov': get_option('b_coverage')} summary_info +=3D {'TPM support': config_host.has_key('CONFIG_TPM')} summary_info +=3D {'libssh support': config_host.has_key('CONFIG_LIBSSH= ')} summary_info +=3D {'QOM debugging': config_host.has_key('CONFIG_QOM_CA= ST_DEBUG')} --=20 1.8.3.1