From patchwork Mon Jul 2 14:30:07 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: 140776 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp24073ljj; Mon, 2 Jul 2018 07:31:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf36/L5xHabW4NnlGwG+GnBv2steS+Xjf6s9UJNBL3ShS9BTYLUwLujtCp0BupLSspDzCv0 X-Received: by 2002:a37:88c2:: with SMTP id k185-v6mr22492663qkd.102.1530541862625; Mon, 02 Jul 2018 07:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530541862; cv=none; d=google.com; s=arc-20160816; b=TRx6qrFgPV8TsPFCToVY1dImSMhsg524LQFYEGUGtaSJ8Sxc9N75nZg7LloW9CK8xu Dx7+cEaoCvn3E1aCaBNl0eePE2M2IF35m5l/XQ7gUXXDo6n5FHX5nIagsS5DCzptK7RU K0mK4Ogck3DRjH3Fvq1iHO7JK8npbARE+vVdhEkcwsX915ICMlkW9xEFqL0SuUsnL9fm ksOnk1/S7PibTW7u1QB2h+3+ZLdkNPNg//oa6OySw6MxA57xt10yTOh6TbbKsxRdCsSe eRoUU9X7+A8kn+M64EtMKK0+7eP/JMbXzy9ZtiPE+jfbJSq1UgBWGm73b8JJdtpHT/xj s5wA== 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=S8BiLsI7s/sA0sVpBKHltyy1im8BtaazfWlgOgOElIE=; b=dhgQq2Re+fZrqkO2M9WmgRtyiOiGjLhCk1hJvwvVKCTVOH63K0JxzP++UhdMBtV4HP nMZ38IjjsNaWO9PpWu/u1dhhQJeyI6PE+a/ycTN/ffZY3/Vuri2y2lXoalpX5uQHKY/m /Th+lNlskbu8VTKMAsj0MXa8OMZjoyHh1DXOxWhIBw8m6n142qnM/Qr35sP+b74JKouV 43xEcNa16ryblRMlWr/dv0PjdVUDUmcYYxnOmdTlzErVNWc7AvxXrqfHgJY6G/sQLflC cb4BMgvqdqQ5Wtqhpl6mVHHX8v9geA2sKMamkLgxZn0ztFgNzMLnPYZe0DV3+EtEY25U crBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MvZb9P9P; 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 b88-v6si883896qkj.67.2018.07.02.07.31.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 02 Jul 2018 07:31:02 -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=MvZb9P9P; 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]:33146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzr3-0005Q7-SZ for patch@linaro.org; Mon, 02 Jul 2018 10:31:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzqZ-0005NX-34 for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZzqX-0000TU-ON for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:31 -0400 Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]:42976) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZzqX-0000Sn-IT for qemu-devel@nongnu.org; Mon, 02 Jul 2018 10:30:29 -0400 Received: by mail-wr0-x229.google.com with SMTP id p1-v6so15793279wrs.9 for ; Mon, 02 Jul 2018 07:30:29 -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=S8BiLsI7s/sA0sVpBKHltyy1im8BtaazfWlgOgOElIE=; b=MvZb9P9PyAH133K0lJeQkJGk64JPERaB442ByCNcn2r4nUwXqELEr9Hbh1mtaAKppa qwzKxS4EYDXoxK1nmG6Oj/b+ReECXa+es/XnalaRzZCTKQZrVnuD6u/XxhaBaKOAqQcm gvjfqvmKM00pjKS6rEf62AC8G6BUtpy5VS7GA= 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=S8BiLsI7s/sA0sVpBKHltyy1im8BtaazfWlgOgOElIE=; b=U55Yttdx7JM0CEHz+bQYpjIWopKGPPPT49z6iOEiISQhOfVpZSZda9LgiFwKMSNUze KZKm5cZk8Kt8iFRzxoQUcq0fUFp7o+UHdageMjhV1eclrzIeq08LE5iWn15G8qrfksR3 f4QPxnWy2C5h6BpAot8wp0uQuQYR++iOt5ylFtbr19neJMpZTjEdAeTqvIidIGJJVyc7 E8r4bYkpL4OK57jK8Uih5S6v82HXoQYDwnfe+BBHBfC8aPU+VGIVC6V4W/Tjvl9+GIp9 t5g98fupALc7IhbaNF6ehoZ2xrrwTm1BsAdLg8X7MsTvER+MzTlXoD+ecl3NzTbw9W5/ HGJQ== X-Gm-Message-State: APt69E2wFuz1/+3h3A9JwsfrSFejqEmwz5frTDYCI32IiNpZlfIL6t5N t3K3tQsOO3cVlo9t1HJsLKmuaQ== X-Received: by 2002:adf:9c91:: with SMTP id d17-v6mr12309444wre.11.1530541828344; Mon, 02 Jul 2018 07:30:28 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h3-v6sm14734352wrm.8.2018.07.02.07.30.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 07:30:23 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 3578A3E075D; Mon, 2 Jul 2018 15:30:22 +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: Mon, 2 Jul 2018 15:30:07 +0100 Message-Id: <20180702143021.18864-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180702143021.18864-1-alex.bennee@linaro.org> References: <20180702143021.18864-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::229 Subject: [Qemu-devel] [PATCH v3 06/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: 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 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é --- v2 - pushed finagling into scripts/coverage-summary.sh - dropped r-b as a big change v3 - move from scripts to scripts/travis and update MAINTAINERS --- .travis.yml | 3 +++ MAINTAINERS | 1 + scripts/travis/coverage-summary.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100755 scripts/travis/coverage-summary.sh -- 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 42a1892d6a..4917b8e48d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2165,6 +2165,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