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: 139339 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp793588lji; Wed, 20 Jun 2018 06:28:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKTvJzQOiIKxcqfLGSUaK31JAPfPLtmjjkO4OtufmgXFVD6ew+b64jKcRvEb4Y3XVkAEXPc X-Received: by 2002:a37:19e3:: with SMTP id 96-v6mr17814141qkz.427.1529501305160; Wed, 20 Jun 2018 06:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529501305; cv=none; d=google.com; s=arc-20160816; b=a9qZxLkEgEymUjXktME4DFMFd0AyJxjt/4/+Pd3d+f+BeeHFdBIp9/TJd1Zg7Lspra jrrLwIOMZoak+Ew0Xe6nmB3NWguYVLtCRr4G8kaRe0O02+C+gSxXiardKNx0xo01MRMa OSx2tLjeRE3p7wI7tZkk80go0rL3sEm/ezA4vgx8gFeEQwz08NsRxTWH8mf16JyKfERr 8SzX9yLF6BEP065Ey4BtWRwQQMaDQlIPgSzde9Q7TKs5WWCSOhBRAhkiwlXtJIq371Cp lsiy7qtYkLJ1HWr0PmxzwsmOW5Fp0YbrvcRPq34SXa1KIJCVsMRLDTGE3r9UDn9hwkxe q/Ww== 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=OVAp7QMxQs2WEQyoZm93Y02LjcKymtDnW4R825/T0iQ=; b=GqZDHIy4z/c7us1lorj+IdQAWc4u/nT9LK03EbZaoFTV8F3/gSCLG3RJygbCCVqUdj edEiDNRKJHTOWAZ4wm6HH2XF3RFtIXbRCxE1dLVo3DQkH/GrCLsD4/JzrclzAKupRT61 AsfugxDnDYH1JSKNIeMspZiNS2XUpfTr9HmeNUJhe/KcqMAo7zv/JmEy4wrMxwEjXn6T zFfDvhRSp15wCBgzgzAkt90QTy1EtN95l+wGbvgR/KnOdOmoPuxZXcc7aKzTQBHg47A7 xGtzakHJJ4h/sEu2prmKL+QX3GgPWbIsyVGqPukcPTQj7D5SEuZAwEQhqonNbTKcHyud egNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bxdnKNtm; 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 47-v6si206047qvj.156.2018.06.20.06.28.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 20 Jun 2018 06:28:25 -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=bxdnKNtm; 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]:49673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVd9s-0005LO-Kv for patch@linaro.org; Wed, 20 Jun 2018 09:28:24 -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-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+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 --- Makefile | 11 +++++++++++ docs/devel/testing.rst | 11 ++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) -- 2.17.1 Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé 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 ============