From patchwork Mon Jul 2 14:30:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 140782 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp30615ljj; Mon, 2 Jul 2018 07:37:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdIxBMeBpcANDJq+UdWznQdbdx4u1VtZ0rDaSpBM0fvscksHfRbLmzM17xDGQd5Nfd6j5A1 X-Received: by 2002:aed:3e29:: with SMTP id l38-v6mr23989790qtf.186.1530542222092; Mon, 02 Jul 2018 07:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530542222; cv=none; d=google.com; s=arc-20160816; b=VKe7bqQLXmspSs/fR3ewCByYIMDXlAH65eHyfJ6WPqwjpLNTetdPqHXMwbnDl30YUj eLG0jB4XnhJCxPd684uKd8CfXuUMkjla9QmkRhUXccIh7oXmuuNZhSs1SmYvAqIkvGtQ dpgtf4qd+hIfQXdKYwk4BVCv3a/uSO5HXSKTL3ipGXAfNR1n6I69vZ5r0FqSBIgSFkLl vKwY0UxhMeWLEthtbl9XUMg0vQKNw57c2sFSkqkPiqw0GiZCixsABj3CBudUe+Ri6Axi ZK6ToGi2ww96iyuZ54YTHt2UZS1ruhsjfdg7ygvIZ0lITbqfMzEyEN9SE42uEdsX9Qk3 cVtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=AMkRDj/+DzSk73olAljoglLvRhXqyPyozWchbUwEc9o=; b=tX8lTu7IK3gEgXOfpcDxy21XSrC1jjuWCqzmHc1OnvwsoG/Hjpx+rRLIAkspFuEEEg Y6IRWafcDyBDtflQ79q20+YuMmSswpMgqUDs6ilIrpkCkzTXEvuitSVeuWQqJkLoRlm8 aNYBwwFxX0vDMNXnEx1jg2HaSnKlvUVLkNMF14AqF9dpj0/who+CqeNK39cxlzvb0JYR X0LWb5eAqmtETBkHoEB+XFPszKVsAWiYr3mRxz+khmDlRAVPUWHxm+IIyQGTuO3c3J3O EwTYoXMUD9eabglM5c0KkZzrgdLyWChVfA6mk5cqYetXKJTUdiAc9QEoWZ/AExSHzPPV V9WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GuevOL6n; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b6-v6si7536939qtc.19.2018.07.02.07.37.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 02 Jul 2018 07:37:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GuevOL6n; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzwr-0001pp-G9 for patch@linaro.org; Mon, 02 Jul 2018 10:37:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzqb-0005Ps-M9 for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZzqa-0000VY-Oe for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:33 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:45092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZzqa-0000Uu-J2 for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:32 -0400 Received: by mail-wr0-x242.google.com with SMTP id u7-v6so15773748wrn.12 for ; Mon, 02 Jul 2018 07:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AMkRDj/+DzSk73olAljoglLvRhXqyPyozWchbUwEc9o=; b=GuevOL6n1JA56A+0otUCySepRVFGhCxzZE3rJTFaRJjwMcJH0FdJzwWNQTOfFO+nBS isOe479Fm9uyPFEgZXCnYLC+9wtT2OKS9VkWh6ldcRJCaEUw0NHhZBpJiMPTW5rUP+BJ l8+lfXzBH5M9DERzrQktYxUFI2JRzqAnhncdI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AMkRDj/+DzSk73olAljoglLvRhXqyPyozWchbUwEc9o=; b=Cs845TkgALjUEn0EnIIEFuzM54Ti3rVAJQHrVutVIepUUrTNE/0496ffWHlTJoTOzj 4ji3G3Gg7Okry4qGiwZAENI1hlvv20jfijvGBIKnU5LhOAKeJMbHVhtBjpstgSde52b/ kUMFsNXycF0dwv3bJBsU9stPsaJW+rQPb4077dkznO+T8cE7b4DpEjnsM0QD4hQVekyy 55jFbEw3CczXi6UhkOKQCjcNXjs5/sp2ptmP1jzy9NSq5XZfRo9oDRYhU9u+mMsvbYHS ZzUScqYxoOVYBv/MPaZgW/IIuV63V8YdUDqlwIntXd0SqLs2Zgrr77pjpnx5t8+lK9G2 BYsw== X-Gm-Message-State: APt69E3Z/GISGE+L9wWpQxOZumYbUow0iWDansoE3Wj0e3SkIwG2SVj7 sM2r4zrq9qJreXnvCKf57gJSLQ== X-Received: by 2002:adf:adae:: with SMTP id w43-v6mr20843707wrc.251.1530541831374; Mon, 02 Jul 2018 07:30:31 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id f133-v6sm8465245wme.42.2018.07.02.07.30.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 07:30:28 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 4AD153E0775; Mon, 2 Jul 2018 15:30:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Mon, 2 Jul 2018 15:30:08 +0100 Message-Id: <20180702143021.18864-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180702143021.18864-1-alex.bennee@linaro.org> References: <20180702143021.18864-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PATCH v3 07/20] build-system: add clean-coverage target X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This can be used to remove any stale coverage data before any particular test run. This is useful for analysing individual tests. Signed-off-by: Alex Bennée Reviewed-by: Daniel P. Berrangé --- v2 - s/to any/to delete any/ --- Makefile | 11 +++++++++++ docs/devel/testing.rst | 11 ++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) -- 2.17.1 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé diff --git a/Makefile b/Makefile index 7ed9cc4a21..2b3413a5ba 100644 --- a/Makefile +++ b/Makefile @@ -723,6 +723,14 @@ module_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak $(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \ "GEN","$@") +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: # 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 gen-op-arm.h @@ -1073,6 +1081,9 @@ endif echo '') @echo 'Cleaning targets:' @echo ' clean - Remove most generated files but keep the config' +ifdef CONFIG_GCOV + @echo ' clean-coverage - Remove coverage files' +endif @echo ' distclean - Remove all generated files' @echo ' dist - Build a distributable tarball' @echo '' diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 66ef219f69..7f04ca104e 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -161,9 +161,14 @@ GCC gcov support ``gcov`` is a GCC tool to analyze the testing coverage by instrumenting the tested code. To use it, configure QEMU with ``--enable-gcov`` option and build. Then run ``make check`` as usual. -Reports can be obtained by running ``gcov`` command on the output -files under ``$build_dir/tests/``, please read the ``gcov`` -documentation for more information. + +If you want to gather coverage information on a single test the ``make +clean-coverage`` target can be used to delete any existing coverage +information before running a single test. + +Reports can be obtained by running ``gcov`` command +on the output files under ``$build_dir/tests/``, please read the +``gcov`` documentation for more information. QEMU iotests ============