Commit b1f2788a authored by Joanne Hugé's avatar Joanne Hugé

Update packet-histogram scripts

Add metadata information to a file in packet-histogram-stop
and import it when adding the measure
parent e821008a
...@@ -4,14 +4,14 @@ usage() { ...@@ -4,14 +4,14 @@ usage() {
echo "Usage: $0 OPTIONS -c OUTPUT CLIENT_BOARD SERVER_BOARD" 1>&2; echo "Usage: $0 OPTIONS -c OUTPUT CLIENT_BOARD SERVER_BOARD" 1>&2;
echo " $0 OPTIONS -s OUTPUT [-t] (-p | (-e DELTA -o ETF_OFFSET)) CLIENT_BOARD SERVER_BOARD" 1>&2; echo " $0 OPTIONS -s OUTPUT [-t] (-p | (-e DELTA -o ETF_OFFSET)) CLIENT_BOARD SERVER_BOARD" 1>&2;
echo " $0 OPTIONS -C OUTPUT [-l]" 1>&2; echo " $0 OPTIONS -C OUTPUT [-l]" 1>&2;
echo "OPTIONS: [-h] [-i INTERVAL]" 1>&2; echo "OPTIONS: [-h] [-i INTERVAL] -k KERNEL_VERSION" 1>&2;
exit 1; exit 1;
} }
script_dir=$(dirname $(realpath $0)) script_dir=$(dirname $(realpath $0))
interval=1000 interval=1000
while getopts "hb:i:c:s:tjpe:o:C:l" opt; do while getopts "hb:i:c:s:tjpe:o:C:lk:" opt; do
case "${opt}" in case "${opt}" in
h ) h )
usage usage
...@@ -50,6 +50,9 @@ while getopts "hb:i:c:s:tjpe:o:C:l" opt; do ...@@ -50,6 +50,9 @@ while getopts "hb:i:c:s:tjpe:o:C:l" opt; do
l ) l )
stop_load=1 stop_load=1
;; ;;
k )
kernel_version=${OPTARG}
;;
* ) * )
usage usage
;; ;;
...@@ -86,8 +89,15 @@ if [ -n "$client_histogram" ]; then ...@@ -86,8 +89,15 @@ if [ -n "$client_histogram" ]; then
scp $client_board:$output $script_dir/; scp $client_board:$output $script_dir/;
cd $script_dir/../measure-analysis; cd $script_dir/../measure-analysis;
./measure-analysis.py -i $script_dir/$output;
cat > client_metadata << EndOfMessage
{"ker": "$kernel_version"}
EndOfMessage
./measure-analysis.py -i $script_dir/$output -I client_metadata;
./measure-analysis.py -R; ./measure-analysis.py -R;
rm client_metadata;
rm $script_dir/$output;
elif [ -n "$server_histogram" ]; then elif [ -n "$server_histogram" ]; then
...@@ -97,8 +107,32 @@ elif [ -n "$server_histogram" ]; then ...@@ -97,8 +107,32 @@ elif [ -n "$server_histogram" ]; then
scp $server_board:$output $script_dir/; scp $server_board:$output $script_dir/;
cd $script_dir/../measure-analysis; cd $script_dir/../measure-analysis;
./measure-analysis.py -i $script_dir/$output;
if [ -n "$server_etf" ]; then
cat > server_metadata << EndOfMessage
{
"ker": "$kernel_version",
"qdisc": "etf",
"etf_offset": "${etf_offset}us",
"delta": "${etf_delta}us"
}
EndOfMessage
else
cat > server_metadata << EndOfMessage
{
"ker": "$kernel_version"
}
EndOfMessage
fi
./measure-analysis.py -i $script_dir/$output -I server_metadata;
./measure-analysis.py -R; ./measure-analysis.py -R;
rm server_metadata;
rm $script_dir/$output;
elif [ -n "$cyclictest_histogram" ]; then elif [ -n "$cyclictest_histogram" ]; then
...@@ -112,6 +146,30 @@ elif [ -n "$cyclictest_histogram" ]; then ...@@ -112,6 +146,30 @@ elif [ -n "$cyclictest_histogram" ]; then
scp $board:$output $script_dir/; scp $board:$output $script_dir/;
cd $script_dir/../measure-analysis; cd $script_dir/../measure-analysis;
./measure-analysis.py -i $script_dir/$output -c;
if [ -n "$stop_load" ]; then
cat > cyclictest_metadata << EndOfMessage
{
"ker": "$kernel_version",
"load": "hackbench",
"i": "${interval}us"
}
EndOfMessage
else
cat > cyclictest_metadata << EndOfMessage
{
"ker": "$kernel_version",
"i": "${interval}us"
}
EndOfMessage
fi
./measure-analysis.py -i $script_dir/$output -c -I cyclictest_metadata;
./measure-analysis.py -R; ./measure-analysis.py -R;
rm cyclictest_metadata;
rm $script_dir/$output;
fi fi
...@@ -4,7 +4,7 @@ usage() { ...@@ -4,7 +4,7 @@ usage() {
echo "Usage: $0 OPTIONS -c CLIENT_BOARD SERVER_BOARD" 1>&2; echo "Usage: $0 OPTIONS -c CLIENT_BOARD SERVER_BOARD" 1>&2;
echo " $0 OPTIONS -s [-t] (-p | (-e DELTA -o ETF_OFFSET)) CLIENT_BOARD SERVER_BOARD" 1>&2; echo " $0 OPTIONS -s [-t] (-p | (-e DELTA -o ETF_OFFSET)) CLIENT_BOARD SERVER_BOARD" 1>&2;
echo " $0 OPTIONS -C [-l] BOARD" 1>&2; echo " $0 OPTIONS -C [-l] BOARD" 1>&2;
echo "OPTIONS: [-h] [-i INTERVAL]" 1>&2; echo "OPTIONS: [-h] [-i INTERVAL] [-k KERNEL_VERSION]" 1>&2;
exit 1; exit 1;
} }
...@@ -13,8 +13,9 @@ interval=1000 ...@@ -13,8 +13,9 @@ interval=1000
server_opts="" server_opts=""
cyclictest_opts="" cyclictest_opts=""
etf_offset=600 etf_offset=600
kernel_version="5.6-dirty"
while getopts "hi:csCtpe:o:l" opt; do while getopts "hi:csCtpe:o:lk:" opt; do
case "${opt}" in case "${opt}" in
h ) h )
usage usage
...@@ -47,6 +48,9 @@ while getopts "hi:csCtpe:o:l" opt; do ...@@ -47,6 +48,9 @@ while getopts "hi:csCtpe:o:l" opt; do
l ) l )
cyclictest_opts+=" -l" cyclictest_opts+=" -l"
;; ;;
k )
kernel_version=${OPTARG}
;;
* ) * )
usage usage
;; ;;
...@@ -55,6 +59,8 @@ done ...@@ -55,6 +59,8 @@ done
shift $((OPTIND-1)) shift $((OPTIND-1))
stop_opts="-i $interval -k $kernel_version"
if [ -n "$client_histogram" ] || [ -n "$server_histogram" ]; then if [ -n "$client_histogram" ] || [ -n "$server_histogram" ]; then
if [ $# -ne 2 ]; then if [ $# -ne 2 ]; then
echo "Wrong number of arguments"; echo "Wrong number of arguments";
...@@ -81,7 +87,7 @@ if [ -n "$client_histogram" ]; then ...@@ -81,7 +87,7 @@ if [ -n "$client_histogram" ]; then
$script_dir/exec-ssh-nohup $server_board "run-server"; $script_dir/exec-ssh-nohup $server_board "run-server";
$script_dir/exec-ssh-nohup $client_board "run-client -p -i $interval -t -g $server_board"; $script_dir/exec-ssh-nohup $client_board "run-client -p -i $interval -t -g $server_board";
echo "-c client_i${interval}_pfast -i $interval $client_board $server_board" > $script_dir/packet-histogram-stop_options; echo "$stop_opts -c client_i${interval}_pfast -i $interval $client_board $server_board" > $script_dir/packet-histogram-stop_options;
# Server histogram # Server histogram
elif [ -n "$server_histogram" ]; then elif [ -n "$server_histogram" ]; then
...@@ -91,7 +97,7 @@ elif [ -n "$server_histogram" ]; then ...@@ -91,7 +97,7 @@ elif [ -n "$server_histogram" ]; then
$script_dir/exec-ssh-nohup $server_board "run-server -g ${interval}$server_opts"; $script_dir/exec-ssh-nohup $server_board "run-server -g ${interval}$server_opts";
$script_dir/exec-ssh-nohup $client_board "run-client -p -i $interval $server_board"; $script_dir/exec-ssh-nohup $client_board "run-client -p -i $interval $server_board";
echo "-i $interval -s server_i${interval} $server_opts -p $client_board $server_board" > $script_dir/packet-histogram-stop_options; echo "$stop_opts -s server_i${interval} $server_opts -p $client_board $server_board" > $script_dir/packet-histogram-stop_options;
# Server ETF qdisc histogram # Server ETF qdisc histogram
elif [ -n "$server_etf" ]; then elif [ -n "$server_etf" ]; then
...@@ -99,7 +105,7 @@ elif [ -n "$server_histogram" ]; then ...@@ -99,7 +105,7 @@ elif [ -n "$server_histogram" ]; then
$script_dir/exec-ssh-nohup $server_board "run-server -g ${interval}$server_opts"; $script_dir/exec-ssh-nohup $server_board "run-server -g ${interval}$server_opts";
$script_dir/exec-ssh-nohup $client_board "run-client -e $etf_delta -o $etf_offset -i $interval $server_board"; $script_dir/exec-ssh-nohup $client_board "run-client -e $etf_delta -o $etf_offset -i $interval $server_board";
echo "-i $interval -s server_i${interval} $server_opts -e $etf_delta -o $etf_offset $client_board $server_board" > $script_dir/packet-histogram-stop_options; echo "$stop_opts -s server_i${interval} $server_opts -e $etf_delta -o $etf_offset $client_board $server_board" > $script_dir/packet-histogram-stop_options;
else else
echo "Server histogram requires choosing between pfifo_fast or etf qdisc"; echo "Server histogram requires choosing between pfifo_fast or etf qdisc";
...@@ -110,6 +116,6 @@ elif [ -n "$cyclictest_histogram" ]; then ...@@ -110,6 +116,6 @@ elif [ -n "$cyclictest_histogram" ]; then
$script_dir/exec-ssh-nohup $board "run-cyclictest -g $cyclictest_opts -i $interval"; $script_dir/exec-ssh-nohup $board "run-cyclictest -g $cyclictest_opts -i $interval";
echo "-i $interval -C cyclictest_hist $cyclictest_opts $board" > $script_dir/packet-histogram-stop_options; echo "$stop_opts -C cyclictest_hist $cyclictest_opts $board" > $script_dir/packet-histogram-stop_options;
fi fi
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