From patchwork Wed Jun 20 13:20: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: 932250 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bxdnKNtm"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419lwH2LWlz9ry1 for ; Wed, 20 Jun 2018 23:26:23 +1000 (AEST) Received: from localhost ([::1]:49665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVd7s-0003kB-Oz for incoming@patchwork.ozlabs.org; Wed, 20 Jun 2018 09:26:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVd2N-0007yD-Ds for qemu-devel@nongnu.org; Wed, 20 Jun 2018 09:20:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVd2M-0002lJ-88 for qemu-devel@nongnu.org; Wed, 20 Jun 2018 09:20:39 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:40168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVd2M-0002kq-22 for qemu-devel@nongnu.org; Wed, 20 Jun 2018 09:20:38 -0400 Received: by mail-wm0-x244.google.com with SMTP id n5-v6so6850999wmc.5 for ; Wed, 20 Jun 2018 06:20:37 -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=OVAp7QMxQs2WEQyoZm93Y02LjcKymtDnW4R825/T0iQ=; b=bxdnKNtm0ttbSyP/oUG+k+EnoYPTJrEj2Rv2/OvGIvTxBckCMGrzpxzdtCSWjgV3DK G+ilxJ4OW8vzJoFQ1Nv3HAr1uOvwOJl+xuuJL8PygXsqHpsaFn6R/D9hKUfRsbUsiJbf 5jxICekqfnUPIc+55u+9LMRB4OejaxjzUNyrs= 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=OVAp7QMxQs2WEQyoZm93Y02LjcKymtDnW4R825/T0iQ=; b=OWU+C7yjDEjqYvvzJ06J21oZhydUPkdy5rMnEAFFFnTOpUkNwn0WH4HpPWjZNpSPFb xfuEKcmQltGCBLaTtsjRe7uyf1L7daAnABgXAnaLRGhnuJGDDckvIHV2RmIBH5uV3Ryh R/lbo2vjWCNj6DLyaZFY255IPdTV6TTMRvWczq/YNK5O1Rvd7ZkUbxGMFcJzDdWg2M/y VXmu3lYPMpEZLvmh9NcfthhzsnK79ZiHQrJUhPbZnI3w4c+rTvuO8kHFeJ1j4hx3ZxvN xbssqC2WG66Etu1hH+x0BU2zNQV022kpm7v7TK+r93UBL4wkqMdist232F8iGfmYBIAG ewOQ== X-Gm-Message-State: APt69E2Hf8GwS/RHcBKMTmHxzeSjCviO62mnZaPrM9JIVYTcZ0ZqmPZn fZfH8vfR0q2g3DOztcdlQg3Ftg== X-Google-Smtp-Source: ADUXVKL+YttySFX29C1KJV5fbYLbKQEwutJXLRAdBCC/SqpY3X3hrhT88qbXisxq3unr01XXVTLkcQ== X-Received: by 2002:a1c:e846:: with SMTP id f67-v6mr1706778wmh.63.1529500837096; Wed, 20 Jun 2018 06:20:37 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d3-v6sm3430119wri.24.2018.06.20.06.20.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 06:20:34 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 7E01E3E08E5; Wed, 20 Jun 2018 14:20:33 +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: Wed, 20 Jun 2018 14:20:31 +0100 Message-Id: <20180620132032.12952-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180620132032.12952-1-alex.bennee@linaro.org> References: <20180620132032.12952-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::244 Subject: [Qemu-devel] [RFC PATCH 4/5] 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+incoming=patchwork.ozlabs.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 Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé --- Makefile | 11 +++++++++++ docs/devel/testing.rst | 11 ++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e46f2b625a..cb4af8bf80 100644 --- a/Makefile +++ b/Makefile @@ -725,6 +725,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 @@ -1075,6 +1083,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..a3652aea14 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 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 ============