0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Remove spinlock debug structures in production build

This commit is contained in:
Maria Matejka 2024-06-25 15:48:11 +02:00
parent 5b7fd453d4
commit 7d455d64ca
2 changed files with 3 additions and 1 deletions

View File

@ -107,6 +107,7 @@ typedef struct {
u64 _Atomic spin;
} rw_spinlock;
#ifdef DEBUGGING
#define MAX_RWS_AT_ONCE 32
extern _Thread_local rw_spinlock *rw_spinlocks_taken[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 */
btime current_time_now(void);
#ifdef DEBUGGING
static inline void rws_mark(rw_spinlock *p, _Bool write, _Bool lock)
{
if (lock) {

View File

@ -35,10 +35,12 @@
* Locking subsystem
*/
#ifdef DEBUGGING
_Thread_local rw_spinlock *rw_spinlocks_taken[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_write;
#endif
_Thread_local struct lock_order locking_stack = {};
_Thread_local struct domain_generic **last_locked = NULL;