From 43d1fc38b83d1aadfd22263a5930caaf8e0c584c Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 9 Dec 2010 21:19:13 +0100 Subject: [PATCH] Generate files without switches and update strips --- gw-tests/filter-sff.sh | 4 ++-- gw-tests/filter.sh | 4 ++-- gw-tests/mod.sh | 20 ++++++++++---------- gw-tests/nop-highprio-time.sh | 8 ++++---- gw-tests/nop-highprio.sh | 16 ++++++++-------- gw-tests/nop-time.sh | 8 ++++---- gw-tests/nop.sh | 16 ++++++++-------- gw-tests/pc.sh | 16 ++++++++-------- gw-tests/user.sh | 16 ++++++++-------- gw-tests/vcan.sh | 4 ++-- gw-tests/vcans.sh | 4 ++-- latester/latester.c | 27 ++++++++------------------- 12 files changed, 66 insertions(+), 77 deletions(-) diff --git a/gw-tests/filter-sff.sh b/gw-tests/filter-sff.sh index 547bb10..a57d25f 100755 --- a/gw-tests/filter-sff.sh +++ b/gw-tests/filter-sff.sh @@ -7,7 +7,7 @@ ids="0 $(seq 255 256 2047)" main() { sshgw 'for i in `seq 0 2047`; do cangw -A -s can0 -d can1 -f $(printf %x $i):c00007ff; done' for i in $ids; do - latester -d can0 -d can1 -d can2 -c $COUNT -i $i $(traffic_and_length 2) -h hist-$i.dat -f time-$i.dat + latester -d can0 -d can1 -d can2 -c $COUNT -i $i $(traffic_and_length 2) -n id-$i done } @@ -22,7 +22,7 @@ plot [0:1500] [1:$COUNT] \\ EOF lt=1 for i in $ids; do - echo_plot "\"hist-$i.dat\" with lp lt $lt title \"Message id $i\"" + echo_plot "\"id-$i-hist.txt\" with lp lt $lt title \"Message id $i\"" lt=$((lt+1)) done echo diff --git a/gw-tests/filter.sh b/gw-tests/filter.sh index 91743c9..9abe307 100755 --- a/gw-tests/filter.sh +++ b/gw-tests/filter.sh @@ -7,7 +7,7 @@ ids="0 $(seq 255 256 2047)" main() { sshgw 'for i in `seq 0 2047`; do cangw -A -s can0 -d can1 -f $(printf %x $i):7ff; done' for i in $ids; do - latester -d can0 -d can1 -d can2 -c $COUNT -i $i $(traffic_and_length 2) -h hist-$i.dat -f time-$i.dat + latester -d can0 -d can1 -d can2 -c $COUNT -i $i $(traffic_and_length 2) -n id-$i done } @@ -22,7 +22,7 @@ plot [0:1500] [1:$COUNT] \\ EOF lt=1 for i in $ids; do - echo_plot "\"hist-$i.dat\" with lp lt $lt title \"Message id $i\"" + echo_plot "\"id-$i-hist.txt\" with lp lt $lt title \"Message id $i\"" lt=$((lt+1)) done } diff --git a/gw-tests/mod.sh b/gw-tests/mod.sh index ea6a62b..6c529d1 100755 --- a/gw-tests/mod.sh +++ b/gw-tests/mod.sh @@ -7,19 +7,19 @@ main() { LATESTER_OPTS="-d can0 -d can1 -d can2 $(traffic_and_length 8) -c $COUNT" sshgw cangw -A -s can0 -d can1 - latester $LATESTER_OPTS -h hist.dat -f time.dat + latester $LATESTER_OPTS -n nop cleanupgw sshgw cangw -A -s can0 -d can1 -m OR:D:0.0.0000123400000000 \ -m SET:IL:123.8.0000000000000000 - latester $LATESTER_OPTS -h hist-mod.dat -f time-mod.dat + latester $LATESTER_OPTS -n mod cleanupgw sshgw cangw -A -s can0 -d can1 -m AND:ID:0.0.ffff000000000000 \ -m OR:D:0.0.0000123400000000 \ -m XOR:D:0.0.0000000012345678 \ -m SET:IL:123.8.0000000000000000 - latester $LATESTER_OPTS -h hist-mod2.dat -f time-mod2.dat + latester $LATESTER_OPTS -n mod2 cleanupgw sshgw cangw -A -s can0 -d can1 -m AND:ID:0.0.ffff000000000000 \ @@ -27,14 +27,14 @@ main() { -m XOR:D:0.0.0000000012345678 \ -m SET:IL:123.8.0000000000000000 \ -x 0:6:7:0 - latester $LATESTER_OPTS -h hist-modcsxor.dat -f time-modcsxor.dat + latester $LATESTER_OPTS -n modcsxor cleanupgw sshgw cangw -A -s can0 -d can1 -m AND:ID:0.0.ffff000000000000 \ -m OR:D:0.0.0000123400000000 \ -m XOR:D:0.0.0000000012345678 \ -m SET:IL:123.8.0000000000000000 \ -p 3 -c 0:6:7:0:0:00D013C326F635E54C9C5F8F6ABA79A998488B5BBE6EAD7DD404C717F222E13183539040A575B666CF1FDC0CE939FA2A1BCB08D83DED2EFE5787449471A162B2B565A67693438050F929EA3ADF0FCC1C2DFD3EEE0BDB18C861B172A24797548436E625F510C003D37AAA69B95C8C4F9FAE7EBD6D88589B4BE232F121C414D707D909CA1AFF2FEC3C95458656B363A0704191528267B774A40DDD1ECE2BFB38E85A8A49997CAC6FBF16C605D530E023F3C212D101E434F7278E5E9D4DA878BB6B6CBC7FAF4A9A598920F033E306D615C5F424E737D202C111B868AB7B9E4E8D5DEF3FFC2CC919DA0AA373B0608555964677A764B4518142923BEB28F81DCD0EDE - latester $LATESTER_OPTS -h hist-modcscrc8.dat -f time-modcscrc8.dat + latester $LATESTER_OPTS modcscrc8 } plot_cmds() { @@ -45,11 +45,11 @@ set grid set xlabel "Time [{/Symbol m}s]" set ylabel "Latency profile [messages]" plot [0:600] [1:$COUNT] \ - "hist.dat" with lp lt 1 title "No modifications", \ - "hist-mod.dat" with lp lt 2 title "Two modifications", \ - "hist-mod2.dat" with lp lt 3 title "Four modifications", \ - "hist-modcsxor.dat" with lp lt 4 title "Four modifications and XOR checksum",\ - "hist-modcscrc8.dat" with lp lt 5 title "Four modifications and CRC8 checksum" + "nop-hist.txt" with lp lt 1 title "No modifications", \ + "mod-hist.txt" with lp lt 2 title "Two modifications", \ + "mod2-hist.txt" with lp lt 3 title "Four modifications", \ + "modcsxor-hist.txt" with lp lt 4 title "Four modifications and XOR checksum",\ + "modcscrc8-hist.txt" with lp lt 5 title "Four modifications and CRC8 checksum" EOF } diff --git a/gw-tests/nop-highprio-time.sh b/gw-tests/nop-highprio-time.sh index f3cca21..e1f8537 100755 --- a/gw-tests/nop-highprio-time.sh +++ b/gw-tests/nop-highprio-time.sh @@ -13,10 +13,10 @@ set grid set xlabel "Time [s]" set ylabel "Latency [{/Symbol m}s]" plot [:] [:500] \ - "../nop-highprio/time2.dat" using 2:(1000000*$14) with points title "2 byte messages", \ - "../nop-highprio/time4.dat" using 2:(1000000*$14) with points title "4 byte messages", \ - "../nop-highprio/time6.dat" using 2:(1000000*$14) with points title "6 byte messages", \ - "../nop-highprio/time8.dat" using 2:(1000000*$14) with points title "8 byte messages" + "../nop-highprio/len2-msgs.txt" using 2:(1000000*$14) with points title "2 byte messages", \ + "../nop-highprio/len4-msgs.txt" using 2:(1000000*$14) with points title "4 byte messages", \ + "../nop-highprio/len6-msgs.txt" using 2:(1000000*$14) with points title "6 byte messages", \ + "../nop-highprio/len8-msgs.txt" using 2:(1000000*$14) with points title "8 byte messages" EOF } diff --git a/gw-tests/nop-highprio.sh b/gw-tests/nop-highprio.sh index e8dc865..f0077b5 100755 --- a/gw-tests/nop-highprio.sh +++ b/gw-tests/nop-highprio.sh @@ -8,10 +8,10 @@ main() { sshgw 'chrt -p -f 99 `pidof irq/146-can1` || :' sshgw 'chrt -p -f 98 `pidof sirq-net-rx/0` || :' sshgw 'chrt -p -f 98 `pidof sirq-net-tx/0` || :' - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -h hist2.dat -f time2.dat - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 4) -h hist4.dat -f time4.dat - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 6) -h hist6.dat -f time6.dat - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -h hist8.dat -f time8.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n len2 + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 4) -n len4 + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 6) -n len6 + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -n len8 } plot_cmds() { @@ -22,10 +22,10 @@ set grid set xlabel "Time [{/Symbol m}s]" set ylabel "Latency profile [messages]" plot [0:600] [1:$COUNT] \ - "hist2.dat" with lp lt 1 title "2 byte messages", \ - "hist4.dat" with lp lt 2 title "4 byte messages", \ - "hist6.dat" with lp lt 3 title "6 byte messages", \ - "hist8.dat" with lp lt 4 title "8 byte messages" + "len2-hist.txt" with lp lt 1 title "2 byte messages", \ + "len4-hist.txt" with lp lt 2 title "4 byte messages", \ + "len6-hist.txt" with lp lt 3 title "6 byte messages", \ + "len8-hist.txt" with lp lt 4 title "8 byte messages" EOF } diff --git a/gw-tests/nop-time.sh b/gw-tests/nop-time.sh index 4065a35..627fb13 100755 --- a/gw-tests/nop-time.sh +++ b/gw-tests/nop-time.sh @@ -13,10 +13,10 @@ set grid set xlabel "Time [s]" set ylabel "Latency [{/Symbol m}s]" plot [:] [:500] \ - "../nop/time2.dat" using 2:(1000000*$14) with points title "2 byte messages", \ - "../nop/time4.dat" using 2:(1000000*$14) with points title "4 byte messages", \ - "../nop/time6.dat" using 2:(1000000*$14) with points title "6 byte messages", \ - "../nop/time8.dat" using 2:(1000000*$14) with points title "8 byte messages" + "../nop/len2-msgs.txt" using 2:(1000000*$14) with points title "2 byte messages", \ + "../nop/len4-msgs.txt" using 2:(1000000*$14) with points title "4 byte messages", \ + "../nop/len6-msgs.txt" using 2:(1000000*$14) with points title "6 byte messages", \ + "../nop/len8-msgs.txt" using 2:(1000000*$14) with points title "8 byte messages" EOF } diff --git a/gw-tests/nop.sh b/gw-tests/nop.sh index f5804e6..3747a85 100755 --- a/gw-tests/nop.sh +++ b/gw-tests/nop.sh @@ -4,10 +4,10 @@ main() { sshgw cangw -A -s can0 -d can1 - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -h hist2.dat -f time2.dat - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 4) -h hist4.dat -f time4.dat - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 6) -h hist6.dat -f time6.dat - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -h hist8.dat -f time8.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n len2 + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 4) -n len4 + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 6) -n len6 + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -n len8 } plot_cmds() { @@ -18,10 +18,10 @@ set grid set xlabel "Time [{/Symbol m}s]" set ylabel "Latency profile [messages]" plot [0:600] [1:$COUNT] \ - "hist2.dat" with lp lt 1 title "2 byte messages", \ - "hist4.dat" with lp lt 2 title "4 byte messages", \ - "hist6.dat" with lp lt 3 title "6 byte messages", \ - "hist8.dat" with lp lt 4 title "8 byte messages" + "len2-hist.txt" with lp lt 1 title "2 byte messages", \ + "len4-hist.txt" with lp lt 2 title "4 byte messages", \ + "len6-hist.txt" with lp lt 3 title "6 byte messages", \ + "len8-hist.txt" with lp lt 4 title "8 byte messages" EOF } diff --git a/gw-tests/pc.sh b/gw-tests/pc.sh index 62180f0..11b8d3b 100755 --- a/gw-tests/pc.sh +++ b/gw-tests/pc.sh @@ -3,10 +3,10 @@ . lib.sh main() { - latester -d can0 -d can1 -c $COUNT $(traffic_and_length 2) -h hist2.dat -f time2.dat - latester -d can0 -d can1 -c $COUNT $(traffic_and_length 4) -h hist4.dat -f time4.dat - latester -d can0 -d can1 -c $COUNT $(traffic_and_length 6) -h hist6.dat -f time6.dat - latester -d can0 -d can1 -c $COUNT $(traffic_and_length 8) -h hist8.dat -f time8.dat + latester -d can0 -d can1 -c $COUNT $(traffic_and_length 2) -n len2 + latester -d can0 -d can1 -c $COUNT $(traffic_and_length 4) -n len4 + latester -d can0 -d can1 -c $COUNT $(traffic_and_length 6) -n len6 + latester -d can0 -d can1 -c $COUNT $(traffic_and_length 8) -n len8 } plot_cmds() { @@ -17,10 +17,10 @@ set grid set xlabel "Time [{/Symbol m}s]" set ylabel "Latency profile [messages]" plot [0:600] [1:$COUNT] \ - "hist2.dat" with lp lt 1 title "2 byte messages", \ - "hist4.dat" with lp lt 2 title "4 byte messages", \ - "hist6.dat" with lp lt 3 title "6 byte messages", \ - "hist8.dat" with lp lt 4 title "8 byte messages" + "len2-hist.txt" with lp lt 1 title "2 byte messages", \ + "len4-hist.txt" with lp lt 2 title "4 byte messages", \ + "len6-hist.txt" with lp lt 3 title "6 byte messages", \ + "len8-hist.txt" with lp lt 4 title "8 byte messages" EOF } diff --git a/gw-tests/user.sh b/gw-tests/user.sh index a8f3498..6fedbda 100755 --- a/gw-tests/user.sh +++ b/gw-tests/user.sh @@ -4,12 +4,12 @@ main() { pid=$(sshgw 'chrt -f 90 candump -s2 -b can1 can0 & echo $!') - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -h uhist2.dat -f utime2.dat - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -h uhist8.dat -f utime8.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n user2 + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -n user8 sshgw kill $pid sshgw cangw -A -s can0 -d can1 - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -h khist2.dat -f ktime2.dat - latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -h khist8.dat -f ktime8.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n kern2 + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -n kern8 } plot_cmds() { @@ -20,10 +20,10 @@ set grid set xlabel "Time [{/Symbol m}s]" set ylabel "Latency profile [messages]" plot [0:] [1:$COUNT] \ - "khist2.dat" with lp lt 1 title "Kernel GW, 2 byte messages", \ - "khist8.dat" with lp lt 2 title "Kernel GW, 8 byte messages", \ - "uhist2.dat" with lp lt 1 title "Userspace GW, 2 byte messages", \ - "uhist8.dat" with lp lt 2 title "Userspace GW, 8 byte messages" + "kern2-hist.txt" with lp lt 1 title "Kernel GW, 2 byte messages", \ + "kern8-hist.txt" with lp lt 2 title "Kernel GW, 8 byte messages", \ + "user2-hist.txt" with lp lt 1 title "Userspace GW, 2 byte messages", \ + "user8-hist.txt" with lp lt 2 title "Userspace GW, 8 byte messages" EOF } diff --git a/gw-tests/vcan.sh b/gw-tests/vcan.sh index 9ddbeea..b760d5f 100755 --- a/gw-tests/vcan.sh +++ b/gw-tests/vcan.sh @@ -14,7 +14,7 @@ main() { done sshgw cangw -A -s vcan0 -d can1 -f $(printf %x:C00007FF $i) - latester -d can0 -d can1 -d can2 -c $COUNT -i 0 -h hist-$i.dat -f time-$i.dat + latester -d can0 -d can1 -d can2 -c $COUNT -i 0 -n hops$i done sshgw ip link del dev vcan0 } @@ -30,7 +30,7 @@ plot [0:10000] [1:$COUNT] \\ EOF lt=2 for i in $numjobs; do - echo_plot "\"hist-$i.dat\" with lp lt $lt title \"$((i+2)) GW jobs, 1 vcan\"" + echo_plot "\"hops$i-hist.txt\" with lp lt $lt title \"$((i+2)) GW jobs, 1 vcan\"" lt=$((lt+1)) done } diff --git a/gw-tests/vcans.sh b/gw-tests/vcans.sh index 08160a9..69e867d 100755 --- a/gw-tests/vcans.sh +++ b/gw-tests/vcans.sh @@ -15,7 +15,7 @@ main() { done sshgw cangw -A -s $lastif -d can1 -f $(printf %x:C00007FF $((i-1))) - latester -d can0 -d can1 -d can2 -c $COUNT -i 0 $(traffic_and_length 2) -h hist-$i.dat -f time-$i.dat + latester -d can0 -d can1 -d can2 -c $COUNT -i 0 $(traffic_and_length 2) -n hops$i done } @@ -30,7 +30,7 @@ plot [0:1000] [1:$COUNT] \\ EOF lt=1 for i in $numjobs; do - echo_plot "\"hist-$i.dat\" with lp lt $lt title \"$i GW jobs, $((i-1)) vcans\"" + echo_plot "\"hops$i-hist.txt\" with lp lt $lt title \"$i GW jobs, $((i-1)) vcans\"" lt=$((lt+1)) done } diff --git a/latester/latester.c b/latester/latester.c index a25fd10..6a78872 100644 --- a/latester/latester.c +++ b/latester/latester.c @@ -60,8 +60,6 @@ struct options { unsigned count; unsigned oneattime; char *name; - int histogram; - int file; int length; int userhist; @@ -509,8 +507,7 @@ void process_final_rx(int s) mi->ts_rx_final = ts_user; mi->received = frame; - if (opt.histogram) - histogram_add(&histogram, get_msg_latency_us(mi)); + histogram_add(&histogram, get_msg_latency_us(mi)); ret = write(completion_pipe[1], &mi, sizeof(mi)); if (ret == -1) @@ -634,8 +631,6 @@ struct poptOption optionsTable[] = { { "oneattime",'o', POPT_ARG_NONE, &opt.oneattime,0, "Send the next message only when the previous was finally received"}, { "verbose",'v', POPT_ARG_NONE, NULL, 'v', "Send the next message only when the previous was finally received"}, { "name", 'n', POPT_ARG_STRING, &opt.name, 0, "Prefix of the generated files"}, - { "file", 'f', POPT_ARG_NONE, &opt.file, 0, "Store all message data in a file", "filename"}, - { "histogram", 'h', POPT_ARG_NONE, &opt.histogram, 0, "Store histogram in file", "filename"}, { "length", 'l', POPT_ARG_INT|POPT_ARGFLAG_SHOW_DEFAULT, &opt.length, 0, "The length of generated messages", "bytes"}, { "userhist", 'u', POPT_ARG_NONE, &opt.userhist, 0, "Generate histogram from userspace timestamps"}, POPT_AUTOHELP @@ -670,14 +665,14 @@ int parse_options(int argc, const char *argv[]) if (opt.oneattime && opt.period_us) error(1, 0, "oneattime and period cannot be specified at the same time"); - if (opt.name && opt.file) { + if (opt.name) { char *f = talloc_asprintf(local, "%s-msgs.txt", opt.name); opt.f_msgs = fopen(f, "w"); if (!opt.f_msgs) error(1, errno, "fopen: %s", f); } - if (opt.name && opt.histogram) { + if (opt.name) { char *f = talloc_asprintf(local, "%s-hist.txt", opt.name); opt.f_hist = fopen(f, "w"); if (!opt.f_hist) @@ -718,9 +713,7 @@ int main(int argc, const char *argv[]) for (i=0; i