Skip to content

Commit

Permalink
schedule: zephyr_domain: include domain block in ll time tracking
Browse files Browse the repository at this point in the history
Include the possible domain block time when measuring the time it takes
to complete one iteration of the low-latency scheduler thread loop. The
ll timer metrics are typically used for initial system debug and it can
be misleading when domain block events are not counted in reported
average/max numbers.

Change the timing code to start measurement immediately after
domain thread semaphore is taken.

Signed-off-by: Kai Vehmanen <[email protected]>
  • Loading branch information
kv2019i committed Jul 4, 2024
1 parent 90c54a6 commit f48574b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/schedule/zephyr_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ static void zephyr_domain_thread_fn(void *p1, void *p2, void *p3)
/* immediately go to sleep, waiting to be woken up by the timer */
k_sem_take(&dt->sem, K_FOREVER);

cycles0 = k_cycle_get_32();

#if CONFIG_CROSS_CORE_STREAM
/*
* If zephyr_domain->block is set -- block LL scheduler from starting its
Expand All @@ -92,7 +94,6 @@ static void zephyr_domain_thread_fn(void *p1, void *p2, void *p3)
}
#endif

cycles0 = k_cycle_get_32();
dt->handler(dt->arg);
cycles1 = k_cycle_get_32();

Expand Down

0 comments on commit f48574b

Please sign in to comment.