4 LOG_PREFIX=/dev/shm/benchmark-log
6 PLOT_SCRIPT=$LOG_PREFIX-plot.script
7 PLOT_PDF=$LOG_PREFIX-plot.pdf
9 cat >$PLOT_SCRIPT <<EOF
10 set terminal pdf size 29.7cm,21cm
11 set output "$PLOT_PDF"
20 for peer in client server; do
21 LOG=$LOG_PREFIX-$peer.txt
22 fgrep 'recv:' $LOG > $LOG.recv
23 grep '\(send\|rtrx\):' $LOG > $LOG.send
24 fgrep 'snd.cwnd' $LOG > $LOG.cwnd
25 fgrep 'cwndleft' $LOG > $LOG.left
26 fgrep 'rtt' $LOG > $LOG.rtt || (
27 head -1 $LOG.send | (read ts conn rest; echo $ts $conn rtt 0 srtt 0 rttvar 0 rto 0 >$LOG.rtt)
29 (fgrep 'fast recovery started' $LOG || true) | while read ts rest; do
30 echo "set xtics add (\"\" $ts)" >>$PLOT_SCRIPT
32 (fgrep 'retransmitting after timeout' $LOG || true) | while read ts rest; do
33 echo "set xtics add (\"\" $ts)" >>$PLOT_SCRIPT
36 cat >>$PLOT_SCRIPT <<EOF
37 set multiplot layout 4, 1 title "UTCP $peer"
42 set ylabel "sequence number (bytes)"
44 "$LOG.send" using 1:11 title "send seq", \
45 "$LOG.recv" using 1:13 title "recv ack"
46 set xrange [GPVAL_X_MIN:GPVAL_X_MAX]
49 set ylabel "size (bytes)"
51 "$LOG.cwnd" using 1:4 title "cwnd", \
52 "$LOG.cwnd" using 1:6 title "ssthresh"
54 set ylabel "time (milliseconds)"
56 "$LOG.rtt" using 1:(\$4/1000) title "rtt", \
57 "$LOG.rtt" using 1:(\$10/1000) title "rto"
62 set ylabel "size (bytes)"
64 "$LOG.left" using 1:(\$4 > 0 ? \$4 : 0) title "cwnd left", \
65 "$LOG.left" using 1:6 title "sndbuf left"
71 cat >>$PLOT_SCRIPT <<EOF