From patchwork Thu Jul 5 16:03:17 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: 141200 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2138596ljj; Thu, 5 Jul 2018 09:25:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqYuD3NQ4YSJCHHCmEjng/LTGwJqHLRfTKqzstOBGzQq/FFvviDowHZQr+OCIh0RBjF5Qo X-Received: by 2002:a0c:d21d:: with SMTP id m29-v6mr5767137qvh.86.1530807910471; Thu, 05 Jul 2018 09:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530807910; cv=none; d=google.com; s=arc-20160816; b=TTwH1DHV4Yil/oSlRCxQjXjI3oqwSHiwaYmKkuZWZT0c4f0zqPQI0gtsOXT9sv+fDL GddOck611/OOiqTrzT/RbaDEJ77Cbi0zJ4JA+8IpFi/1jvQ8i7H/Y67kGNIW0fvZPxdx zTA1bINSWpzuYVvfUZuZdn4XKhxrpRbAou+xAf15J8H0US3p1sCzeLilFLKW2MMGDAWf hyhzPurNy7stUQBnW7Ym6eeMp+9Cq+Dbigd3JFdPbHL1qezuezXKRLuO51sWD0DPBQJl W5kJxtEgX0SxES45aDSQB53np61CYrhYEuD+CTHngubDJ3KND9xPuDbakuWrNlJ0ou66 zAEw== 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=NnkXcRkwEzWiYqjh2Rik4I5Vm/tpitgUCIRXhfy8/ts=; b=wUWB6iBEY7Dopr4ayfR//o5uGUO3jcLIlpvy758gUNOhkvo1cGTXY9ODIK/KsElXwY oVhlcWbCaSmE3BgUWx0Pa24R70vHAWLH/ba5phScnv8lWz2hlrqchNdQTBhEXiydNPGo NwOmyd2yK9M1Kvai9bXnR7X11SCNPG2BUR/eg2SLKyL9T4RPkavkO+6LrvbPajx589jr DYxCQolvly6/HIekhBHgYJRr9nwbwS+HOFboqx7cC2EcijN0IWFH4iyGsCRHH/j0fZoq xM/L3KgelUI6uX0jqg7qNb1VY+r+JllZoFgotQqkHoCDggt+1k5qZeBi+qY3APtUZvbm xJ6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MjPGVqd4; 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 b27-v6si1837085qvh.18.2018.07.05.09.25.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 05 Jul 2018 09:25:10 -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=MjPGVqd4; 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]:53657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fb749-00085F-Tf for patch@linaro.org; Thu, 05 Jul 2018 12:25:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fb6jJ-0008Mc-OY for qemu-devel@nongnu.org; Thu, 05 Jul 2018 12:03:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fb6jI-0007yz-NU for qemu-devel@nongnu.org; Thu, 05 Jul 2018 12:03:37 -0400 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:53352) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fb6jI-0007yM-HX for qemu-devel@nongnu.org; Thu, 05 Jul 2018 12:03:36 -0400 Received: by mail-wm0-x230.google.com with SMTP id b188-v6so12141609wme.3 for ; Thu, 05 Jul 2018 09:03:36 -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=NnkXcRkwEzWiYqjh2Rik4I5Vm/tpitgUCIRXhfy8/ts=; b=MjPGVqd4mdiSejCEIRu1hVTzw2HVz0rORSMHTRocwI/1KON+cmDm2uS9mh0o6a4ZDy ZOv1tgy5JbLtmRaugCUHqZRc2vWWc8vEn7RFStZIuJ2lUPHTLPTzBIgihJOeSl0ovQoG UW6zuBYxNDwPD7OZU/IYOHkzlInny/FCb2ZUU= 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=NnkXcRkwEzWiYqjh2Rik4I5Vm/tpitgUCIRXhfy8/ts=; b=N77TY0yUUDbyM53HnpEgQPqNG4SRjchTfAEnGVSWqgwAkINWYK9SSjdTx5K7VLYMRs Vsx99t1yhXgCsLgJ0ivEyKH0qu1Qgg9szL86XmckofqNnQKO5w57i1AacTDVw1D7Uwc4 P4fuhxzZpGFCd8J6GIdWcmTvlivWuWyrWNz3LIQekVk3Faa/5/RqUxal+W9MbLB0zjBj eM0lYqtkHOapHP2GJjT1T0cbQc5mFmZCe3ZQSe+HN5gXwDXdDQn6okt2hHIvQVmDD1eg vKNpmCJ8hbs7xin+LUbEd0rxaF5usw8OLe5qFG3veb+JYwOBFt6bNZI9ni02OAFk5yjk uyGQ== X-Gm-Message-State: APt69E2eYgDS173BvIXYzY1gafGWO2MDBozo9aG4kDDOxXD/Yg7/TQgl v+75craAh/c0TA87PgmKqwm+kg== X-Received: by 2002:a1c:be13:: with SMTP id o19-v6mr4240643wmf.1.1530806615345; Thu, 05 Jul 2018 09:03:35 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id k13-v6sm4035743wrr.14.2018.07.05.09.03.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Jul 2018 09:03:32 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id F39993E0930; Thu, 5 Jul 2018 17:03:29 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Thu, 5 Jul 2018 17:03:17 +0100 Message-Id: <20180705160329.30386-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180705160329.30386-1-alex.bennee@linaro.org> References: <20180705160329.30386-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:c09::230 Subject: [Qemu-devel] [PULL v3 08/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: =?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é Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- -- 2.17.1 diff --git a/Makefile b/Makefile index 39fd4c0546..9731ec1bb7 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 ============