diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2021-06-02 10:59:51 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2021-06-22 15:22:26 +0300 |
commit | f8f8c5250e5a6b58d2f7aa44d41dcf82c88a48a4 (patch) | |
tree | 8f49120410a061f3e44d7fc76004f0fa50263fbc /test/validation/api/scheduler | |
parent | e670d4c4de91800b0e292b64f23595ac839f0e79 (diff) |
validation: sched: test debug print
Add test case for the new odp_schedule_print() function. It's
tested as part of multi-queue test suite, first with empty queues
and then with events in queues.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'test/validation/api/scheduler')
-rw-r--r-- | test/validation/api/scheduler/scheduler.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index 53141e16c..9c84eacd3 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -68,6 +68,7 @@ typedef struct { int buf_count; int buf_count_cpy; int queues_per_prio; + int test_debug_print; odp_shm_t shm_glb; odp_shm_t shm_args; odp_pool_t pool; @@ -1825,6 +1826,9 @@ static void parallel_execute(odp_schedule_sync_t sync, int num_queues, fill_queues(args); + if (globals->test_debug_print) + odp_schedule_print(); + /* Create and launch worker threads */ /* Test runs also on the main thread */ @@ -2994,6 +2998,25 @@ static void scheduler_test_flow_aware(void) CU_ASSERT(odp_pool_destroy(pool) == 0); } +/* Queues created but no events */ +static void scheduler_test_print(void) +{ + odp_schedule_print(); +} + +/* Queues with initial events enqueued */ +static void scheduler_test_mq_mt_prio_a_print(void) +{ + int prio = odp_schedule_num_prio(); + + globals->test_debug_print = 1; + + parallel_execute(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, prio, + SCHD_ONE, DISABLE_EXCL_ATOMIC); + + globals->test_debug_print = 0; +} + static int scheduler_test_global_init(void) { odp_cpumask_t mask; @@ -3217,6 +3240,7 @@ odp_testinfo_t scheduler_basic_suite[] = { /* Scheduler test suite which runs events through hundreds of queues. Queues are created once * in suite init phase. */ odp_testinfo_t scheduler_multi_suite[] = { + ODP_TEST_INFO(scheduler_test_print), ODP_TEST_INFO(scheduler_test_chaos), ODP_TEST_INFO(scheduler_test_1q_1t_n), ODP_TEST_INFO(scheduler_test_1q_1t_a), @@ -3244,6 +3268,7 @@ odp_testinfo_t scheduler_multi_suite[] = { ODP_TEST_INFO(scheduler_test_multi_mq_mt_prio_a), ODP_TEST_INFO(scheduler_test_multi_mq_mt_prio_o), ODP_TEST_INFO(scheduler_test_multi_1q_mt_a_excl), + ODP_TEST_INFO(scheduler_test_mq_mt_prio_a_print), ODP_TEST_INFO_NULL }; |