# This is raw2xg without the sorting, for faster operation. eval 'exec perl -S $0 ${1+"$@"}' # -*-perl-*- if 0; require 5.001; ($progname) = ($0 =~ m!([^/]+)$!); sub usage { print STDERR <) { $dfile = $ARGV; @F = split; /testName/ && ($file = $F[2], next); /^[\+-] / && do { $c = $F[7] if ($c < $F[7]); $is_ack = ($F[4] eq 'ack'); $is_ecn = ($F[6] =~ /E/); $is_cong = ($F[6] =~ /A/); $is_echo = ($F[6] =~ /C/); next if ($is_ack && !$plot_acks); if ($plot_full) { ($x, $y) = translate_point(@F[1, 12, 7]); } else { ($x, $y) = translate_point(@F[1, 10, 7]); } if (defined($opt_q)) { if (/^\+/) { $statement = undef; $q_time_seg{$is_ack,$y} = $x; }; $statement = "move $q_time_seg{$is_ack,$y} $y\ndraw $x $y\n" if (/^\-/); } else { $statement = "$x $y\n"; }; if (defined($statement)) { if ($plot_drops) { if ($is_ecn) { push(@pc, $statement); }; } else { if ($is_ack) { if ($is_ecn) { push(@ac, $statement); } else { push(@a, $statement); }; if ($is_echo) { push(@ae, $statement); }; } else { if ($is_ecn) { push(@pc, $statement); } else { push(@p, $statement); }; if ($is_cong) { push(@pg, $statement); } }; }; }; next; }; /^d / && do { ($x, $y) = translate_point(@F[1, 10, 7]); push(@d, "$x $y\n"); next; }; /link-down/ && (push(@ld, $F[1]), next); /link-up/ && (push(@lu, $F[1]), next); if ($plot_event) { /^E / && do { ($x, $y) = translate_point(@F[1, 7, 6]); if ($F[5] eq 'TCP_TIMEOUT') { push(@vto, "$x $y\n"); next; } if ($F[5] eq 'SLOW_START') { push(@vss, "$x $y\n"); next; } if ($F[5] eq 'FAST_RETX') { push(@vfr, "$x $y\n"); next; } if ($F[5] eq 'RENO_FAST_RETX') { push(@vrfr, "$x $y\n"); next; } if ($F[5] eq 'NEWRENO_FAST_RETX') { push(@vnrfr, "$x $y\n"); next; } if ($F[5] eq 'FAST_RECOVERY') { push(@vfc, "$x $y\n"); next; } }; } } if ($file eq '') { ($file) = ($dfile =~ m!([^/]+)$!); } $title = defined($opt_t) ? $opt_t : $file; print "TitleText: $title\n" . "Device: Postscript\n" . "BoundBox: true\n" . "Ticks: true\n" . (defined($opt_q) ? "" : "NoLines: true\n") . "Markers: true\n" . "XUnitText: time\n" . "YUnitText: packets\n"; print "\n\"packets\n", @p; if (defined($pc[0])) { print "\n\"ecn_packets\n", @pc[0..3], @pc; } else { if (!$no_padding) { printf "\n\"skip-1\n0 1\n"; } } # insert dummy data sets so we get X's for marks in data-set 4 if (!defined($a[0])) { push(@a, "0 1\n"); } if ($plot_acks) { print "\n\"acks\n", @a; if ($plot_ecn && defined($ac[0])) { print "\n\"ecn-acks\n", @ac; } if ($plot_ecn && defined($ae[0])) { print "\n\"echo-acks\n", @ae; } } else { if (!$no_padding) { printf "\n\"skip-2\n0 1\n"; } } # # Repeat the first line twice in the drops file because often we have only # one drop and xgraph won't print marks for data sets with only one point. # print "\n\"drops\n", @d[0..3], @d; if ($plot_event) { # Event tracing print "\n\"events\n"; print "\n\"event_timeout\n", @vto[0..3], @vto; print "\n\"event_slowstart\n", @vss[0..3], @vss; print "\n\"event_fastretx\n", @vfr[0..3], @vfr; print "\n\"event_renofastretx\n", @vrfr[0..3], @vrfr; print "\n\"event_nrenofastretx\n", @vnrfr[0..3], @vnrfr; print "\n\"event_fastrecovery\n", @vfc[0..3], @vfc; } $c++; print "\n"; foreach $i (@ld) { print "\"link-down\n$i 0\n$i $c\n"; } foreach $i (@lu) { print "\"link-up\n$i 0\n$i $c\n"; } if ($plot_ecn && defined($pg[0])) { if (!defined($d[0])) { printf "\n\"skip-3\n0 1\n"; } print "\n\"cong_act_packets\n", @pg[0..3], @pg; } exit 0;