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
}
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
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
}
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
}
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 \
-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() {
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
}
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
}
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() {
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
}
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
}
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() {
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
}
. 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() {
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
}
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() {
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
}
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
}
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
}
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
}
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
}
unsigned count;
unsigned oneattime;
char *name;
- int histogram;
- int file;
int length;
int userhist;
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)
{ "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
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)
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)
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++;
}
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);