public inbox for trinity@vger.kernel.org
 help / color / mirror / Atom feed
From: Anders Roxell <anders.roxell@linaro.org>
To: davej@redhat.com
Cc: trinity@vger.kernel.org, patches@linaro.org,
	Anders Roxell <anders.roxell@linaro.org>
Subject: [PATCH 1/3] scripts: TRINITY_PATH defaults to "."
Date: Wed,  9 Oct 2013 12:56:24 +0200	[thread overview]
Message-ID: <1381316186-8562-2-git-send-email-anders.roxell@linaro.org> (raw)
In-Reply-To: <1381316186-8562-1-git-send-email-anders.roxell@linaro.org>

TRINITY_PATH may be changed in the enviroment

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 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 ..
-- 
1.8.1.2

  reply	other threads:[~2013-10-09 10:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 10:56 [PATCH 0/3] script enhancements Anders Roxell
2013-10-09 10:56 ` Anders Roxell [this message]
2013-10-09 10:56 ` [PATCH 2/3] scripts: change mkdir tmp to mktemp Anders Roxell
2013-10-09 10:56 ` [PATCH 3/3] scripts: arch dependent to get the syscall_list Anders Roxell
2013-10-09 16:41   ` Dave Jones
2013-10-10  8:45     ` Anders Roxell
2013-10-10  8:41 ` [PATCHv2 3/3] tables.c: change the output format of -L Anders Roxell
2013-10-10 17:20   ` Dave Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381316186-8562-2-git-send-email-anders.roxell@linaro.org \
    --to=anders.roxell@linaro.org \
    --cc=davej@redhat.com \
    --cc=patches@linaro.org \
    --cc=trinity@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox