]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
Generate files without switches and update strips
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 9 Dec 2010 20:19:13 +0000 (21:19 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 9 Dec 2010 20:19:54 +0000 (21:19 +0100)
12 files changed:
gw-tests/filter-sff.sh
gw-tests/filter.sh
gw-tests/mod.sh
gw-tests/nop-highprio-time.sh
gw-tests/nop-highprio.sh
gw-tests/nop-time.sh
gw-tests/nop.sh
gw-tests/pc.sh
gw-tests/user.sh
gw-tests/vcan.sh
gw-tests/vcans.sh
latester/latester.c

index 547bb1029bc0b717825e930ff21d76d06d6122d6..a57d25f2f0d12e39f226e8f32cf0921644e603a3 100755 (executable)
@@ -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
index 91743c972b17a44f6af4d2d45052ada565f106bd..9abe307a4dddead0de7a8400cb2ac31ebab057b4 100755 (executable)
@@ -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
 }
index ea6a62befe2464b9ca3491cedd80d69a868785c8..6c529d139dc30daacd92bd19b5aaa917c957aa78 100755 (executable)
@@ -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
 }
     
index f3cca219669ba25ccbf2b6377e92ef86fbe59f4e..e1f8537e4d09582358b924e885868dfa9e522bd6 100755 (executable)
@@ -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
 }
     
index e8dc865f281449b57a0238f3b09be01cdaf966d1..f0077b52b9fcb16d52c6016e47b283f6d34061c6 100755 (executable)
@@ -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
 }
     
index 4065a35fdb7ad3dc6e3b4635cd27cca89b83d6a6..627fb131dabe7dc54e24c1a97da02d61f5289baf 100755 (executable)
@@ -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
 }
     
index f5804e673dce7fc47d5427cf9ff05488b12a6474..3747a85034ba89870e683d95d4d1299367876285 100755 (executable)
@@ -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
 }
     
index 62180f0ed4b20d1a6adc17d36779e17a2e89dc20..11b8d3b215d6c124ca4ba28562a2292a4e9649c5 100755 (executable)
@@ -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
 }
     
index a8f3498cea87f9f124f96d8d80c591f0739ed638..6fedbda75301279cbaaa696b04dce5369cd38d8b 100755 (executable)
@@ -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
 }
     
index 9ddbeea92d275c11f3be74f78dbe5fd8fabff7c9..b760d5ff28ef69fb8cf7405bc023165d583e7840 100755 (executable)
@@ -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
 }
index 08160a9e2c73bf09f659afe879ba9a44dfdd8478..69e867dd36ecfdd344fee3bdd94956a7addde120 100755 (executable)
@@ -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
 }
index a25fd10cb33978c3c7f6eb32aa2cbdf4f8a9e7e9..6a78872afeb1ebd25e627485d6713cb0594c8296 100644 (file)
@@ -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<MAX_INFOS; i++)
                msg_infos[i].id = -1;
 
-       if (opt.histogram) {
-               histogram_init(&histogram, 5000000, 1);
-       }
+       histogram_init(&histogram, 5000000, 1);
 
        ret = pipe(completion_pipe);
        if (ret == -1)
@@ -749,8 +742,7 @@ int main(int argc, const char *argv[])
                        ret = read(completion_pipe[0], &mi, sizeof(mi));
                        if (ret < sizeof(mi))
                                error(1, errno, "read completion returned %d", ret);
-                       if (opt.file)
-                               msg_info_print(opt.f_msgs, mi);
+                       msg_info_print(opt.f_msgs, mi);
                        msg_info_free(mi);
                        completed++;
                }
@@ -782,12 +774,9 @@ int main(int argc, const char *argv[])
        close(completion_pipe[0]);
        close(completion_pipe[1]);
 
-       if (opt.histogram) {
-               histogram_fprint(&histogram, opt.f_hist);
-               fclose(opt.f_hist);
-       }
-       if (opt.file)
-               fclose(opt.f_msgs);
+       histogram_fprint(&histogram, opt.f_hist);
+       fclose(opt.f_hist);
+       fclose(opt.f_msgs);
 
        
        fprintf(opt.f_stat, "sent=%d\n", count);