From patchwork Wed Oct 9 10:56:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 20908 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B30725C6D for ; Wed, 9 Oct 2013 10:56:52 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r9sf184699yen.11 for ; Wed, 09 Oct 2013 03:56:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=9y1b39G03a0jtPbtAjBCv406+WNhJcInfnmDEr/8Xx4=; b=CpKAUjjgWe5hzsmXZzgT0QJO/v0Ty1754iqtHD17JKL7DrrtPsDfmOq/5a56vsyHx0 7bCw+Icz6PDxtjxqng51AO3Qreciuxv+VfaJYuSTMZUl14JRlC3ZQiq0saCuCOxB8ENY wdxJlfujbbK/XtztBTzpiPSxuAwcdRBER6aLQDkXMrtSPC5vJ5g89vPGvEd8BB+tjUFg WcRfDm1bJ9Y0lwKYmwJ5AoNhhrNohFCBO4BU3ys7itNM0bgWcfzXvDRxa3+8wONAkWRe InDuitNfimF9bPX4p8zQwfcg9sLYytRthzN2t7Wg0jA2AX/OESI9UoN21pdv5Lu4+b8f qTQA== X-Received: by 10.236.32.74 with SMTP id n50mr6929858yha.13.1381316212241; Wed, 09 Oct 2013 03:56:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.17.98 with SMTP id n2ls564905qed.12.gmail; Wed, 09 Oct 2013 03:56:52 -0700 (PDT) X-Received: by 10.221.64.17 with SMTP id xg17mr5149173vcb.5.1381316212117; Wed, 09 Oct 2013 03:56:52 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id lr1si11592850vcb.94.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Oct 2013 03:56:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ht10so363952vcb.24 for ; Wed, 09 Oct 2013 03:56:52 -0700 (PDT) X-Gm-Message-State: ALoCoQklnhEhMacdmduJa68LlgJSap+Sdaa9x/8qZQzs0C54mejYQVw9bAZfWejBC1sqRSskwUbb X-Received: by 10.220.142.140 with SMTP id q12mr1133154vcu.21.1381316212000; Wed, 09 Oct 2013 03:56:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp277555vcz; Wed, 9 Oct 2013 03:56:51 -0700 (PDT) X-Received: by 10.112.9.195 with SMTP id c3mr1617483lbb.33.1381316209399; Wed, 09 Oct 2013 03:56:49 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by mx.google.com with ESMTPS id 2si16905800lar.111.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Oct 2013 03:56:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.217.177 is neither permitted nor denied by best guess record for domain of anders.roxell@linaro.org) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id w7so603482lbi.36 for ; Wed, 09 Oct 2013 03:56:48 -0700 (PDT) X-Received: by 10.152.10.99 with SMTP id h3mr5893753lab.13.1381316208531; Wed, 09 Oct 2013 03:56:48 -0700 (PDT) Received: from localhost (c-853670d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.54.133]) by mx.google.com with ESMTPSA id m13sm25789653lbo.11.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 09 Oct 2013 03:56:47 -0700 (PDT) From: Anders Roxell To: davej@redhat.com Cc: trinity@vger.kernel.org, patches@linaro.org, Anders Roxell Subject: [PATCH 1/3] scripts: TRINITY_PATH defaults to "." Date: Wed, 9 Oct 2013 12:56:24 +0200 Message-Id: <1381316186-8562-2-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1381316186-8562-1-git-send-email-anders.roxell@linaro.org> References: <1381316186-8562-1-git-send-email-anders.roxell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: anders.roxell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , TRINITY_PATH may be changed in the enviroment Signed-off-by: Anders Roxell --- scripts/analyse-dumps.sh | 4 +++- scripts/clean-cores.sh | 4 +++- scripts/find.sh | 8 +++++--- scripts/test-all-syscalls-parallel.sh | 6 ++++-- scripts/test-all-syscalls-sequentially.sh | 8 +++++--- scripts/test-multi.sh | 6 ++++-- scripts/test-vm.sh | 4 +++- 7 files changed, 27 insertions(+), 13 deletions(-) diff --git a/scripts/analyse-dumps.sh b/scripts/analyse-dumps.sh index d55393c..bd45ea5 100755 --- a/scripts/analyse-dumps.sh +++ b/scripts/analyse-dumps.sh @@ -1,8 +1,10 @@ #!/bin/sh +TRINITY_PATH=${TRINITY_PATH:-.} + for core in $(find . -name "core.*") do - gdb -batch -n -ex 'bt' ./trinity $core > core.txt + gdb -batch -n -ex 'bt' $TRINITY_PATH/trinity $core > core.txt SHA=$(cat core.txt| grep -v New\ LWP | sha1sum) cat core.txt > core-$SHA.txt rm -f core.txt diff --git a/scripts/clean-cores.sh b/scripts/clean-cores.sh index 821e06a..0b90be6 100755 --- a/scripts/clean-cores.sh +++ b/scripts/clean-cores.sh @@ -1,8 +1,10 @@ #!/bin/sh +TRINITY_PATH=${TRINITY_PATH:-.} + # remove old cores for i in `find . -name "core.*" -exec ls -l {} \; | grep -v "$(date +%b\ %e)" | awk '{ print $9 }'`; do rm -f $i; done # Remove corrupted cores find . -empty -name "core.*" -exec rm -f {} \; -for i in $(file core.* | grep -v trinity | awk '{ print $1 }' | sed 's/://'); do rm -f $i; done +for i in $(file core.* | grep -v $TRINITY_PATH/trinity | awk '{ print $1 }' | sed 's/://'); do rm -f $i; done diff --git a/scripts/find.sh b/scripts/find.sh index 537160f..5528210 100755 --- a/scripts/find.sh +++ b/scripts/find.sh @@ -5,6 +5,8 @@ # sendmsg that only occurred after connect was called. # +TRINITY_PATH=${TRINITY_PATH:-.} + check_tainted() { if [ "$(cat /proc/sys/kernel/tainted)" != $TAINT ]; then @@ -27,18 +29,18 @@ while [ 1 ]; do -for sc in $(../trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u) +for sc in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u) do mkdir -p tmp.$i pushd tmp.$i - if [ ! -f ../../trinity ]; then + if [ ! -f $TRINITY_PATH/trinity ]; then echo lost! pwd exit fi - ../../trinity -q -l off -n -c sendmsg -c $sc -C32 -N 999999 + $TRINITY_PATH/trinity -q -l off -n -c sendmsg -c $sc -C32 -N 999999 popd diff --git a/scripts/test-all-syscalls-parallel.sh b/scripts/test-all-syscalls-parallel.sh index 861c156..c713cce 100755 --- a/scripts/test-all-syscalls-parallel.sh +++ b/scripts/test-all-syscalls-parallel.sh @@ -1,5 +1,7 @@ #!/bin/bash +TRINITY_PATH=${TRINITY_PATH:-.} + if [ ! -d tmp ]; then mkdir tmp fi @@ -8,9 +10,9 @@ cd tmp while [ 1 ]; do - for syscall in $(../trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u) + for syscall in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u) do - MALLOC_CHECK_=2 ../trinity -q -c $syscall -D & + MALLOC_CHECK_=2 $TRINITY_PATH/trinity -q -c $syscall -D & done wait done diff --git a/scripts/test-all-syscalls-sequentially.sh b/scripts/test-all-syscalls-sequentially.sh index 85bcf71..6d79db4 100755 --- a/scripts/test-all-syscalls-sequentially.sh +++ b/scripts/test-all-syscalls-sequentially.sh @@ -3,6 +3,8 @@ # This is a useful test to run occasionally, to see which syscalls are # causing trinity to segfault. +TRINITY_PATH=${TRINITY_PATH:-.} + check_tainted() { if [ "$(cat /proc/sys/kernel/tainted)" != $TAINT ]; then @@ -19,18 +21,18 @@ TAINT=$(cat /proc/sys/kernel/tainted) while [ 1 ] do -for syscall in $(./trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u) +for syscall in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u) do chmod 755 tmp pushd tmp - if [ ! -f ../trinity ]; then + if [ ! -f $TRINITY_PATH/trinity ]; then echo lost! pwd exit fi - MALLOC_CHECK_=2 ../trinity -q -c $syscall -N 99999 -l off -C 64 + MALLOC_CHECK_=2 $TRINITY_PATH/trinity -q -c $syscall -N 99999 -l off -C 64 popd check_tainted diff --git a/scripts/test-multi.sh b/scripts/test-multi.sh index 6fddeba..993e124 100755 --- a/scripts/test-multi.sh +++ b/scripts/test-multi.sh @@ -1,5 +1,7 @@ #!/bin/bash +TRINITY_PATH=${TRINITY_PATH:-.} + check_tainted() { if [ "$(cat /proc/sys/kernel/tainted)" != $TAINT ]; then @@ -22,7 +24,7 @@ NR_PROCESSES=$(($NR_CPUS * 2)) while [ 1 ]; do rm -f trinity - cp ../trinity . + cp $TRINITY_PATH/trinity . chmod -w trinity for i in `seq 1 $NR_PROCESSES` @@ -35,7 +37,7 @@ do mkdir -p tmp.$i pushd tmp.$i - if [ ! -f ../../trinity ]; then + if [ ! -f $TRINITY_PATH/trinity ]; then echo lost! pwd exit diff --git a/scripts/test-vm.sh b/scripts/test-vm.sh index 4c472ca..6b75e8d 100755 --- a/scripts/test-vm.sh +++ b/scripts/test-vm.sh @@ -1,5 +1,7 @@ #!/bin/bash +TRINITY_PATH=${TRINITY_PATH:-.} + if [ ! -d tmp ]; then mkdir tmp fi @@ -16,7 +18,7 @@ do cd tmp.$RND for i in `seq 1 $NR_PROCESSES` do - ../../trinity -q -g vm & + $TRINITY_PATH/trinity -q -g vm & done wait cd ..