@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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 ..
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(-)