summaryrefslogtreecommitdiffstats
path: root/stress-server.sh
blob: 16a376e3e9157093f5483e938dedf92b65aa103a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

ROOT=$(dirname $0)
echo ROOT=$ROOT

AFB=$ROOT/build/src/afb-daemon
HELLO=build/bindings/samples/helloWorld.so
PORT=12345
TEST=test
TOKEN=knock-knock-knoc
OUT=$ROOT/stress-out-server

rm $OUT*

ARGS="-q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --ldpaths=/tmp --binding=$HELLO"

echo -n launch afb...
case "$1" in
 gdb) gdb $AFB -ex "run $ARGS";;
 valgrind) valgrind --leak-check=full $AFB $ARGS 2>&1 | tee $OUT;;
 strace) strace -tt -f -o $OUT.strace $AFB $ARGS 2>&1 | tee $OUT;;
 *) $AFB $ARGS 2>&1 | tee $OUT;;
esac
#$AFB -q --session-max=100 --port=$PORT --workdir=$ROOT --roothttp=$TEST --token=$TOKEN --ldpaths=/tmp --binding=$HELLO  > $OUT.0 2>&1 &
#afbpid=$!
#strace -tt -f -o $OUT-strace.0 -p $afbpid &
wait