[rtems commit] arm: Add support for interrupt profiling
Sebastian Huber
sebh at rtems.org
Fri Mar 14 07:42:47 UTC 2014
Module: rtems
Branch: master
Commit: 148d6e9a15fbb46dc3ab12ab8bdc3b10193d71a0
Changeset: http://git.rtems.org/rtems/commit/?id=148d6e9a15fbb46dc3ab12ab8bdc3b10193d71a0
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Mar 6 15:51:10 2014 +0100
arm: Add support for interrupt profiling
---
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
More information about the vc
mailing list