aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2022-11-23 13:17:44 +0200
committerPetri Savolainen <petri.savolainen@nokia.com>2022-11-28 17:10:24 +0200
commit9aa3931849e1a2ca6cb29a5c5b1025acd30c4b1e (patch)
tree8a1c000b0e2c0c1373d94ff7cf2ffe2758e9362b /test
parent50051bfda7d6a77b4c62b022d946220b9a2a8830 (diff)
test: sched_latency: reorganize schedule loop
Moved barrier closer to worker main loop start. So, that all workers are ready to process events simultaneously. Remove unused source queue handle update from schedule call. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'test')
-rw-r--r--test/performance/odp_sched_latency.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/performance/odp_sched_latency.c b/test/performance/odp_sched_latency.c
index 131f8b4ca..70eaec78f 100644
--- a/test/performance/odp_sched_latency.c
+++ b/test/performance/odp_sched_latency.c
@@ -401,7 +401,6 @@ static int test_schedule(int thr, test_globals_t *globals)
odp_time_t time;
odp_event_t ev;
odp_buffer_t buf;
- odp_queue_t src_queue;
odp_queue_t dst_queue;
uint64_t latency;
uint64_t i;
@@ -417,8 +416,10 @@ static int test_schedule(int thr, test_globals_t *globals)
change_queue = globals->args.forward_mode != EVENT_FORWARD_NONE ? 1 : 0;
+ odp_barrier_wait(&globals->barrier);
+
for (i = 0; i < test_rounds; i++) {
- ev = odp_schedule(&src_queue, ODP_SCHED_WAIT);
+ ev = odp_schedule(NULL, ODP_SCHED_WAIT);
buf = odp_buffer_from_event(ev);
event = odp_buffer_addr(buf);
@@ -475,6 +476,8 @@ static int test_schedule(int thr, test_globals_t *globals)
odp_schedule_pause();
while (1) {
+ odp_queue_t src_queue;
+
ev = odp_schedule(&src_queue, ODP_SCHED_NO_WAIT);
if (ev == ODP_EVENT_INVALID)
@@ -546,8 +549,6 @@ static int run_thread(void *arg ODP_UNUSED)
return -1;
}
- odp_barrier_wait(&globals->barrier);
-
if (test_schedule(thr, globals))
return -1;