Skip to content

Commit

Permalink
add passthru CLI argument (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
HughNhan authored May 9, 2024
1 parent d954df7 commit db7c991
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
5 changes: 5 additions & 0 deletions multiplex.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"args": [ "ifname" ],
"vals": "^.+$"
},
"passthru": {
"description": "comma separated list",
"args": [ "passthru" ],
"vals": "^.+$"
},
"cpu-pinning": {
"description": "valid cpu pinning modes",
"args": [ "cpu-pin" ],
Expand Down
15 changes: 14 additions & 1 deletion uperf-client
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test_type="stream"
uopts=""
cpu_pin=""

longopts="test-type:,protocol:,rsize:,wsize:,nthreads:,remotehost:,duration:,cpu-pin:,think:"
longopts="test-type:,protocol:,rsize:,wsize:,nthreads:,remotehost:,duration:,cpu-pin:,think:,passthru:"
opts=$(getopt -q -o "" --longoptions "$longopts" -n "getopt.sh" -- "$@");
if [ $? -ne 0 ]; then
exit_error "Unrecognized option specified"
Expand Down Expand Up @@ -87,6 +87,12 @@ while true; do
echo "duration=$duration"
shift
;;
--passthru) # uperf options that user wants passthru
shift;
pt_opts=$1
echo "pt_opts=$pt_opts"
shift
;;
--)
shift;
break
Expand Down Expand Up @@ -209,6 +215,13 @@ case "${cpu_pin}" in
esac

cmd+="${cpu_pin_cmd} uperf -R -m test.xml -P $control_port $uopts"

# strip ',' from the passthru options
passthru_opts=$(echo "$pt_opts" | sed 's/,/ /g')
options+=" $passthru_opts"
echo "passthu options: $options"
cmd+="$options"

echo "going to run: ${cmd}"
nthreads=$nthreads \
protocol=$protocol \
Expand Down
16 changes: 15 additions & 1 deletion uperf-server-start
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ data_port=""
ifname=""
cpu_pin=""

longopts="ifname:,cpu-pin:"
longopts="ifname:,cpu-pin:,passthru:"
opts=$(getopt -q -o "" --longoptions "$longopts" -n "getopt.sh" -- "$@");
if [ $? -ne 0 ]; then
exit_error "Unrecognized option specified"
Expand All @@ -38,6 +38,12 @@ while true; do
shift;
shift;
;;
--passthru) # uperf options that user wants passthru
shift;
pt_opts=$1
echo "pt_opts=$pt_opts"
shift
;;
--)
shift;
break
Expand Down Expand Up @@ -166,6 +172,14 @@ case "${cpu_pin}" in
esac

cmd="${cpu_pin_cmd} uperf -s -P $control_port"

# strip ',' from the passthru options
passthru_opts=$(echo "$pt_opts" | sed 's/,/ /g')
options+=" $passthru_opts"
echo "passthu optins run: $options"

cmd+="$options"

echo "going to run: $cmd"
export MALLOC_CHECK_=2
$cmd 2>&1 >uperf-server-start.txt &
Expand Down

0 comments on commit db7c991

Please sign in to comment.