📄 launch.sh
字号:
#!/bin/sh -x# profile filenamePREF=$1# number of cyclesNROFCYCLES=4# functions to go into reportMYFN="eat_line|eat_space|eat_token"# set to non-zero if only a report is to be generated#REPONLY=truCONFIG=profile.cfgSRD=${HOME}/sip_routerPRO=${SRD}/profileREP=$PRO/$PREF.txtEXEC=serfunction usage(){cat << EOFusage: $0 profile_namecurrently, this script starts a remote sender at alioth.The sender iterates through all messages available in itsdirectory and send them many times (should be configurable).Sip-router is configured to relay requests to benetnash:sinkand responses are built to be routed there too.This repeats NROFCYCLES-times. Results of all cycles are thendumped into <profile_name>-<cycle number>.txt and areport <profile_name>.txt is generated.EOFexit 1}if [ "$#" -ne 1 ] ; then usageficd $SRDfunction run(){j=0while [ $j -lt "$NROFCYCLES" ] ; doi=`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 $EXECgprof $EXEC > $PRO/${PREF}-${i}.txtdone}function report(){cat > $REP << EOFfirst line ... time spent in tested proceduresecond line (yyrestart) ... total timethird line (receive_msg) ... numer of calls % cumulative self self total time seconds seconds calls ms/call ms/call nameEOFj=0while [ $j -lt "$NROFCYCLES" ] ; doi=`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 >> $REPdonecat >> $REP << EOFExecution environment:EOFcat /proc/cpuinfo /proc/meminfo >> $REP}if [ -z "$REPONLY" ] ; then runfireportecho '*** finished ***'echo
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -