Commit 99dcbff7 authored by Joanne Hugé's avatar Joanne Hugé

Add kill-test-board-synchro script, add tracing option, remove exit placed during debug

parent aa3d0fb0
#!/bin/bash
usage() {
cat << ENDUSAGE
Usage: $0 [-h] BOARD1_HOSTNAME BOARD2_HOSTNAME
Kills all processes started by test-board-synchro (ptp4l, client, server)
-h Show help
ENDUSAGE
1>&2;
exit 1;
}
while getopts "hc:i:o:rsT" opt; do
case "${opt}" in
h )
usage
;;
* )
usage
;;
esac
done
shift $((OPTIND-1))
board1=$1
board2=$2
killall ptp4l;
killall phc2sys;
killall client;
killall run-client;
./sudossh $board1 "killall ptp4l";
./sudossh $board1 "killall server";
./sudossh $board2 "killall ptp4l";
./sudossh $board2 "killall server";
......@@ -30,7 +30,7 @@ Usage: $0 [-h] [-I if] [SERVER] | TCPDUMP [TRACE_OPTS]
Default: 1ms
TRACE_OPTS: -T LATENCY_THRESHOLD [-P TRACER -E XDP_EVENTS]
Trace until latency threshold is met
-T THRESHOLD Enable tracing until threshold is met
-T USEC Enable tracing until threshold is met
-P TRACER Which trace to use when tracing: function, function_graph, wakeup etc...
Default: function
-E EVENTS Specify which events to trace (e.g: "-E "-e net -e irq")
......
......@@ -2,11 +2,12 @@
usage() {
cat << ENDUSAGE
Usage: $0 [-i USEC -c USEC -s] BOARD1_HOSTNAME BOARD2_HOSTNAME
Usage: $0 [-h] [-i USEC -c USEC -s] [-T] BOARD1_HOSTNAME BOARD2_HOSTNAME
-h Show help
-i USEC Specify which interval to use in client
-c USEC Specify which offset to use for the timestamp in the packet
-s Use software timestampings
-T Enable tracing on the boards
BOARD_HOSTNAME Uses /etc/hosts to find the IP address associated to the hostname
ENDUSAGE
1>&2;
......@@ -15,9 +16,13 @@ ENDUSAGE
}
interval=4000000
server_opts=""
while getopts "c:i:o:rs" opt; do
while getopts "hc:i:o:rsT" opt; do
case "${opt}" in
h )
usage
;;
i )
interval=${OPTARG}
;;
......@@ -27,6 +32,9 @@ while getopts "c:i:o:rs" opt; do
s )
software_ts=1
;;
T )
enable_tracing=1
;;
* )
usage
;;
......@@ -42,8 +50,6 @@ fi
board1=$1
board2=$2
exit
# Setup irqs
ksoftirq1_pid=$(ps -eL -o pid,cmd | grep "ksoftirqd/1" | awk '{ print $1 }' | head -n1)
......@@ -95,8 +101,12 @@ echo "Start servers on slave";
./sudossh $board1 "killall server";
./sudossh $board2 "killall server";
./exec-ssh-nohup $board1 "run-server -c";
./exec-ssh-nohup $board2 "run-server -c";
if [ -n "$enable_tracing" ]; then
server_opts+=" -T $((interval*2)) -B 100000"
fi
./exec-ssh-nohup $board1 "run-server -c $server_opts";
./exec-ssh-nohup $board2 "run-server -c $server_opts";
cd ../gettime/build;
make;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment