From patchwork Fri Mar 4 19:34:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Feiner X-Patchwork-Id: 8507171 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 867B3C0554 for ; Fri, 4 Mar 2016 19:34:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A480620259 for ; Fri, 4 Mar 2016 19:34:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AAF3B201F2 for ; Fri, 4 Mar 2016 19:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932220AbcCDTe3 (ORCPT ); Fri, 4 Mar 2016 14:34:29 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:36476 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932158AbcCDTe2 (ORCPT ); Fri, 4 Mar 2016 14:34:28 -0500 Received: by mail-pf0-f175.google.com with SMTP id 63so40127884pfe.3 for ; Fri, 04 Mar 2016 11:34:28 -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=+4LxpuFC/QtwXIwaGc4X6IT2gGG+u4DnjI/O/SSprUI=; b=eyxOwsbdrW80m9pK4rdtSN5yRfYNU1cMWG00MpebS8U6MiaK88+WF5nKzbSaxGws+3 iJPbAbHUWX/Q7ufaEodHOM0eq5vlxw4h0HdOnFIjc7j4jr0XDI3G3RLhLiVzVU59xnWH y65AxBGDR6q+GoTX2kpg96y3UpbPSZVi7DJSffN/XqKhN4m46Dm6f9JWEu1FfyKhMnz0 r2JhqVS1/+8DiELASkCRCIU2wn0iU/1EUZrCUXv/IrKMP7mR6utKx5g/WkAD1k7JHeMe Zw/RcbeSW0anklcF1Ed7bexYvHraUrCfr5ZObX0k1iz4F/NqkiOCqqftPpMr4Mf3hg3e Cuaw== 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=+4LxpuFC/QtwXIwaGc4X6IT2gGG+u4DnjI/O/SSprUI=; b=YzFOErLzL6f3XYLFq6+doHJvdzniqeAGyFe69X4uvgGPuE0FfEPqG6ukmH05EHU0bn t1EZPZ+Y5JZ2Asvjhl1CzaqziwRQzuo1HzoddJGITOX4EsVZydhCWYKfLyNTZn8g3ID+ x9y5BsYPEi7GZIgI23mSuScnuqiros4q4vVj1+NHPCH231wHFcxRj0fNuPPw4luEvPZv lq6wMKLgfiJtDInBzXF2Z8vPRUeEMb4TqVftrcebxtdWeECkXsOTxnBCsm1d6VJ/hDPS iM+erOBoEZPItct/yeN07wRFXQoQrgy8o80I5YhSH4y8375IvOHMyE77tOyF/jsWJhWc 9ZfQ== X-Gm-Message-State: AD7BkJJYDSXM+v4/FaErNXVP38KHaBncIKMyuxg9bVPOoN4rraT8PFh1lcDmkZpi9TL2BGpk X-Received: by 10.98.40.4 with SMTP id o4mr14854630pfo.76.1457120067711; Fri, 04 Mar 2016 11:34:27 -0800 (PST) Received: from localhost ([2620:0:1009:3:90d6:d6fe:49e8:86b0]) by smtp.gmail.com with ESMTPSA id v3sm7310541par.17.2016.03.04.11.34.24 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 04 Mar 2016 11:34:25 -0800 (PST) From: Peter Feiner To: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com Cc: Peter Feiner Subject: [PATCH kvm-unit-tests v4 5/5] scripts: automatically pretty print stacks Date: Fri, 4 Mar 2016 11:34:01 -0800 Message-Id: <18225a3d3c6102b2a00979b5733a363f60ba5cbe.1457119891.git.pfeiner@google.com> 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 | 10 ++++++++-- scripts/mkstandalone.sh | 4 ++++ 3 files changed, 22 insertions(+), 2 deletions(-) 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..9589252 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -28,7 +28,7 @@ EOF RUNTIME_arch_run="./$TEST_DIR/run" source scripts/runtime.bash -while getopts "g:hv" opt; do +while getopts "g:hvp" opt; do case $opt in g) only_group=$OPTARG @@ -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..368fa4a 100755 --- a/scripts/mkstandalone.sh +++ b/scripts/mkstandalone.sh @@ -41,6 +41,10 @@ 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/')" + + # Can't pretty print without binary. + echo "export PRETTY_PRINT_STACKS=no" + config_export ARCH config_export ARCH_NAME config_export PROCESSOR