]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Remove spinlock debug structures in production build
authorMaria Matejka <mq@ucw.cz>
Tue, 25 Jun 2024 13:48:11 +0000 (15:48 +0200)
committerMaria Matejka <mq@ucw.cz>
Wed, 26 Jun 2024 09:30:41 +0000 (11:30 +0200)
lib/locking.h
sysdep/unix/domain.c

index 71277827b31069e169234ebdd678caf9b33193f6..30450535facd8e4609b3095f1d67841a953ca026 100644 (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) {
index 4e6d8a61c31733b0382c69af667767beafe763b9..7dace7e124666f30580e4e0ee20618882c29d0a6 100644 (file)
  *     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;