From patchwork Tue Jul 3 10:14:31 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: 140936 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp979993ljj; Tue, 3 Jul 2018 03:20:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd0wHUC6zmuTGcDy1DTf95EjMlIuCO7AZWZZsjwtEPiI/hB6bFiip9KulJEk+O5DIZGCOi3 X-Received: by 2002:a37:ba02:: with SMTP id k2-v6mr4343172qkf.134.1530613254991; Tue, 03 Jul 2018 03:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530613254; cv=none; d=google.com; s=arc-20160816; b=DeYo6qOJvdHsy2S3xsStgXILVroxf8H4wCEah6Pb4o6+e+4WMikOtED2adzR1Vxq33 9dbOFqOBePxXx2DNsxerUFJKLaTIWIuOZbgRx9Uh1fU4yqHXrBhq/SqvtYCxnBYUXscK wWwU4m0Aa6Bctoym2+eHrqSYQBQbHCsNy0r27HgV5X5pB9LaRd3zYFka6FJDvw/sgD/U vYhLzckSTCY/aHz50p1u/6+vp944uaO6rpKa0CVW4FjCL3RPsXXviSn5Dn3IRLSnl80F ha4ooSQ++RkLdXUSyJVRmpW8nizzP2Bl7An5waLhM7WX7Bztjs23kmCzHGNdgLoKL+4p zl5Q== 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=dHZxRKyiPUBhXVfPlqFP9d1eZISw6Y+nFi4nQn0fk3c=; b=VC8yzwMk59XPCoA98VoVBTfaGToFr96zF2HGFxmpVi5xPUElG/s6EKm9FelmFsp9Zo ERv/HP3V15C09EPEbAfJbBuULI5T7HzCo20BEJU96Yho7dBT2edwmLwN3TEPmepuOz4x PrArSm7tqj/xHvODvZXcyrGXKh0r8LtnKOdcLx4nN80ceSTfXfMn3fetN836Opj8fqZR 0bvHom8GR3ZIRVmIOpRCV5frR1nYG36NrxR8BlYbroEh+z59xt8BoB322HCeU87HEtJf jq8fV1py70r4lijejigfkogHxKqWae8oLil5hydzw6A5zMz9VQ9tc2jKigFVLRA0pPcs CWYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WLfyo5sr; 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 65-v6si754675qva.191.2018.07.03.03.20.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 03 Jul 2018 03:20:54 -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=WLfyo5sr; 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]:39373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faIQY-0001jW-Fc for patch@linaro.org; Tue, 03 Jul 2018 06:20:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1faIKl-0006mv-Et for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:14:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1faIKk-0008Rr-Gz for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:14:55 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:37855) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1faIKk-0008RS-9t for qemu-devel@nongnu.org; Tue, 03 Jul 2018 06:14:54 -0400 Received: by mail-wm0-x22c.google.com with SMTP id n17-v6so1654675wmh.2 for ; Tue, 03 Jul 2018 03:14:54 -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=dHZxRKyiPUBhXVfPlqFP9d1eZISw6Y+nFi4nQn0fk3c=; b=WLfyo5srbY68ASPYok/5QgB1j/TdWPGYfZy6c5Mb0BPpyX8KwUmIjk5Jhjv4WiPavy Wi8ZfaggzEIzCL7mrcow/Q4Wmp2KX8JW5ljXrbaBY6KOtIydfZTtq/0OffU3CAnVU5fU gichoCMYh1nQO/Ke5L0XRZuZ4EoQCKSdKuzwc= 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=dHZxRKyiPUBhXVfPlqFP9d1eZISw6Y+nFi4nQn0fk3c=; b=jPpNQV04mPVeHWL7jurdGmsyrS4lvSvnE1z9fffoMcNzhtdtmiC7KWRuHOUajtguDq olo4deqL2jfuotnq7vs8q8o+DlUwUheUXjbbIiXUNSSyEGQB38I1+dGZipy/xa9mNZ82 54t9YwWPqYEMvZR84JauoniL8o6CdNvmxIEeKv+zXBONkRGlMnG0nMaLHJd6+fnTdjG/ WEqxDtppADXviJXAL7FCtts6UiiQ5ccdvUZrGsR2EjdTmi8mF8S20SR9Q5KIg37gB2gR QJh4RQskgqHZ+NVF5Ib+RoMOr40cFt4A+CME9xho+3d5V8pHels01FQipgputGfIaMOA ttXg== X-Gm-Message-State: APt69E1AkyWL0f/xuiC/V8vR2rl+aB5OD1HqOAM6S+rZHSOqNcE8oVuR 3gu73n3up/Yg2R5H+RHwdBncUg== X-Received: by 2002:a1c:6902:: with SMTP id e2-v6mr1658132wmc.95.1530612893190; Tue, 03 Jul 2018 03:14:53 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 74-v6sm2071088wmt.0.2018.07.03.03.14.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Jul 2018 03:14:51 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 193B03E0719; Tue, 3 Jul 2018 11:14:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 3 Jul 2018 11:14:31 +0100 Message-Id: <20180703101444.23778-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180703101444.23778-1-alex.bennee@linaro.org> References: <20180703101444.23778-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::22c Subject: [Qemu-devel] [PULL 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: agraf@suse.de, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, qemu-devel@nongnu.org, f4bug@amsat.org, cota@braap.org, famz@redhat.com, aurelien@aurel32.net 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 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 ============