arch/arm64: Add hook for CONFIG_SCHED_THREAD_USAGE accounting in ISRs

Call into z_thread_usage_stop() before ISR entry to avoid including
interrupt handling totals in thread usage stats.

This is pretty much exactly where we want it, just after the context
saving steps (which we can't elide since the hook is in C) and
immediately before the tracing hook for ISR entry.  And as I'm reading
the code, this is purely for Zephyr-registered interrupts, meaning
that software exceptions will be accounted for (correctly) as part of
the excepting thread.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2021-10-28 12:58:02 -07:00 committed by Anas Nashif
parent 410f911018
commit 35af02fe3d

View File

@ -35,6 +35,10 @@ SECTION_FUNC(TEXT, _isr_wrapper)
/* ++(_kernel->nested) to be checked by arch_is_in_isr() */
inc_nest_counter x0, x1
#ifdef CONFIG_SCHED_THREAD_USAGE
bl z_sched_usage_stop
#endif
#ifdef CONFIG_TRACING
bl sys_trace_isr_enter
#endif