From patchwork Thu Jul 5 16:03:16 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: 141190 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2124670ljj; Thu, 5 Jul 2018 09:11:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdOwJzkanS07uJFrX2nhMlE6L7BU5v1A98q3wBjCaukblMECJPtw5xihAcNb11ooa+CxvdO X-Received: by 2002:a0c:f101:: with SMTP id i1-v6mr5705807qvl.67.1530807089760; Thu, 05 Jul 2018 09:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530807089; cv=none; d=google.com; s=arc-20160816; b=DiaEs+RqRsgpDR2e5x464UiUrqqYaF2Kvavlvk0Vh/sEyOVeuJAGXSB2RVJ+iYOVVg 6ticox6lhj5Xw3uMyxO5Uzd0x9hdQdtN9SuYD1gRoQ3rIHcsYJgzzZgciUClubviqJII M6+N/dZIOpKwwu2GtPaRQ511Ab5Kt1LfFPxQMIlIB5TWG4/lzyKf57R/VJMAUneG/wur GUIaYvL3EA8TNFyA9Odm1t17pF0FVbsqOE7rHFKziX9rXnfmj0/R3ohVCg6pBfcV0i/h LITq/ZPgJ6mxumXbPnLuhgUBSNb6gdQmvU3Zw0DtkjmFWWu+lQaxwTlS+ZMcqK731hav ICHA== 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=QhVSSCsCpcmhhZfvuYE8CVZNq2NEJx/PPHHEhuPMxLA=; b=pJLwyBCMdqT9Crwc8q1fUpDimNrvdetOmOrhuKjYpDzoozta2ZKqWm878DHMhJj+dl hgxNFA5AZ1o6MudN7HQwARPTfbocs0z76EbYdaNTH+qBvN2uZOMIuTJVCNM/rLLLYjuF oAkT6CyX6Y/WFzovsCtBhoxZvhRBc/CBQTvZzPKbMLeeXp0RAa4DbiKFVsLgIruUBKI6 hgAymQtj7Ew6QiRbgcMeGlCHlKNHYP0ahdtbDHhRV5ZthbRXf8TDSow64N5LFeQQuHO+ YxZIBjVZLMlh9WB/69ZzIbVfVoa6zhbuZHjsOeVMp/Pw1TOK/hmqCKC84LZ4NHzEDdTc OGsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fsywEDr8; 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 e35-v6si6409322qvd.129.2018.07.05.09.11.29 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 05 Jul 2018 09:11:29 -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=fsywEDr8; 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]:53523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fb6qv-0005Sa-7n for patch@linaro.org; Thu, 05 Jul 2018 12:11:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fb6jL-0008Ne-SF 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 1fb6jK-00080W-MW for qemu-devel@nongnu.org; Thu, 05 Jul 2018 12:03:39 -0400 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:36650) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fb6jK-0007zq-GN for qemu-devel@nongnu.org; Thu, 05 Jul 2018 12:03:38 -0400 Received: by mail-wm0-x229.google.com with SMTP id s14-v6so11817964wmc.1 for ; Thu, 05 Jul 2018 09:03:38 -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=QhVSSCsCpcmhhZfvuYE8CVZNq2NEJx/PPHHEhuPMxLA=; b=fsywEDr8VECI1wwiX9klI13gLv+uucTBFaCev7Jujuu5aflREZ4vNK+/rBIMhs6RTW Sjslrcxvb2SSv9SYO/lwZd7vR/1VEUI/GMso3mRkG81NxwO7abapf9i6ER0UaWfo23iP pTyrRjV2bM61gdAIhkSDMo+xqzRGV/vPdHdI4= 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=QhVSSCsCpcmhhZfvuYE8CVZNq2NEJx/PPHHEhuPMxLA=; b=rwdCj3yEC5zFjvucnbhXIPVebu2yCHieCt1PnDRgXIgLojpTrEaTcBQ2JSBmrJZX98 rnO11/rRiw8LXl2soCwj6YV3Lv37tFwYWXHPdHfCEccS8HgN7uvm4qJjt49exA86iqlL jsYQx2NErILuuCZkA+yvpXLJ4tOFYbV/0UeozjvwcupQqzRCvgAEhnzxTHmKvWRGhOxa e3YwPzRFnl2e4Id4Kf0Zmb4j9DaZ92irogKmQ7uHymGtLKtp5aBpHNt7nsaeGFTt2HNC iEVZpaybvPZaNiBXEtFqEYJc7GQ+bKqfAZni+P3XQuoIoCtB21kZ5SMSOpHjiGp3zN5P oVmw== X-Gm-Message-State: APt69E2GAqnpP477LIcR4vAQvsL3UBIAObh0HeYa6yuPei1aiqOWVnv1 yGxtxCYCdE18JmDuU2UZvuTWwA== X-Received: by 2002:a1c:f513:: with SMTP id t19-v6mr4854127wmh.50.1530806617177; Thu, 05 Jul 2018 09:03:37 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id u7-v6sm12987851wmd.3.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 E01FE3E07D1; 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:16 +0100 Message-Id: <20180705160329.30386-8-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::229 Subject: [Qemu-devel] [PULL v3 07/20] travis: add gcovr summary for GCOV build 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: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This gives a more useful summary, sorted by descending % coverage, after the tests have run. The final numbers will give an idea if our coverage is getting better or worse. To keep the width sane we need to post process the file that the old gcovr tool generates. This is done with a mix of sed, awk and column in the scripts/coverage-summary.sh script. As quite a lot of lines don't get covered at all we filter out all the 0% lines. If the file doesn't appear it is not being exercised. Signed-off-by: Alex Bennée Reviewed-by: Daniel P. Berrangé -- 2.17.1 diff --git a/.travis.yml b/.travis.yml index 32188d51f1..95be6ec59f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,7 @@ addons: - libvte-2.90-dev - sparse - uuid-dev + - gcovr # The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu # to prevent IRC notifications from forks. This was created using: @@ -86,6 +87,8 @@ matrix: compiler: clang # gprof/gcov are GCC features - env: CONFIG="--enable-gprof --enable-gcov --disable-pie --target-list=aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu" + after_success: + - ${SRC_DIR}/scripts/travis/coverage-summary.sh compiler: gcc # We manually include builds which we disable "make check" for - env: CONFIG="--enable-debug --enable-tcg-interpreter" diff --git a/MAINTAINERS b/MAINTAINERS index 6630d691d1..6a13f70f99 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2166,6 +2166,7 @@ R: Philippe Mathieu-Daudé L: qemu-devel@nongnu.org S: Maintained F: .travis.yml +F: scripts/travis/ F: .shippable.yml F: tests/docker/ F: tests/vm/ diff --git a/scripts/travis/coverage-summary.sh b/scripts/travis/coverage-summary.sh new file mode 100755 index 0000000000..d7086cf9ca --- /dev/null +++ b/scripts/travis/coverage-summary.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Author: Alex Bennée +# +# Summerise the state of code coverage with gcovr and tweak the output +# to be more sane on Travis hosts. As we expect to be executed on a +# throw away CI instance we do spam temp files all over the shop. You +# most likely don't want to execute this script but just call gcovr +# directly. See also "make coverage-report" +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. + +# first generate the coverage report +gcovr -p -o raw-report.txt + +# strip the full-path and line markers +sed s@$PWD\/@@ raw-report.txt | sed s/[0-9]\*[,-]//g > simplified.txt + +# reflow lines that got split +awk '/.[ch]$/ { printf("%s", $0); next } 1' simplified.txt > rejoined.txt + +# columnify +column -t rejoined.txt > final.txt + +# and dump, stripping out 0% coverage +grep -v "0%" final.txt