From patchwork Fri Jun 29 20:52:18 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: 140642 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1300127ljj; Fri, 29 Jun 2018 13:58:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfKk60pOCaeGSLG/uRT3eSx89YSucJXBFWouJ5IPKeiqqqT5a0aMWVITRzZNLkLXrzE5Z4v X-Received: by 2002:a37:7141:: with SMTP id m62-v6mr14138036qkc.110.1530305889609; Fri, 29 Jun 2018 13:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530305889; cv=none; d=google.com; s=arc-20160816; b=SE8jFhUnZMKdg9qrvh1jbeCdCaSB4q1Gr1FYCjaRFDsWmGuljZDfKnkmpiUPb/0LbI kE9Aln4O4lLjv6CmWNOWdkMH7EWwMbp2qVcJPco9vuJmir6CJ9lsC6e0DPr1qfDcvB0Z C4q8JCSukLqgSzcsRWI1gDf31vE911B9qSR1diLsSt+UpkprgP3U1MzbxAF6dzy+oyeC kyrxLB8JXKdx16POOR6a8sPxfrWy87K+ZZL8Lgjt5WfA4B3FDacqE2ocCLJHl6suQxhj z0+L93Ad5G84nshBxcayZ9/AMfo0jFEJmyXAh5siWVZEZxSB/tgNdPLdMzZxOxCRQqJR Fx9Q== 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=cDN9adCyJowdFohRcwb6OscdGHS6Lvw2oV/aTrv237IMgdZaHlieWtYascyHovV+zU oZJ8gQP1mgAzCLDPVSr1iZLb4lrXO3+kkzNEkGOSZLiVX37g9xJeTeAR8NT1xjsK6h2t OyvXFx6Z0MVAdsa9BqYXuoKdxaLUpefGz1Hkd0DQLRMpxji5NY7KnQzDdujVorFhx39M HyOJ6FVJZYid0HDXgbcose2BNHZuMARstuqEK/iiaSVoHWb0AWnoUDH+K04E5BBrv2en 1CJD6bqJ0lGPNiHamg2xLsgFOCOXO1k8wlBlKNb5WChRgkApQOgtNwntpap8bSFe+Crc pl0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hGEHNO+7; 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 33-v6si840378qtg.224.2018.06.29.13.58.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 29 Jun 2018 13:58:09 -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=hGEHNO+7; 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]:44432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ0T3-0003Qm-2Y for patch@linaro.org; Fri, 29 Jun 2018 16:58:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ0No-00085Y-7r for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZ0Nn-0006TD-BR for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:44 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:45974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZ0Nn-0006S7-3k for qemu-devel@nongnu.org; Fri, 29 Jun 2018 16:52:43 -0400 Received: by mail-wr0-x241.google.com with SMTP id u7-v6so9978102wrn.12 for ; Fri, 29 Jun 2018 13:52:42 -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=hGEHNO+7yyCeGiKaRYy7cPJiNu0zMjPaQ0yJbNG6L0Tp8wCdAJbn/j0fhpUybrD3F1 PvmUWeLpBLhwRJTt1gLm2d69Bbdj40aznH05D6V/Md8uMN/9F7g5sjqZFYZiYY7kwtYq pgot8vCxM5+eTeiWf2QenB1lA2WD5BWRkBN9w= 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=qbJIoHuEzUuX10sQ1QOcm84duqYqOF9lygu1BMta3vjxC84Df0S1kzap1xz8xlKx8x XvNDCJodOnB14+dzqrWmp1SdBDHpIoPuuHuxD08qt0kAP1rd4diZdMbv61NaCOHzYWCN 4+CSJrYkulbnnoYkxB2O+SbOZLKt25tTDBbMbDoDCetE9ft+vH+uy0DnjK8nBlCpAW7F P83g39SIuV5OuzhxuGfZFAOjt1XeFFWW/uiOUQ7hPZhOA0OgEB7Kx9tVcSI+FkM0RDkI HVkgwlwuT7WYRBX7pYCT9hICQKE+85gUMU7lcKWF5eXAUeSGy8jgrFsdpVN3uTvzLcyN +98A== X-Gm-Message-State: APt69E3pnA3vrLsueTZS/Y6Bf08AfwCV22uXZmwpl6u9G2QBdkvVEdAc c5OcdAy74JOyycoGKit+bkhxrQ== X-Received: by 2002:adf:adae:: with SMTP id w43-v6mr13927625wrc.251.1530305561934; Fri, 29 Jun 2018 13:52:41 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id r123-v6sm3561960wmb.21.2018.06.29.13.52.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 13:52:39 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 55BF73E0719; Fri, 29 Jun 2018 21:52: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: Fri, 29 Jun 2018 21:52:18 +0100 Message-Id: <20180629205232.27190-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180629205232.27190-1-alex.bennee@linaro.org> References: <20180629205232.27190-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::241 Subject: [Qemu-devel] [PATCH v2 07/21] 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 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 ============