schedule: zephyr_domain: include domain block in ll time tracking

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 <kai.vehmanen@linux.intel.com>
This commit is contained in:
Kai Vehmanen 2024-05-28 18:21:36 +03:00 committed by Liam Girdwood
parent 17f46a71ee
commit d01320a6cb
1 changed files with 2 additions and 1 deletions

View File

@ -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 */ /* immediately go to sleep, waiting to be woken up by the timer */
k_sem_take(&dt->sem, K_FOREVER); k_sem_take(&dt->sem, K_FOREVER);
cycles0 = k_cycle_get_32();
#if CONFIG_CROSS_CORE_STREAM #if CONFIG_CROSS_CORE_STREAM
/* /*
* If zephyr_domain->block is set -- block LL scheduler from starting its * If zephyr_domain->block is set -- block LL scheduler from starting its
@ -92,7 +94,6 @@ static void zephyr_domain_thread_fn(void *p1, void *p2, void *p3)
} }
#endif #endif
cycles0 = k_cycle_get_32();
dt->handler(dt->arg); dt->handler(dt->arg);
cycles1 = k_cycle_get_32(); cycles1 = k_cycle_get_32();