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] ...@@ -30,7 +30,7 @@ Usage: $0 [-h] [-I if] [SERVER] | TCPDUMP [TRACE_OPTS]
Default: 1ms Default: 1ms
TRACE_OPTS: -T LATENCY_THRESHOLD [-P TRACER -E XDP_EVENTS] TRACE_OPTS: -T LATENCY_THRESHOLD [-P TRACER -E XDP_EVENTS]
Trace until latency threshold is met 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... -P TRACER Which trace to use when tracing: function, function_graph, wakeup etc...
Default: function Default: function
-E EVENTS Specify which events to trace (e.g: "-E "-e net -e irq") -E EVENTS Specify which events to trace (e.g: "-E "-e net -e irq")
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
usage() { usage() {
cat << ENDUSAGE 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 -h Show help
-i USEC Specify which interval to use in client -i USEC Specify which interval to use in client
-c USEC Specify which offset to use for the timestamp in the packet -c USEC Specify which offset to use for the timestamp in the packet
-s Use software timestampings -s Use software timestampings
-T Enable tracing on the boards
BOARD_HOSTNAME Uses /etc/hosts to find the IP address associated to the hostname BOARD_HOSTNAME Uses /etc/hosts to find the IP address associated to the hostname
ENDUSAGE ENDUSAGE
1>&2; 1>&2;
...@@ -15,9 +16,13 @@ ENDUSAGE ...@@ -15,9 +16,13 @@ ENDUSAGE
} }
interval=4000000 interval=4000000
server_opts=""
while getopts "c:i:o:rs" opt; do while getopts "hc:i:o:rsT" opt; do
case "${opt}" in case "${opt}" in
h )
usage
;;
i ) i )
interval=${OPTARG} interval=${OPTARG}
;; ;;
...@@ -27,6 +32,9 @@ while getopts "c:i:o:rs" opt; do ...@@ -27,6 +32,9 @@ while getopts "c:i:o:rs" opt; do
s ) s )
software_ts=1 software_ts=1
;; ;;
T )
enable_tracing=1
;;
* ) * )
usage usage
;; ;;
...@@ -42,8 +50,6 @@ fi ...@@ -42,8 +50,6 @@ fi
board1=$1 board1=$1
board2=$2 board2=$2
exit
# Setup irqs # Setup irqs
ksoftirq1_pid=$(ps -eL -o pid,cmd | grep "ksoftirqd/1" | awk '{ print $1 }' | head -n1) ksoftirq1_pid=$(ps -eL -o pid,cmd | grep "ksoftirqd/1" | awk '{ print $1 }' | head -n1)
...@@ -95,8 +101,12 @@ echo "Start servers on slave"; ...@@ -95,8 +101,12 @@ echo "Start servers on slave";
./sudossh $board1 "killall server"; ./sudossh $board1 "killall server";
./sudossh $board2 "killall server"; ./sudossh $board2 "killall server";
./exec-ssh-nohup $board1 "run-server -c"; if [ -n "$enable_tracing" ]; then
./exec-ssh-nohup $board2 "run-server -c"; 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; cd ../gettime/build;
make; 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