aboutsummaryrefslogtreecommitdiff
path: root/test/performance/odp_sched_perf.c
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2021-06-23 15:30:36 +0300
committerPetri Savolainen <petri.savolainen@nokia.com>2021-06-24 10:15:28 +0300
commit78c818549a8bb03026b0dafb03605d606a1e9a84 (patch)
tree46ee714a7665c6470d774a881bf22fec87ead574 /test/performance/odp_sched_perf.c
parentd0def8ae0e184ae5596bc6bcd30b90c83ae49452 (diff)
test: sched_perf: add verbose option
Added -v option which outputs additional debug information. At this point, verbose option adds a scheduler debug print call to the end of the test. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'test/performance/odp_sched_perf.c')
-rw-r--r--test/performance/odp_sched_perf.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c
index 4ec4f4352..a238d7bb3 100644
--- a/test/performance/odp_sched_perf.c
+++ b/test/performance/odp_sched_perf.c
@@ -48,6 +48,7 @@ typedef struct test_options_t {
uint32_t ctx_rd_words;
uint32_t ctx_rw_words;
uint64_t wait_ns;
+ int verbose;
} test_options_t;
@@ -111,6 +112,7 @@ static void print_usage(void)
" -l, --ctx_rw_words Number of queue context words (uint64_t) to modify on every event. Default: 0.\n"
" -n, --rd_words Number of event data words (uint64_t) to read before enqueueing it. Default: 0.\n"
" -m, --rw_words Number of event data words (uint64_t) to modify before enqueueing it. Default: 0.\n"
+ " -v, --verbose Verbose output.\n"
" -h, --help This help\n"
"\n");
}
@@ -137,11 +139,12 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options)
{"ctx_rw_words", required_argument, NULL, 'l'},
{"rd_words", required_argument, NULL, 'n'},
{"rw_words", required_argument, NULL, 'm'},
+ {"verbose", no_argument, NULL, 'v'},
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}
};
- static const char *shortopts = "+c:q:d:e:s:g:j:b:t:f:w:k:l:n:m:h";
+ static const char *shortopts = "+c:q:d:e:s:g:j:b:t:f:w:k:l:n:m:vh";
test_options->num_cpu = 1;
test_options->num_queue = 1;
@@ -158,6 +161,7 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options)
test_options->rd_words = 0;
test_options->rw_words = 0;
test_options->wait_ns = 0;
+ test_options->verbose = 0;
while (1) {
opt = getopt_long(argc, argv, shortopts, longopts, &long_index);
@@ -211,6 +215,9 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options)
case 'w':
test_options->wait_ns = atoll(optarg);
break;
+ case 'v':
+ test_options->verbose = 1;
+ break;
case 'h':
/* fall through */
default:
@@ -903,6 +910,11 @@ static int test_sched(void *arg)
odp_event_t event;
uint64_t sched_wait = odp_schedule_wait_time(200 * ODP_TIME_MSEC_IN_NS);
+ /* Print schedule status at the end of the test, before any queues
+ * are emptied or destroyed. */
+ if (test_options->verbose)
+ odp_schedule_print();
+
while ((event = odp_schedule(NULL, sched_wait)) != ODP_EVENT_INVALID)
odp_event_free(event);
}