diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-07 14:36:22 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-14 08:46:49 +0100 |
commit | 53ad908a646eb6fd67f9b4586f4b484e8255b9d3 (patch) | |
tree | 7dd408879d01a507e6052f375ec6e14ab3f8965d /cpukit/score/src/profilingsmplock.c | |
parent | score: Add per-CPU profiling (diff) | |
download | rtems-53ad908a646eb6fd67f9b4586f4b484e8255b9d3.tar.bz2 |
score: Add SMP lock profiling support
Diffstat (limited to 'cpukit/score/src/profilingsmplock.c')
-rw-r--r-- | cpukit/score/src/profilingsmplock.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/cpukit/score/src/profilingsmplock.c b/cpukit/score/src/profilingsmplock.c new file mode 100644 index 0000000000..4ab761b3d0 --- /dev/null +++ b/cpukit/score/src/profilingsmplock.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2014 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Dornierstr. 4 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include <rtems/score/smplock.h> + +#if defined( RTEMS_PROFILING ) +SMP_lock_Stats_control _SMP_lock_Stats_control = { + .Lock = { + .ticket_lock = { + .next_ticket = ATOMIC_INITIALIZER_UINT( 0U ), + .now_serving = ATOMIC_INITIALIZER_UINT( 0U ), + .Stats = { + .Node = CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN( + &_SMP_lock_Stats_control.Stats_chain + ), + .name = "SMP lock stats" + } + } + }, + .Stats_chain = CHAIN_INITIALIZER_ONE_NODE( + &_SMP_lock_Stats_control.Lock.ticket_lock.Stats.Node + ), + .Iterator_chain = CHAIN_INITIALIZER_EMPTY( + _SMP_lock_Stats_control.Iterator_chain + ) +}; +#endif /* defined( RTEMS_PROFILING ) */ |