summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-11-26 08:25:36 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-11-26 08:29:33 +0100
commit5fc727fe77a632f9df38161a8474007dab020608 (patch)
treec4df78b97e8a86087d8ed0e265324d160b9ce846 /cpukit/score
parentscore: Introduce <rtems/score/heapinfo.h> (diff)
downloadrtems-5fc727fe77a632f9df38161a8474007dab020608.tar.bz2
score: <rtems/score/smplockstats.h>
Remove <rtems/score/chainimpl.h> include from <rtems/score/smplockstats.h>. Close #3598.
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/src/profilingsmplock.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/cpukit/score/src/profilingsmplock.c b/cpukit/score/src/profilingsmplock.c
index 6d573a71f6..7040fa25ec 100644
--- a/cpukit/score/src/profilingsmplock.c
+++ b/cpukit/score/src/profilingsmplock.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014, 2018 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
@@ -17,6 +17,7 @@
#endif
#include <rtems/score/smplock.h>
+#include <rtems/score/chainimpl.h>
#include <string.h>
@@ -81,14 +82,22 @@ void _SMP_lock_Stats_destroy( SMP_lock_Stats *stats )
}
}
-void _SMP_lock_Stats_register( SMP_lock_Stats *stats )
+void _SMP_lock_Stats_register_or_max_section_time(
+ SMP_lock_Stats *stats,
+ CPU_Counter_ticks max_section_time
+)
{
- SMP_lock_Stats_control *control = &_SMP_lock_Stats_control;
- SMP_lock_Context lock_context;
+ stats->max_section_time = max_section_time;
+
+ if ( _Chain_Is_node_off_chain( &stats->Node ) ) {
+ SMP_lock_Stats_control *control;
+ SMP_lock_Context lock_context;
- _SMP_lock_ISR_disable_and_acquire( &control->Lock, &lock_context );
- _Chain_Append_unprotected( &control->Stats_chain, &stats->Node );
- _SMP_lock_Release_and_ISR_enable( &control->Lock, &lock_context );
+ control = &_SMP_lock_Stats_control;
+ _SMP_lock_ISR_disable_and_acquire( &control->Lock, &lock_context );
+ _Chain_Append_unprotected( &control->Stats_chain, &stats->Node );
+ _SMP_lock_Release_and_ISR_enable( &control->Lock, &lock_context );
+ }
}
void _SMP_lock_Stats_iteration_start(