summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/percpu.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-07 14:36:22 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-14 08:46:49 +0100
commit53ad908a646eb6fd67f9b4586f4b484e8255b9d3 (patch)
tree7dd408879d01a507e6052f375ec6e14ab3f8965d /cpukit/score/include/rtems/score/percpu.h
parentscore: Add per-CPU profiling (diff)
downloadrtems-53ad908a646eb6fd67f9b4586f4b484e8255b9d3.tar.bz2
score: Add SMP lock profiling support
Diffstat (limited to 'cpukit/score/include/rtems/score/percpu.h')
-rw-r--r--cpukit/score/include/rtems/score/percpu.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h
index 5ba463e812..d9b73029fc 100644
--- a/cpukit/score/include/rtems/score/percpu.h
+++ b/cpukit/score/include/rtems/score/percpu.h
@@ -40,7 +40,11 @@ extern "C" {
* used in assembler code to easily get the per-CPU control for a particular
* processor.
*/
- #define PER_CPU_CONTROL_SIZE_LOG2 7
+ #if defined( RTEMS_PROFILING )
+ #define PER_CPU_CONTROL_SIZE_LOG2 8
+ #else
+ #define PER_CPU_CONTROL_SIZE_LOG2 7
+ #endif
#define PER_CPU_CONTROL_SIZE ( 1 << PER_CPU_CONTROL_SIZE_LOG2 )
#endif
@@ -287,6 +291,11 @@ typedef struct {
SMP_ticket_lock_Control Lock;
/**
+ * @brief Lock statistics context for the per-CPU lock.
+ */
+ SMP_lock_Stats_context Lock_stats_context;
+
+ /**
* @brief Context for the Giant lock acquire and release pair of this
* processor.
*/
@@ -333,7 +342,10 @@ extern Per_CPU_Control_envelope _Per_CPU_Information[] CPU_STRUCTURE_ALIGNMENT;
#if defined( RTEMS_SMP )
#define _Per_CPU_Acquire( per_cpu ) \
- _SMP_ticket_lock_Acquire( &( per_cpu )->Lock )
+ _SMP_ticket_lock_Acquire( \
+ &( per_cpu )->Lock, \
+ &( per_cpu )->Lock_stats_context \
+ )
#else
#define _Per_CPU_Acquire( per_cpu ) \
do { \
@@ -343,7 +355,10 @@ extern Per_CPU_Control_envelope _Per_CPU_Information[] CPU_STRUCTURE_ALIGNMENT;
#if defined( RTEMS_SMP )
#define _Per_CPU_Release( per_cpu ) \
- _SMP_ticket_lock_Release( &( per_cpu )->Lock )
+ _SMP_ticket_lock_Release( \
+ &( per_cpu )->Lock, \
+ &( per_cpu )->Lock_stats_context \
+ )
#else
#define _Per_CPU_Release( per_cpu ) \
do { \