From: Michal Sojka Date: Thu, 2 Dec 2010 00:17:06 +0000 (+0100) Subject: Merge branch 'master' of rtime.felk.cvut.cz:/can-benchmark X-Git-Tag: fix-allnoconfig~275^2 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/commitdiff_plain/1e49f2400a836005448ef7a2ee29a9268a49098e?hp=1ed5a652b9a7a2379d2eee072eaa38a9db6f005d Merge branch 'master' of rtime.felk.cvut.cz:/can-benchmark --- diff --git a/gw-tests/filter-sff.sh b/gw-tests/filter-sff.sh index f0fe0a8..a32ea02 100755 --- a/gw-tests/filter-sff.sh +++ b/gw-tests/filter-sff.sh @@ -2,7 +2,7 @@ . lib.sh -ids=$(seq 0 256 2047) +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' diff --git a/gw-tests/pc.sh b/gw-tests/pc.sh new file mode 100755 index 0000000..06601fc --- /dev/null +++ b/gw-tests/pc.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +. lib.sh + +main() { + latester -d can0 -d can1 -o -c $COUNT -l 2 -h hist2.dat -f time2.dat + latester -d can0 -d can1 -o -c $COUNT -l 4 -h hist4.dat -f time4.dat + latester -d can0 -d can1 -o -c $COUNT -l 6 -h hist6.dat -f time6.dat + latester -d can0 -d can1 -o -c $COUNT -l 8 -h hist8.dat -f time8.dat +} + +plot_cmds() { + cat <ts_rx_final_kern, &mi->ts_rx_onwire_kern); + if (opt.userhist) + timespec_subtract(&diff, &mi->ts_rx_final_kern, &mi->ts_rx_onwire_kern); + else + timespec_subtract(&diff, &mi->ts_rx_final, &mi->ts_rx_onwire); else - timespec_subtract(&diff, &mi->ts_rx_final_kern, &mi->ts_sent); + if (opt.userhist) + timespec_subtract(&diff, &mi->ts_rx_final, &mi->ts_sent); + else + timespec_subtract(&diff, &mi->ts_rx_final_kern, &mi->ts_sent); return diff.tv_sec * 1000000 + diff.tv_nsec/1000; } @@ -268,7 +275,7 @@ static inline int sock_get_if_index(int s, const char *if_name) static inline get_tstamp(struct timespec *ts) { - clock_gettime(CLOCK_MONOTONIC, ts); + clock_gettime(CLOCK_REALTIME, ts); } int send_frame(int socket) @@ -546,6 +553,7 @@ struct poptOption optionsTable[] = { { "file", 'f', POPT_ARG_STRING, NULL, 'f', "File where to store results", "filename"}, { "histogram", 'h', POPT_ARG_STRING, NULL, 'h', "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 { NULL, 0, 0, NULL, 0 } };