From patchwork Tue Mar 22 23:35:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Feiner X-Patchwork-Id: 8646561 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 C9E7E9F294 for ; Tue, 22 Mar 2016 23:35:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 055B320398 for ; Tue, 22 Mar 2016 23:35:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 130E92039D for ; Tue, 22 Mar 2016 23:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbcCVXfX (ORCPT ); Tue, 22 Mar 2016 19:35:23 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:36252 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751973AbcCVXfP (ORCPT ); Tue, 22 Mar 2016 19:35:15 -0400 Received: by mail-pf0-f178.google.com with SMTP id u190so331844115pfb.3 for ; Tue, 22 Mar 2016 16:35:15 -0700 (PDT) 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=dvwSUlUN5b8s6oLwnG23nly3hVIUUg2+WGNwQ13cGmc=; b=CC0wxkHMbU3Nsalq2Fers9W3fg+tVnNUtMIzatjVAtXEIxcEHprMrUbLU3pR8Mwj6y 56JQv9WPB1nqzoHJqhP+zF04bQsYC49LNQ/wjGcGNemjMVNfGUiFOm38NYjrZLlR6FoV 8W6w/IodyKPnare8EHw/944t+6Ljo7ze2I1Ix/l3XqI5VQB7uwlCrq7f4+Z6Rnfpr+3p LMyqs5YOOtCKeZ6QbAxE7vjrZHx6EUi9O6XzM4vJVq3zxjn73Ec9Ad2rMNX5dSMr+MgH 4b4zzXQyjUHOXEp0wUba/1qi2knTUTRTNILJnGDMTmSBwIEnWSucRXE32bfmWRwx6mkR UPTw== 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=dvwSUlUN5b8s6oLwnG23nly3hVIUUg2+WGNwQ13cGmc=; b=OotZI+cpdKCcWYJSwJwjKAa8d3fLX6JCmuuyZRhXSH++jhKteL3FhiAtxTYpKNX34F n/IJATwXJ9TqHEkdXAzYawH+t8CytSZVu80coWxFgdpaP+Ay8djv/u+t1xGLFCVBAPMh Id2NN69sbDhabgURz/1gMt1nfgFtjr+zbWhb+ecGyj6aFEMIzm7PevrqibLy5Gx9Xdk+ EhQ29N3zrhyitBYED6c0BkkbT4ldWEeceI0kpaEbdiFy2a3P8P83OiMgxdPDPUgrFvcY yVvgEpQ/PAcgWSCJcouin1RL3jmec6r47lOdwOA01ftkbFLGPhU4Ho6z/5KCZ9avOc9k UvQw== X-Gm-Message-State: AD7BkJJo+2B4yeZVJ9sODwuZFmU4CzluPz5Xccm/8DFapJcUQhD331F7EmHS8ptSMn1hbfaG X-Received: by 10.66.146.164 with SMTP id td4mr58023801pab.47.1458689714688; Tue, 22 Mar 2016 16:35:14 -0700 (PDT) Received: from localhost ([2620:0:1009:3:4fb:9875:8ad2:ab82]) by smtp.gmail.com with ESMTPSA id 82sm50764937pfi.78.2016.03.22.16.35.14 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 22 Mar 2016 16:35:14 -0700 (PDT) From: Peter Feiner To: drjones@redhat.com, pbonzini@redhat.com, kvm@vger.kernel.org Cc: pfeiner@google.com Subject: [PATCH kvm-unit-tests v7 5/5] scripts: automatically pretty print stacks Date: Tue, 22 Mar 2016 16:35:06 -0700 Message-Id: X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 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,T_DKIM_INVALID,T_RP_MATCHES_RCVD, 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 Reviewed-By: Andrew Jones --- 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