From: Maria Matejka Date: Tue, 25 Jun 2024 13:48:11 +0000 (+0200) Subject: Remove spinlock debug structures in production build X-Git-Tag: v3.0.0~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d455d64ca8c4d425469581d694b46ae7a87efb2;p=thirdparty%2Fbird.git Remove spinlock debug structures in production build --- diff --git a/lib/locking.h b/lib/locking.h index 71277827b..30450535f 100644 --- a/lib/locking.h +++ b/lib/locking.h @@ -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) { diff --git a/sysdep/unix/domain.c b/sysdep/unix/domain.c index 4e6d8a61c..7dace7e12 100644 --- a/sysdep/unix/domain.c +++ b/sysdep/unix/domain.c @@ -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;