diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-10 10:04:09 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-14 08:46:49 +0100 |
commit | f980561ee073a7f24f65ed572852fa96edfa1708 (patch) | |
tree | a2e62dd469acbe201388c9b8a3e0ebd9d7277e9f /cpukit/score/include/rtems/score/threaddispatch.h | |
parent | sapi: Add SMP lock profiling app. level data (diff) | |
download | rtems-f980561ee073a7f24f65ed572852fa96edfa1708.tar.bz2 |
score: Add per-CPU profiling
Add per-CPU profiling stats API. Implement the thread dispatch disable
level profiling. The interrupt profiling must be implemented in CPU
port specific parts (mostly assembler code). Add a support function
_Profiling_Outer_most_interrupt_entry_and_exit() for this purpose.
Diffstat (limited to 'cpukit/score/include/rtems/score/threaddispatch.h')
-rw-r--r-- | cpukit/score/include/rtems/score/threaddispatch.h | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/cpukit/score/include/rtems/score/threaddispatch.h b/cpukit/score/include/rtems/score/threaddispatch.h index 5b25212de9..7e616d69f7 100644 --- a/cpukit/score/include/rtems/score/threaddispatch.h +++ b/cpukit/score/include/rtems/score/threaddispatch.h @@ -16,6 +16,7 @@ #include <rtems/score/percpu.h> #include <rtems/score/smplock.h> +#include <rtems/score/profiling.h> #ifdef __cplusplus extern "C" { @@ -140,12 +141,22 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void ) */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { - uint32_t level = _Thread_Dispatch_disable_level; + uint32_t disable_level = _Thread_Dispatch_disable_level; +#if defined( RTEMS_PROFILING ) + ISR_Level level; - ++level; - _Thread_Dispatch_disable_level = level; + _ISR_Disable( level ); + _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); +#endif + + ++disable_level; + _Thread_Dispatch_disable_level = disable_level; + +#if defined( RTEMS_PROFILING ) + _ISR_Enable( level ); +#endif - return level; + return disable_level; } /** @@ -155,12 +166,22 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void ) */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { - uint32_t level = _Thread_Dispatch_disable_level; + uint32_t disable_level = _Thread_Dispatch_disable_level; +#if defined( RTEMS_PROFILING ) + ISR_Level level; - --level; - _Thread_Dispatch_disable_level = level; + _ISR_Disable( level ); +#endif + + --disable_level; + _Thread_Dispatch_disable_level = disable_level; + +#if defined( RTEMS_PROFILING ) + _Profiling_Thread_dispatch_enable( _Per_CPU_Get(), disable_level ); + _ISR_Enable( level ); +#endif - return level; + return disable_level; } #endif /* RTEMS_SMP */ |