Message ID | 1453328719-7322-1-git-send-email-bill.fischofer@linaro.org |
---|---|
State | Superseded |
Headers | show |
On 21.01.16 00:25, Bill Fischofer wrote: > Expand the existing scheduler chaos test to provide timing information for > mixed queues as well as individual timings for parallel, atomic, and > ordered queues. This enables implementation scheduling efficiency to be > displayed by queue type. > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> > --- > test/validation/scheduler/scheduler.c | 41 +++++++++++++++++++++++++++++++---- > test/validation/scheduler/scheduler.h | 3 +++ > 2 files changed, 40 insertions(+), 4 deletions(-) > > diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c > index 7ba6a06..ea246d4 100644 > --- a/test/validation/scheduler/scheduler.c > +++ b/test/validation/scheduler/scheduler.c > @@ -41,7 +41,7 @@ > > #define CHAOS_NUM_QUEUES 6 > #define CHAOS_NUM_BUFS_PER_QUEUE 6 > -#define CHAOS_NUM_ROUNDS 50000 > +#define CHAOS_NUM_ROUNDS 1000 > #define CHAOS_NUM_EVENTS (CHAOS_NUM_QUEUES * CHAOS_NUM_BUFS_PER_QUEUE) > #define CHAOS_DEBUG (CHAOS_NUM_ROUNDS < 1000) > #define CHAOS_PTR_TO_NDX(p) ((uint64_t)(uint32_t)(uintptr_t)p) > @@ -451,12 +451,14 @@ static void *chaos_thread(void *arg) > thread_args_t *args = (thread_args_t *)arg; > test_globals_t *globals = args->globals; > int me = odp_thread_id(); > + odp_time_t start_time, end_time, diff; > > if (CHAOS_DEBUG) > printf("Chaos thread %d starting...\n", me); > > /* Wait for all threads to start */ > odp_barrier_wait(&globals->barrier); > + start_time = odp_time_local(); > > /* Run the test */ > wait = odp_schedule_wait_time(CHAOS_WAIT_FAIL); > @@ -508,10 +510,16 @@ static void *chaos_thread(void *arg) > odp_event_free(ev); > } > > + end_time = odp_time_local(); > + diff = odp_time_diff(end_time, start_time); > + > + printf("Thread %d ends, elapsed time = %" PRIu64 "us\n", > + odp_thread_id(), odp_time_to_ns(diff) / 1000); > + > return NULL; > } > > -void scheduler_test_chaos(void) > +static void chaos_run(unsigned int qtype) > { > odp_pool_t pool; > odp_pool_param_t params; > @@ -557,11 +565,13 @@ void scheduler_test_chaos(void) > qp.sched.prio = ODP_SCHED_PRIO_DEFAULT; > > for (i = 0; i < CHAOS_NUM_QUEUES; i++) { > - qp.sched.sync = sync[i % num_sync]; > + uint32_t ndx = qtype == num_sync ? i % num_sync : qtype; > + qp.sched.sync = sync[ndx]; > snprintf(globals->chaos_q[i].name, > sizeof(globals->chaos_q[i].name), > "chaos queue %d - %s", i, > - qtypes[i % num_sync]); > + qtypes[ndx]); > + > globals->chaos_q[i].handle = > odp_queue_create(globals->chaos_q[i].name, > ODP_QUEUE_TYPE_SCHED, > @@ -630,6 +640,26 @@ void scheduler_test_chaos(void) > CU_ASSERT(rc == 0); > } > > +void scheduler_test_parallel(void) > +{ > + chaos_run(0); > +} > + > +void scheduler_test_atomic(void) > +{ > + chaos_run(1); > +} > + > +void scheduler_test_ordered(void) > +{ > + chaos_run(2); > +} > + > +void scheduler_test_chaos(void) > +{ > + chaos_run(3); > +} > + > static void *schedule_common_(void *arg) > { > thread_args_t *args = (thread_args_t *)arg; > @@ -1520,6 +1550,9 @@ odp_testinfo_t scheduler_suite[] = { > ODP_TEST_INFO(scheduler_test_num_prio), > ODP_TEST_INFO(scheduler_test_queue_destroy), > ODP_TEST_INFO(scheduler_test_groups), > + ODP_TEST_INFO(scheduler_test_parallel), > + ODP_TEST_INFO(scheduler_test_atomic), > + ODP_TEST_INFO(scheduler_test_ordered), > ODP_TEST_INFO(scheduler_test_chaos), > ODP_TEST_INFO(scheduler_test_1q_1t_n), > ODP_TEST_INFO(scheduler_test_1q_1t_a), > diff --git a/test/validation/scheduler/scheduler.h b/test/validation/scheduler/scheduler.h > index bba79aa..cd69e92 100644 > --- a/test/validation/scheduler/scheduler.h > +++ b/test/validation/scheduler/scheduler.h > @@ -15,6 +15,9 @@ void scheduler_test_num_prio(void); > void scheduler_test_queue_destroy(void); > void scheduler_test_groups(void); > void scheduler_test_chaos(void); > +void scheduler_test_parallel(void); > +void scheduler_test_atomic(void); > +void scheduler_test_ordered(void); > void scheduler_test_1q_1t_n(void); > void scheduler_test_1q_1t_a(void); > void scheduler_test_1q_1t_o(void); >
WARNING: Missing a blank line after declarations #72: FILE: test/validation/scheduler/scheduler.c:569: + uint32_t ndx = qtype == num_sync ? i % num_sync : qtype; + qp.sched.sync = sync[ndx]; On 01/21/2016 01:28, Ivan Khoronzhuk wrote: > > > On 21.01.16 00:25, Bill Fischofer wrote: >> Expand the existing scheduler chaos test to provide timing >> information for >> mixed queues as well as individual timings for parallel, atomic, and >> ordered queues. This enables implementation scheduling efficiency to be >> displayed by queue type. >> >> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> > > Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> > >> --- >> test/validation/scheduler/scheduler.c | 41 >> +++++++++++++++++++++++++++++++---- >> test/validation/scheduler/scheduler.h | 3 +++ >> 2 files changed, 40 insertions(+), 4 deletions(-) >> >> diff --git a/test/validation/scheduler/scheduler.c >> b/test/validation/scheduler/scheduler.c >> index 7ba6a06..ea246d4 100644 >> --- a/test/validation/scheduler/scheduler.c >> +++ b/test/validation/scheduler/scheduler.c >> @@ -41,7 +41,7 @@ >> >> #define CHAOS_NUM_QUEUES 6 >> #define CHAOS_NUM_BUFS_PER_QUEUE 6 >> -#define CHAOS_NUM_ROUNDS 50000 >> +#define CHAOS_NUM_ROUNDS 1000 >> #define CHAOS_NUM_EVENTS (CHAOS_NUM_QUEUES * CHAOS_NUM_BUFS_PER_QUEUE) >> #define CHAOS_DEBUG (CHAOS_NUM_ROUNDS < 1000) >> #define CHAOS_PTR_TO_NDX(p) ((uint64_t)(uint32_t)(uintptr_t)p) >> @@ -451,12 +451,14 @@ static void *chaos_thread(void *arg) >> thread_args_t *args = (thread_args_t *)arg; >> test_globals_t *globals = args->globals; >> int me = odp_thread_id(); >> + odp_time_t start_time, end_time, diff; >> >> if (CHAOS_DEBUG) >> printf("Chaos thread %d starting...\n", me); >> >> /* Wait for all threads to start */ >> odp_barrier_wait(&globals->barrier); >> + start_time = odp_time_local(); >> >> /* Run the test */ >> wait = odp_schedule_wait_time(CHAOS_WAIT_FAIL); >> @@ -508,10 +510,16 @@ static void *chaos_thread(void *arg) >> odp_event_free(ev); >> } >> >> + end_time = odp_time_local(); >> + diff = odp_time_diff(end_time, start_time); >> + >> + printf("Thread %d ends, elapsed time = %" PRIu64 "us\n", >> + odp_thread_id(), odp_time_to_ns(diff) / 1000); >> + >> return NULL; >> } >> >> -void scheduler_test_chaos(void) >> +static void chaos_run(unsigned int qtype) >> { >> odp_pool_t pool; >> odp_pool_param_t params; >> @@ -557,11 +565,13 @@ void scheduler_test_chaos(void) >> qp.sched.prio = ODP_SCHED_PRIO_DEFAULT; >> >> for (i = 0; i < CHAOS_NUM_QUEUES; i++) { >> - qp.sched.sync = sync[i % num_sync]; >> + uint32_t ndx = qtype == num_sync ? i % num_sync : qtype; >> + qp.sched.sync = sync[ndx]; >> snprintf(globals->chaos_q[i].name, >> sizeof(globals->chaos_q[i].name), >> "chaos queue %d - %s", i, >> - qtypes[i % num_sync]); >> + qtypes[ndx]); >> + >> globals->chaos_q[i].handle = >> odp_queue_create(globals->chaos_q[i].name, >> ODP_QUEUE_TYPE_SCHED, >> @@ -630,6 +640,26 @@ void scheduler_test_chaos(void) >> CU_ASSERT(rc == 0); >> } >> >> +void scheduler_test_parallel(void) >> +{ >> + chaos_run(0); >> +} >> + >> +void scheduler_test_atomic(void) >> +{ >> + chaos_run(1); >> +} >> + >> +void scheduler_test_ordered(void) >> +{ >> + chaos_run(2); >> +} >> + >> +void scheduler_test_chaos(void) >> +{ >> + chaos_run(3); >> +} >> + >> static void *schedule_common_(void *arg) >> { >> thread_args_t *args = (thread_args_t *)arg; >> @@ -1520,6 +1550,9 @@ odp_testinfo_t scheduler_suite[] = { >> ODP_TEST_INFO(scheduler_test_num_prio), >> ODP_TEST_INFO(scheduler_test_queue_destroy), >> ODP_TEST_INFO(scheduler_test_groups), >> + ODP_TEST_INFO(scheduler_test_parallel), >> + ODP_TEST_INFO(scheduler_test_atomic), >> + ODP_TEST_INFO(scheduler_test_ordered), >> ODP_TEST_INFO(scheduler_test_chaos), >> ODP_TEST_INFO(scheduler_test_1q_1t_n), >> ODP_TEST_INFO(scheduler_test_1q_1t_a), >> diff --git a/test/validation/scheduler/scheduler.h >> b/test/validation/scheduler/scheduler.h >> index bba79aa..cd69e92 100644 >> --- a/test/validation/scheduler/scheduler.h >> +++ b/test/validation/scheduler/scheduler.h >> @@ -15,6 +15,9 @@ void scheduler_test_num_prio(void); >> void scheduler_test_queue_destroy(void); >> void scheduler_test_groups(void); >> void scheduler_test_chaos(void); >> +void scheduler_test_parallel(void); >> +void scheduler_test_atomic(void); >> +void scheduler_test_ordered(void); >> void scheduler_test_1q_1t_n(void); >> void scheduler_test_1q_1t_a(void); >> void scheduler_test_1q_1t_o(void); >> >
v4 submitted to add the extra line to remove that warning. Thanks. On Fri, Jan 22, 2016 at 8:10 AM, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > WARNING: Missing a blank line after declarations > #72: FILE: test/validation/scheduler/scheduler.c:569: > + uint32_t ndx = qtype == num_sync ? i % num_sync : qtype; > + qp.sched.sync = sync[ndx]; > > On 01/21/2016 01:28, Ivan Khoronzhuk wrote: > >> >> >> On 21.01.16 00:25, Bill Fischofer wrote: >> >>> Expand the existing scheduler chaos test to provide timing information >>> for >>> mixed queues as well as individual timings for parallel, atomic, and >>> ordered queues. This enables implementation scheduling efficiency to be >>> displayed by queue type. >>> >>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> >>> >> >> Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> >> >> --- >>> test/validation/scheduler/scheduler.c | 41 >>> +++++++++++++++++++++++++++++++---- >>> test/validation/scheduler/scheduler.h | 3 +++ >>> 2 files changed, 40 insertions(+), 4 deletions(-) >>> >>> diff --git a/test/validation/scheduler/scheduler.c >>> b/test/validation/scheduler/scheduler.c >>> index 7ba6a06..ea246d4 100644 >>> --- a/test/validation/scheduler/scheduler.c >>> +++ b/test/validation/scheduler/scheduler.c >>> @@ -41,7 +41,7 @@ >>> >>> #define CHAOS_NUM_QUEUES 6 >>> #define CHAOS_NUM_BUFS_PER_QUEUE 6 >>> -#define CHAOS_NUM_ROUNDS 50000 >>> +#define CHAOS_NUM_ROUNDS 1000 >>> #define CHAOS_NUM_EVENTS (CHAOS_NUM_QUEUES * CHAOS_NUM_BUFS_PER_QUEUE) >>> #define CHAOS_DEBUG (CHAOS_NUM_ROUNDS < 1000) >>> #define CHAOS_PTR_TO_NDX(p) ((uint64_t)(uint32_t)(uintptr_t)p) >>> @@ -451,12 +451,14 @@ static void *chaos_thread(void *arg) >>> thread_args_t *args = (thread_args_t *)arg; >>> test_globals_t *globals = args->globals; >>> int me = odp_thread_id(); >>> + odp_time_t start_time, end_time, diff; >>> >>> if (CHAOS_DEBUG) >>> printf("Chaos thread %d starting...\n", me); >>> >>> /* Wait for all threads to start */ >>> odp_barrier_wait(&globals->barrier); >>> + start_time = odp_time_local(); >>> >>> /* Run the test */ >>> wait = odp_schedule_wait_time(CHAOS_WAIT_FAIL); >>> @@ -508,10 +510,16 @@ static void *chaos_thread(void *arg) >>> odp_event_free(ev); >>> } >>> >>> + end_time = odp_time_local(); >>> + diff = odp_time_diff(end_time, start_time); >>> + >>> + printf("Thread %d ends, elapsed time = %" PRIu64 "us\n", >>> + odp_thread_id(), odp_time_to_ns(diff) / 1000); >>> + >>> return NULL; >>> } >>> >>> -void scheduler_test_chaos(void) >>> +static void chaos_run(unsigned int qtype) >>> { >>> odp_pool_t pool; >>> odp_pool_param_t params; >>> @@ -557,11 +565,13 @@ void scheduler_test_chaos(void) >>> qp.sched.prio = ODP_SCHED_PRIO_DEFAULT; >>> >>> for (i = 0; i < CHAOS_NUM_QUEUES; i++) { >>> - qp.sched.sync = sync[i % num_sync]; >>> + uint32_t ndx = qtype == num_sync ? i % num_sync : qtype; >>> + qp.sched.sync = sync[ndx]; >>> snprintf(globals->chaos_q[i].name, >>> sizeof(globals->chaos_q[i].name), >>> "chaos queue %d - %s", i, >>> - qtypes[i % num_sync]); >>> + qtypes[ndx]); >>> + >>> globals->chaos_q[i].handle = >>> odp_queue_create(globals->chaos_q[i].name, >>> ODP_QUEUE_TYPE_SCHED, >>> @@ -630,6 +640,26 @@ void scheduler_test_chaos(void) >>> CU_ASSERT(rc == 0); >>> } >>> >>> +void scheduler_test_parallel(void) >>> +{ >>> + chaos_run(0); >>> +} >>> + >>> +void scheduler_test_atomic(void) >>> +{ >>> + chaos_run(1); >>> +} >>> + >>> +void scheduler_test_ordered(void) >>> +{ >>> + chaos_run(2); >>> +} >>> + >>> +void scheduler_test_chaos(void) >>> +{ >>> + chaos_run(3); >>> +} >>> + >>> static void *schedule_common_(void *arg) >>> { >>> thread_args_t *args = (thread_args_t *)arg; >>> @@ -1520,6 +1550,9 @@ odp_testinfo_t scheduler_suite[] = { >>> ODP_TEST_INFO(scheduler_test_num_prio), >>> ODP_TEST_INFO(scheduler_test_queue_destroy), >>> ODP_TEST_INFO(scheduler_test_groups), >>> + ODP_TEST_INFO(scheduler_test_parallel), >>> + ODP_TEST_INFO(scheduler_test_atomic), >>> + ODP_TEST_INFO(scheduler_test_ordered), >>> ODP_TEST_INFO(scheduler_test_chaos), >>> ODP_TEST_INFO(scheduler_test_1q_1t_n), >>> ODP_TEST_INFO(scheduler_test_1q_1t_a), >>> diff --git a/test/validation/scheduler/scheduler.h >>> b/test/validation/scheduler/scheduler.h >>> index bba79aa..cd69e92 100644 >>> --- a/test/validation/scheduler/scheduler.h >>> +++ b/test/validation/scheduler/scheduler.h >>> @@ -15,6 +15,9 @@ void scheduler_test_num_prio(void); >>> void scheduler_test_queue_destroy(void); >>> void scheduler_test_groups(void); >>> void scheduler_test_chaos(void); >>> +void scheduler_test_parallel(void); >>> +void scheduler_test_atomic(void); >>> +void scheduler_test_ordered(void); >>> void scheduler_test_1q_1t_n(void); >>> void scheduler_test_1q_1t_a(void); >>> void scheduler_test_1q_1t_o(void); >>> >>> >> > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp >
diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index 7ba6a06..ea246d4 100644 --- a/test/validation/scheduler/scheduler.c +++ b/test/validation/scheduler/scheduler.c @@ -41,7 +41,7 @@ #define CHAOS_NUM_QUEUES 6 #define CHAOS_NUM_BUFS_PER_QUEUE 6 -#define CHAOS_NUM_ROUNDS 50000 +#define CHAOS_NUM_ROUNDS 1000 #define CHAOS_NUM_EVENTS (CHAOS_NUM_QUEUES * CHAOS_NUM_BUFS_PER_QUEUE) #define CHAOS_DEBUG (CHAOS_NUM_ROUNDS < 1000) #define CHAOS_PTR_TO_NDX(p) ((uint64_t)(uint32_t)(uintptr_t)p) @@ -451,12 +451,14 @@ static void *chaos_thread(void *arg) thread_args_t *args = (thread_args_t *)arg; test_globals_t *globals = args->globals; int me = odp_thread_id(); + odp_time_t start_time, end_time, diff; if (CHAOS_DEBUG) printf("Chaos thread %d starting...\n", me); /* Wait for all threads to start */ odp_barrier_wait(&globals->barrier); + start_time = odp_time_local(); /* Run the test */ wait = odp_schedule_wait_time(CHAOS_WAIT_FAIL); @@ -508,10 +510,16 @@ static void *chaos_thread(void *arg) odp_event_free(ev); } + end_time = odp_time_local(); + diff = odp_time_diff(end_time, start_time); + + printf("Thread %d ends, elapsed time = %" PRIu64 "us\n", + odp_thread_id(), odp_time_to_ns(diff) / 1000); + return NULL; } -void scheduler_test_chaos(void) +static void chaos_run(unsigned int qtype) { odp_pool_t pool; odp_pool_param_t params; @@ -557,11 +565,13 @@ void scheduler_test_chaos(void) qp.sched.prio = ODP_SCHED_PRIO_DEFAULT; for (i = 0; i < CHAOS_NUM_QUEUES; i++) { - qp.sched.sync = sync[i % num_sync]; + uint32_t ndx = qtype == num_sync ? i % num_sync : qtype; + qp.sched.sync = sync[ndx]; snprintf(globals->chaos_q[i].name, sizeof(globals->chaos_q[i].name), "chaos queue %d - %s", i, - qtypes[i % num_sync]); + qtypes[ndx]); + globals->chaos_q[i].handle = odp_queue_create(globals->chaos_q[i].name, ODP_QUEUE_TYPE_SCHED, @@ -630,6 +640,26 @@ void scheduler_test_chaos(void) CU_ASSERT(rc == 0); } +void scheduler_test_parallel(void) +{ + chaos_run(0); +} + +void scheduler_test_atomic(void) +{ + chaos_run(1); +} + +void scheduler_test_ordered(void) +{ + chaos_run(2); +} + +void scheduler_test_chaos(void) +{ + chaos_run(3); +} + static void *schedule_common_(void *arg) { thread_args_t *args = (thread_args_t *)arg; @@ -1520,6 +1550,9 @@ odp_testinfo_t scheduler_suite[] = { ODP_TEST_INFO(scheduler_test_num_prio), ODP_TEST_INFO(scheduler_test_queue_destroy), ODP_TEST_INFO(scheduler_test_groups), + ODP_TEST_INFO(scheduler_test_parallel), + ODP_TEST_INFO(scheduler_test_atomic), + ODP_TEST_INFO(scheduler_test_ordered), ODP_TEST_INFO(scheduler_test_chaos), ODP_TEST_INFO(scheduler_test_1q_1t_n), ODP_TEST_INFO(scheduler_test_1q_1t_a), diff --git a/test/validation/scheduler/scheduler.h b/test/validation/scheduler/scheduler.h index bba79aa..cd69e92 100644 --- a/test/validation/scheduler/scheduler.h +++ b/test/validation/scheduler/scheduler.h @@ -15,6 +15,9 @@ void scheduler_test_num_prio(void); void scheduler_test_queue_destroy(void); void scheduler_test_groups(void); void scheduler_test_chaos(void); +void scheduler_test_parallel(void); +void scheduler_test_atomic(void); +void scheduler_test_ordered(void); void scheduler_test_1q_1t_n(void); void scheduler_test_1q_1t_a(void); void scheduler_test_1q_1t_o(void);
Expand the existing scheduler chaos test to provide timing information for mixed queues as well as individual timings for parallel, atomic, and ordered queues. This enables implementation scheduling efficiency to be displayed by queue type. Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- test/validation/scheduler/scheduler.c | 41 +++++++++++++++++++++++++++++++---- test/validation/scheduler/scheduler.h | 3 +++ 2 files changed, 40 insertions(+), 4 deletions(-)