From patchwork Fri Mar 11 00:47:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Feiner X-Patchwork-Id: 8561191 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 4AA6E9F38C for ; Fri, 11 Mar 2016 00:48:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 66809201ED for ; Fri, 11 Mar 2016 00:48:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B88D720382 for ; Fri, 11 Mar 2016 00:48:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933217AbcCKAsA (ORCPT ); Thu, 10 Mar 2016 19:48:00 -0500 Received: from mail-pf0-f172.google.com ([209.85.192.172]:33912 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933193AbcCKArz (ORCPT ); Thu, 10 Mar 2016 19:47:55 -0500 Received: by mail-pf0-f172.google.com with SMTP id 129so81363795pfw.1 for ; Thu, 10 Mar 2016 16:47:54 -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=R9DjEJuF1NkFDPvpAZp3uJqIpVdpB7FBvvfclrHI1qhYU5NV4yCOknO2L4NlVjWqjr CBO6g67G9WI0W6xXY7yVW6D1RIBFpkSvaHZYvC++10fI5IeDJ1H2NPYkunfvJ0DvpGfA BoSMKOz1o4O0d35ostd6OzWaMNAKdxNWGh9nkAtyN4PYyFCVxz8kvbdl4cH54VioIZLv p8zAWOMifs9CHl2YJtRi/X9NVKrC//NDEHM5bVmD5b4pzyBstgko6TOkQqTRVbwQNjyG bIxC7kfOPc+KGOOHR8f4OX4BE2wwbBeE6BmrFt8zTDwnbY+/EvIOaP1/p/CxdHmgj1x8 3iow== 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=J8BMeTjaJapj2xsANtp7bUJnrMyyPbNW5S0vOC0Ps1EzP3gEYPHS1pVYntUl9keT/7 TmeT7UNkiRHyrpvcVXjb7uaZIz6eWvyPOJncY00KPnoFXZTta1CBD+0rKeDDnXNKVNQR JFJ8ocF/8P8owvVBfozKXofl8JLDSlaSg5ncY3/gLWXgj0nnG0ersVgM6RDsVb2zPe2g hwiTms1nmK8+EQHuwX8qzK7Ny18qaIuLI7O4qxFJpYSsD1sSxwgkaiB+VJJuwkH5nUIk B/ihJluVtoZXl8fbgEsNhloqn2COXhAJvb0+3aH4vgeuqpwqxBqrPSI4Um3lnhDFosyV uyoQ== X-Gm-Message-State: AD7BkJJ4JoceyXvWorkCccVEcjW9HARITVHVi40Y1uQQkiN9uYaD2ZxpeppA0OxxrVUjvXqH X-Received: by 10.98.64.4 with SMTP id n4mr9320325pfa.58.1457657273946; Thu, 10 Mar 2016 16:47:53 -0800 (PST) Received: from localhost ([2620:0:1009:3:fd91:211e:47f5:d0b0]) by smtp.gmail.com with ESMTPSA id q72sm8131540pfa.70.2016.03.10.16.47.53 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 10 Mar 2016 16:47:53 -0800 (PST) From: Peter Feiner To: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com Cc: Peter Feiner Subject: [PATCH kvm-unit-tests v6 5/5] scripts: automatically pretty print stacks Date: Thu, 10 Mar 2016 16:47:39 -0800 Message-Id: <98947d8b7b723c3d7bcbdd5fcd1234151a361b82.1457656962.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 | 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