From patchwork Mon Mar 7 17:46:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Feiner X-Patchwork-Id: 8521481 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A40E89F7CA for ; Mon, 7 Mar 2016 17:47:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D18AC202C8 for ; Mon, 7 Mar 2016 17:47:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EABED202A1 for ; Mon, 7 Mar 2016 17:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753468AbcCGRrQ (ORCPT ); Mon, 7 Mar 2016 12:47:16 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:33995 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753449AbcCGRrH (ORCPT ); Mon, 7 Mar 2016 12:47:07 -0500 Received: by mail-pf0-f180.google.com with SMTP id 129so39273572pfw.1 for ; Mon, 07 Mar 2016 09:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Cz588zbZ2PbRLbgH6imbv2uY2RDYJUiIgXOGK9aHNRM=; b=M+hBZX7il6YkGxgnhR59qiwqzmrZE1ZAa+NONPbSvUoJ8LReXbfCovdlLVMgJ23mJ9 eGi4dPkIopKjWvmcWnJ5gynE9twWbpXpkE9std2mstvV6Fboar8DenTDQL5A0vxZRVYg VS2P08PaxNRSoeyaKOD2tiQP/AfjUPVE/A4mgRqBiGpobqI5cTUwbliRL7tkcFWKAcbU BVuVyBUGIdJWT0fkpmw2IcscQkW1W4md5dDy77No6wttkP3nM8C5vTs7SKL3xf1iJmwp 1NvWNDrbkH+QgdwquZbI5GPzM3UdYpmyhKRCLl4y4TpBvxo4XGKXmulxaiRqFes5SkDt jNFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=Cz588zbZ2PbRLbgH6imbv2uY2RDYJUiIgXOGK9aHNRM=; b=HVEw1iVa2FlU0efnbH39sgdkIpNcv9mel/sbn4y+/5Dy5/uOlLt5bPGcAKm969ZHcP 4v1HmLdFJDK3GtXz5v8zA2UCGCd+EXFNXrLDE0gI8Tw6/FGL6VJVMdYjRlDobNZAsrOw LA/hNxim6ZWM/2CV9+7GCIldwy6na8j7iwp5a4HUmebz3eDfL8KgPO17g9ii8qaeD3Jk eDSPkGuso+idR3rP2eCV/ru6KR6abeXsDzbB2tzl+p26MpFgU2I4jTawgBJf3AfhMjbL T1abbUgN7eFow0rptEQWPtMhK8XkyxhgJa5mDumTiF6Jder/01/CjaVC6bor4b2+ZzqZ pgZw== X-Gm-Message-State: AD7BkJKyasvuf0/fNfUN6rdIXUKBAx/TtbH5RTe/zYvNORoqJFFQTGg39/5eVakLHYgMEiyd X-Received: by 10.98.89.7 with SMTP id n7mr28475302pfb.81.1457372826387; Mon, 07 Mar 2016 09:47:06 -0800 (PST) Received: from localhost ([2620:0:1009:3:d845:64d7:b824:3f90]) by smtp.gmail.com with ESMTPSA id rq16sm6342154pab.29.2016.03.07.09.47.05 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 07 Mar 2016 09:47:05 -0800 (PST) From: Peter Feiner To: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com Cc: Peter Feiner Subject: [PATCH kvm-unit-tests v5 5/5] scripts: automatically pretty print stacks Date: Mon, 7 Mar 2016 09:46:57 -0800 Message-Id: X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: References: In-Reply-To: References: Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now run_tests.sh automatically pipes test output through scripts/pretty_print_stacks.py. Can be disabled with ./configure --disable-pretty-print-stacks. Pretty printing disabled on standalone tests because there's no binary. Signed-off-by: Peter Feiner --- configure | 10 ++++++++++ run_tests.sh | 8 +++++++- scripts/mkstandalone.sh | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 958321d..ba6c55b 100755 --- a/configure +++ b/configure @@ -11,6 +11,7 @@ arch=`uname -m | sed -e 's/i.86/i386/;s/arm.*/arm/;s/ppc64.*/ppc64/'` host=$arch cross_prefix= endian="" +pretty_print_stacks=yes usage() { cat <<-EOF @@ -25,6 +26,8 @@ usage() { --prefix=PREFIX where to install things ($prefix) --kerneldir=DIR kernel build directory for kvm.h ($kerneldir) --endian=ENDIAN endianness to compile for (little or big, ppc64 only) + --[enable|disable]-pretty-print-stacks + enable or disable pretty stack printing (enabled by default) EOF exit 1 } @@ -61,6 +64,12 @@ while [[ "$1" = -* ]]; do --ld) ld="$arg" ;; + --enable-pretty-print-stacks) + pretty_print_stacks=yes + ;; + --disable-pretty-print-stacks) + pretty_print_stacks=no + ;; --help) usage ;; @@ -149,4 +158,5 @@ API=$api TEST_DIR=$testdir FIRMWARE=$firmware ENDIAN=$endian +PRETTY_PRINT_STACKS=$pretty_print_stacks EOF diff --git a/run_tests.sh b/run_tests.sh index 89e8f84..7e0237f 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -46,7 +46,13 @@ while getopts "g:hv" opt; do esac done -RUNTIME_arch_run="./$TEST_DIR/run >> test.log" +if [ "$PRETTY_PRINT_STACKS" = "yes" ]; then + log_redir="> >(./scripts/pretty_print_stacks.py \$kernel >> test.log)" +else + log_redir=">> test.log" +fi + +RUNTIME_arch_run="./$TEST_DIR/run $log_redir" config=$TEST_DIR/unittests.cfg rm -f test.log printf "BUILD_HEAD=$(cat build-head)\n\n" > test.log diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh index 1d3a20d..ef15bc8 100755 --- a/scripts/mkstandalone.sh +++ b/scripts/mkstandalone.sh @@ -41,6 +41,8 @@ generate_test () echo "#!/bin/bash" echo "export STANDALONE=yes" echo "export HOST=\$(uname -m | sed -e s/i.86/i386/ | sed -e 's/arm.*/arm/')" + echo "export PRETTY_PRINT_STACKS=no" + config_export ARCH config_export ARCH_NAME config_export PROCESSOR