File: launch.sh

package info (click to toggle)
openser 1.1.0-9etch1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,828 kB
  • ctags: 11,809
  • sloc: ansic: 120,528; sh: 5,249; yacc: 1,716; makefile: 1,261; php: 656; perl: 205; sql: 190
file content (106 lines) | stat: -rw-r--r-- 2,057 bytes parent folder | download | duplicates (15)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/sh -x

# profile filename
PREF=$1
# number of cycles
NROFCYCLES=4
# functions to go into report
MYFN="eat_line|eat_space|eat_token"
# set to non-zero if only a report is to be generated
#REPONLY=tru

CONFIG=profile.cfg

SRD=${HOME}/sip_router
PRO=${SRD}/profile
REP=$PRO/$PREF.txt
EXEC=ser


function usage()
{
cat << EOF
usage: $0 profile_name

currently, this script starts a remote sender at alioth.
The sender iterates through all messages available in its
directory and send them many times (should be configurable).
Sip-router is configured to relay requests to benetnash:sink
and responses are built to be routed there too.
This repeats NROFCYCLES-times. Results of all cycles are then
dumped into <profile_name>-<cycle number>.txt and a
report <profile_name>.txt is generated.

EOF

exit 1
}

if [ "$#" -ne 1 ] ; then
	usage
fi

cd $SRD

function run()
{
j=0
while [ $j -lt "$NROFCYCLES" ] ; do
i=`printf "%.3d" $j`
j=`expr $j + 1`

echo "*** Entering cycle $j"

/usr/bin/time --output="$PRO/${PREF}-${i}-time.txt" ${SRD}/$EXEC -l 192.168.99.100 -D -E -d -f ${PRO}/$CONFIG &

#rsh -l jku benetnash.fokus.gmd.de 'nohup bin/sock -s -u 5060 '

rsh -l jku alioth.fokus.gmd.de 'nohup tmp/sipp/start.sh '

killall -INT $EXEC

gprof $EXEC > $PRO/${PREF}-${i}.txt

done
}

function report()
{
cat > $REP << EOF
first line ... time spent in tested procedure
second line (yyrestart) ... total time
third line (receive_msg) ... numer of calls
   %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
EOF

j=0
while [ $j -lt "$NROFCYCLES" ] ; do
i=`printf "%.3d" $j`
j=`expr $j + 1`
  FN="${PRO}/${PREF}-${i}.txt"
  echo >> $REP
  echo >> $REP
  echo $FN >> $REP
  egrep "($MYFN|yyrestart)" $FN | grep -v '\[' >> $REP
  grep 'receive_msg \[.\]' $FN | grep -v '\/' >> $REP
  echo >> $REP
  cat $PRO/${PREF}-${i}-time.txt >> $REP

done

cat >> $REP << EOF


Execution environment:
EOF
cat /proc/cpuinfo /proc/meminfo >> $REP
}

if [ -z "$REPONLY" ] ; then
	run
fi
report

echo '*** finished ***'
echo