[PATCH 10/11] arm: Add support for interrupt profiling
Sebastian Huber
sebastian.huber at embedded-brains.de
Tue Mar 11 13:46:50 UTC 2014
---
cpukit/score/cpu/arm/arm_exc_interrupt.S | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/cpukit/score/cpu/arm/arm_exc_interrupt.S b/cpukit/score/cpu/arm/arm_exc_interrupt.S
index 697171e..27c43f9 100644
--- a/cpukit/score/cpu/arm/arm_exc_interrupt.S
+++ b/cpukit/score/cpu/arm/arm_exc_interrupt.S
@@ -122,6 +122,14 @@ _ARMV4_Exception_interrupt:
str r2, [SELF_CPU_CONTROL, #PER_CPU_ISR_NEST_LEVEL]
str r3, [SELF_CPU_CONTROL, #PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL]
+#ifdef RTEMS_PROFILING
+ cmp r2, #1
+ bne profiling_entry_done
+ bl _CPU_Counter_read
+ push {r0, r1}
+profiling_entry_done:
+#endif
+
/* Call BSP dependent interrupt dispatcher */
bl bsp_interrupt_dispatch
@@ -133,6 +141,18 @@ _ARMV4_Exception_interrupt:
str r2, [SELF_CPU_CONTROL, #PER_CPU_ISR_NEST_LEVEL]
str r3, [SELF_CPU_CONTROL, #PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL]
+#ifdef RTEMS_PROFILING
+ cmp r2, #0
+ bne profiling_exit_done
+ bl _CPU_Counter_read
+ pop {r1, r3}
+ mov r2, r0
+ mov r0, SELF_CPU_CONTROL
+ bl _Profiling_Outer_most_interrupt_entry_and_exit
+ ldr r3, [SELF_CPU_CONTROL, #PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL]
+profiling_exit_done:
+#endif
+
/* Restore stack pointer */
mov sp, SP_OF_INTERRUPTED_CONTEXT
--
1.7.7
More information about the devel
mailing list