|
1 | 1 | #!/bin/bash |
| 2 | +# -*- mode: shell-script; indent-tabs-mode: t; sh-basic-offset: 8; sh-indentation: 8; sh-indent-for-case-alt: + -*- |
2 | 3 |
|
3 | 4 | # This is a script to run the uperf benchmark |
4 | 5 | # Author: Andrew Theurer |
@@ -142,51 +143,51 @@ function install_uperf { |
142 | 143 | # Process options and arguments |
143 | 144 | opts=$(getopt -q -o i:c:t:r:m:p:M:S:C: --longoptions "server-node:,server-nodes:,client-node:,client-nodes:,client-label:,server-label:,tool-label-pattern:,install,start-iteration-num:,config:,instances:,test-types:,runtime:,message-sizes:,protocols:,samples:,client:,clients:,servers:,server:,max-stddev:,max-failures:,kvm-host:,log-response-times:,postprocess-only:,run-dir:,tool-group:" -n "getopt.sh" -- "$@") |
144 | 145 | if [ $? -ne 0 ]; then |
145 | | - printf -- "$*\n" |
146 | | - printf "\n" |
147 | | - printf "\t${benchmark}: you specified an invalid option\n\n" |
148 | | - printf "\tThe following options are available:\n\n" |
149 | | - printf -- "\t--kvm-host=str\n" |
150 | | - printf -- "\t--tool-group=str\n" |
151 | | - printf -- "\t-c str --config=str name of the test config (e.g. jumbo_frames_and_network_throughput)\n" |
152 | | - printf -- "\t-t str[,str] --test-types=str[,str] can be stream, maerts, bidirec, and/or rr (default $test_types)\n" |
153 | | - printf -- "\t-r int --runtime=int test measurement period in seconds (default is $runtime)\n" |
154 | | - printf -- "\t-m int[,int] --message-sizes=str[,str] list of message sizes in bytes (default is $message_sizes)\n" |
155 | | - printf -- "\t-p str[,str] --protocols=str[,str] tcp and/or udp (default is $protocols)\n" |
156 | | - printf -- "\t-i int[,int] --instances=int[,int] list of number of uperf instances to run (default is $instances)\n" |
157 | | - printf -- "\t-C str[,str] --client[s]=str[,str] a list of one or more hostnames/IPs. These systems will run the\n" |
158 | | - printf "\t\t\t\t uperf client (drive the test).\n" |
159 | | - printf "\t\t\t\t If this is omitted, the local system is the client\n" |
160 | | - printf "\t\t\t\t Note: the number of clients and server must be the same!\n" |
161 | | - printf "\t\t\t\t Clients and servers are paired according the order in the list (first\n" |
162 | | - printf "\t\t\t\t client pairs with firest server, etc)\n" |
163 | | - printf -- "\t-S str[,str] --server[s]=str[,str] a list of one or more hostnames/IPs. These systems will run the uperf\n" |
164 | | - printf "\t\t\t\t server (listening for connections)\n" |
165 | | - printf "\t\t\t\t If this is omitted, the server will listen on the local system\n" |
166 | | - printf "\t\t\t\t loopback interface\n" |
167 | | - printf -- "\t--server-node[s]=str[,str] An ordered list of server NUMA nodes which should be used for CPU binding\n" |
168 | | - printf -- "\t--client-node[s]=str[,str] An ordered list of rrclient NUMA nodes which should be used for CPU binding\n" |
169 | | - printf -- "\t\t\t\t For both options above, the order must correspond with the --clients/--servers list\n" |
170 | | - printf -- "\t\t\t\t To omit a specific client/server from binding, use a value of -1\n" |
171 | | - printf -- "\t--samples=int the number of times each different test is run (to compute average &\n" |
172 | | - printf "\t\t\t\t standard deviations)\n" |
173 | | - printf -- "\t--max-failures=int the maximum number of failures to get below stddev\n" |
174 | | - printf -- "\t--max-stddev=int the maximum percent stddev allowed to pass\n" |
175 | | - printf -- "\t--postprocess-only=y|n don't run the benchmark, but postprocess data from previous test\n" |
176 | | - printf -- "\t--run-dir=str optionally specify what directory should be used (usually only used\n" |
177 | | - printf "\t\t\t\t if postprocess-only=y)\n" |
178 | | - printf -- "\t--start-iteration-num=int optionally skip the first (n-1) tests\n" |
179 | | - printf -- "\t--log-response-times=y|n record the response time of every single operation\n" |
180 | | - printf -- "\t--tool-label-pattern=str uperf will provide CPU and efficiency information for any tool directory\n" |
181 | | - printf "\t\t\t\t with a \"^<pattern>\" in the name, provided \"sar\" is one of the\n" |
182 | | - printf "\t\t\t\t registered tools.\n" |
183 | | - printf "\t\t\t\t a default pattern, \"uperf-\" is used if none is provided.\n" |
184 | | - printf "\t\t\t\t simply register your tools with \"--label=uperf-\$X\", and this script\n" |
185 | | - printf "\t\t\t\t will genrate CPU_uperf-\$X and Gbps/CPU_uperf-\$X or\n" |
186 | | - printf "\t\t\t\t trans_sec/CPU-uperf-\$X for all tools which have that pattern as a\n" |
187 | | - printf "\t\t\t\t prefix. if you don't want to register your tools with \"uperf-\" as\n" |
188 | | - printf "\t\t\t\t part of the label, just use --tool-label-pattern= to tell this script\n" |
189 | | - printf "\t\t\t\t the prefix pattern to use for CPU information.\n" |
| 146 | + printf -- "$*\n" |
| 147 | + printf "\n" |
| 148 | + printf "\t${benchmark}: you specified an invalid option\n\n" |
| 149 | + printf "\tThe following options are available:\n\n" |
| 150 | + printf -- "\t--kvm-host=str\n" |
| 151 | + printf -- "\t--tool-group=str\n" |
| 152 | + printf -- "\t-c str --config=str name of the test config (e.g. jumbo_frames_and_network_throughput)\n" |
| 153 | + printf -- "\t-t str[,str] --test-types=str[,str] can be stream, maerts, bidirec, and/or rr (default $test_types)\n" |
| 154 | + printf -- "\t-r int --runtime=int test measurement period in seconds (default is $runtime)\n" |
| 155 | + printf -- "\t-m int[,int] --message-sizes=str[,str] list of message sizes in bytes (default is $message_sizes)\n" |
| 156 | + printf -- "\t-p str[,str] --protocols=str[,str] tcp and/or udp (default is $protocols)\n" |
| 157 | + printf -- "\t-i int[,int] --instances=int[,int] list of number of uperf instances to run (default is $instances)\n" |
| 158 | + printf -- "\t-C str[,str] --client[s]=str[,str] a list of one or more hostnames/IPs. These systems will run the\n" |
| 159 | + printf "\t\t\t\t uperf client (drive the test).\n" |
| 160 | + printf "\t\t\t\t If this is omitted, the local system is the client.\n" |
| 161 | + printf "\t\t\t\t Note: the number of clients and servers must be the same!\n" |
| 162 | + printf "\t\t\t\t Clients and servers are paired according to the order in the list (first\n" |
| 163 | + printf "\t\t\t\t client pairs with first server, etc)\n" |
| 164 | + printf -- "\t-S str[,str] --server[s]=str[,str] a list of one or more hostnames/IPs. These systems will run the uperf\n" |
| 165 | + printf "\t\t\t\t server (listening for connections).\n" |
| 166 | + printf "\t\t\t\t If this is omitted, the server will listen on the local system\n" |
| 167 | + printf "\t\t\t\t loopback interface.\n" |
| 168 | + printf -- "\t--server-node[s]=str[,str] An ordered list of server NUMA nodes which should be used for CPU binding\n" |
| 169 | + printf -- "\t--client-node[s]=str[,str] An ordered list of rrclient NUMA nodes which should be used for CPU binding\n" |
| 170 | + printf -- "\t\t\t\t For both options above, the order must correspond with the --clients/--servers list\n" |
| 171 | + printf -- "\t\t\t\t To omit a specific client/server from binding, use a value of -1.\n" |
| 172 | + printf -- "\t--samples=int the number of times each different test is run (to compute average &\n" |
| 173 | + printf "\t\t\t\t standard deviations).\n" |
| 174 | + printf -- "\t--max-failures=int the maximum number of failures to get below stddev.\n" |
| 175 | + printf -- "\t--max-stddev=int the maximum percent stddev allowed to pass.\n" |
| 176 | + printf -- "\t--postprocess-only=y|n don't run the benchmark, but postprocess data from previous test.\n" |
| 177 | + printf -- "\t--run-dir=str optionally specify what directory should be used (usually only used\n" |
| 178 | + printf "\t\t\t\t if postprocess-only=y).\n" |
| 179 | + printf -- "\t--start-iteration-num=int optionally skip the first (n-1) tests.\n" |
| 180 | + printf -- "\t--log-response-times=y|n record the response time of every single operation.\n" |
| 181 | + printf -- "\t--tool-label-pattern=str uperf will provide CPU and efficiency information for any tool directory\n" |
| 182 | + printf "\t\t\t\t with a \"^<pattern>\" in the name, provided \"sar\" is one of the\n" |
| 183 | + printf "\t\t\t\t registered tools.\n" |
| 184 | + printf "\t\t\t\t a default pattern, \"uperf-\" is used if none is provided.\n" |
| 185 | + printf "\t\t\t\t simply register your tools with \"--label=uperf-\$X\", and this script\n" |
| 186 | + printf "\t\t\t\t will generate CPU_uperf-\$X and Gbps/CPU_uperf-\$X or\n" |
| 187 | + printf "\t\t\t\t trans_sec/CPU-uperf-\$X for all tools which have that pattern as a\n" |
| 188 | + printf "\t\t\t\t prefix. If you don't want to register your tools with \"uperf-\" as\n" |
| 189 | + printf "\t\t\t\t part of the label, just use --tool-label-pattern= to tell this script\n" |
| 190 | + printf "\t\t\t\t the prefix pattern to use for CPU information.\n" |
190 | 191 | exit 1 |
191 | 192 | fi |
192 | 193 | eval set -- "$opts" |
|
0 commit comments