diff options
author | Christophe Milard <christophe.milard@linaro.org> | 2016-04-14 11:33:25 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-05-23 15:06:58 +0300 |
commit | d4e4c62b8e8b0ae47f2f4174ca5bfecb4426be17 (patch) | |
tree | 65ac265f0c7efd554eb2e78802059bb9df088d1f /test | |
parent | 308148f0d5290a97a0e9e9741d0ce68d60c22111 (diff) |
performance: odp_pktio_perf: adding helper cmd line parsing
odp_pktio_perf now calls the helper command line parsing so that helper
can collect its options. Hence enabling process mode run.
Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
Reviewed-by: Brian Brooks <brian.brooks@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/performance/odp_pktio_perf.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index e1efc4a73..98ec681eb 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -916,7 +916,7 @@ static void parse_args(int argc, char *argv[], test_args_t *args) int opt; int long_index; - static struct option longopts[] = { + static const struct option longopts[] = { {"count", required_argument, NULL, 'c'}, {"txcount", required_argument, NULL, 't'}, {"txbatch", required_argument, NULL, 'b'}, @@ -931,6 +931,11 @@ static void parse_args(int argc, char *argv[], test_args_t *args) {NULL, 0, NULL, 0} }; + static const char *shortopts = "+c:t:b:pR:l:r:i:d:vh"; + + /* let helper collect its own arguments (e.g. --odph_proc) */ + odph_parse_options(argc, argv, shortopts, longopts); + args->cpu_count = 0; /* all CPUs */ args->num_tx_workers = 0; /* defaults to cpu_count+1/2 */ args->tx_batch_len = BATCH_LEN_MAX; @@ -941,8 +946,10 @@ static void parse_args(int argc, char *argv[], test_args_t *args) args->schedule = 1; args->verbose = 0; + opterr = 0; /* do not issue errors on helper options */ + while (1) { - opt = getopt_long(argc, argv, "+c:t:b:pR:l:r:i:d:vh", + opt = getopt_long(argc, argv, shortopts, longopts, &long_index); if (opt == -1) |