Profile low condition events.

Add the sleep events point for x86 and ARM arquitectures that gives
information about when the CPU went to sleep mode, when it woke up
and which interrupt causes the CPU to awake.

Change-Id: Iaa06a678eab661357d084ee1f79c4cfcf19bf85d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
This commit is contained in:
Yonattan Louise 2015-08-21 19:15:26 -05:00 committed by Anas Nashif
commit 5c6ef8fdb5
9 changed files with 64 additions and 0 deletions

View file

@ -134,6 +134,12 @@ SECTION_FUNC(TEXT, _NanoIdleValClear)
*/
SECTION_FUNC(TEXT, nano_cpu_idle)
#ifdef CONFIG_PROFILER_SLEEP
push {lr}
bl _sys_profiler_enter_sleep
pop {lr}
#endif
/* clear BASEPRI so wfi is awakened by incoming interrupts */
eors.n r0, r0
msr BASEPRI, r0
@ -169,6 +175,11 @@ SECTION_FUNC(TEXT, nano_cpu_idle)
*/
SECTION_FUNC(TEXT, nano_cpu_atomic_idle)
#ifdef CONFIG_PROFILER_SLEEP
push {lr}
bl _sys_profiler_enter_sleep
pop {lr}
#endif
/*
* r0: interrupt mask from caller