mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 07:31:54 +00:00
Remove spinlock debug structures in production build
This commit is contained in:
parent
5b7fd453d4
commit
7d455d64ca
@ -107,6 +107,7 @@ typedef struct {
|
|||||||
u64 _Atomic spin;
|
u64 _Atomic spin;
|
||||||
} rw_spinlock;
|
} rw_spinlock;
|
||||||
|
|
||||||
|
#ifdef DEBUGGING
|
||||||
#define MAX_RWS_AT_ONCE 32
|
#define MAX_RWS_AT_ONCE 32
|
||||||
extern _Thread_local rw_spinlock *rw_spinlocks_taken[MAX_RWS_AT_ONCE];
|
extern _Thread_local rw_spinlock *rw_spinlocks_taken[MAX_RWS_AT_ONCE];
|
||||||
extern _Thread_local btime rw_spinlocks_time[MAX_RWS_AT_ONCE];
|
extern _Thread_local btime rw_spinlocks_time[MAX_RWS_AT_ONCE];
|
||||||
@ -116,7 +117,6 @@ extern _Thread_local u32 rw_spinlocks_taken_write;
|
|||||||
/* Borrowed from lib/timer.h */
|
/* Borrowed from lib/timer.h */
|
||||||
btime current_time_now(void);
|
btime current_time_now(void);
|
||||||
|
|
||||||
#ifdef DEBUGGING
|
|
||||||
static inline void rws_mark(rw_spinlock *p, _Bool write, _Bool lock)
|
static inline void rws_mark(rw_spinlock *p, _Bool write, _Bool lock)
|
||||||
{
|
{
|
||||||
if (lock) {
|
if (lock) {
|
||||||
|
@ -35,10 +35,12 @@
|
|||||||
* Locking subsystem
|
* Locking subsystem
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef DEBUGGING
|
||||||
_Thread_local rw_spinlock *rw_spinlocks_taken[MAX_RWS_AT_ONCE];
|
_Thread_local rw_spinlock *rw_spinlocks_taken[MAX_RWS_AT_ONCE];
|
||||||
_Thread_local btime rw_spinlocks_time[MAX_RWS_AT_ONCE];
|
_Thread_local btime rw_spinlocks_time[MAX_RWS_AT_ONCE];
|
||||||
_Thread_local u32 rw_spinlocks_taken_cnt;
|
_Thread_local u32 rw_spinlocks_taken_cnt;
|
||||||
_Thread_local u32 rw_spinlocks_taken_write;
|
_Thread_local u32 rw_spinlocks_taken_write;
|
||||||
|
#endif
|
||||||
|
|
||||||
_Thread_local struct lock_order locking_stack = {};
|
_Thread_local struct lock_order locking_stack = {};
|
||||||
_Thread_local struct domain_generic **last_locked = NULL;
|
_Thread_local struct domain_generic **last_locked = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user