summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-29 14:23:42 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-07-30 08:06:01 +0200
commit10e32a26342573566b83d5bee64970077d679ed5 (patch)
tree37b4520d1ee9c09bc3b682130ed0d0c316caeb4a
parentscore: Provide struct _Thread_queue_Heads (diff)
downloadrtems-10e32a26342573566b83d5bee64970077d679ed5.tar.bz2
score: Add potpourri lock statistics
These SMP lock statistics are used for all lock objects that lack a storage space for the statistics. Examples are lock objects used in external libraries which are independent of the actual RTEMS build configuration.
-rw-r--r--cpukit/score/include/rtems/score/thread.h12
-rw-r--r--cpukit/score/src/threadinitialize.c1
-rw-r--r--cpukit/score/src/threadrestart.c1
3 files changed, 14 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index 157acfa324..ac908e2b82 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -733,6 +733,18 @@ struct _Thread_Control {
Thread_Lock_control Lock;
#endif
+#if defined(RTEMS_SMP) && defined(RTEMS_PROFILING)
+ /**
+ * @brief Potpourri lock statistics.
+ *
+ * These SMP lock statistics are used for all lock objects that lack a
+ * storage space for the statistics. Examples are lock objects used in
+ * external libraries which are independent of the actual RTEMS build
+ * configuration.
+ */
+ SMP_lock_Stats Potpourri_stats;
+#endif
+
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
/** This field is the head of queue of priority inheritance mutex
* held by the thread.
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index 9019e1fd30..7452c932d8 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -205,6 +205,7 @@ bool _Thread_Initialize(
_CPU_Context_Set_is_executing( &the_thread->Registers, false );
the_thread->Lock.current = &the_thread->Lock.Default;
_ISR_lock_Initialize( &the_thread->Lock.Default, "Thread Lock Default");
+ _SMP_lock_Stats_initialize( &the_thread->Potpourri_stats, "Thread Potpourri" );
_Atomic_Init_uint(&the_thread->Lock.generation, 0);
#endif
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index abd809de70..5d80beb78c 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -130,6 +130,7 @@ static void _Thread_Free( Thread_Control *the_thread )
#if defined(RTEMS_SMP)
_ISR_lock_Destroy( &the_thread->Lock.Default );
+ _SMP_lock_Stats_destroy( &the_thread->Potpourri_stats );
#endif
_Objects_Free( &information->Objects, &the_thread->Object );