]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEBUG: threads: don't keep lock label "OTHER" in the per-thread history
authorWilly Tarreau <w@1wt.eu>
Mon, 5 May 2025 16:10:57 +0000 (18:10 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 5 May 2025 16:10:57 +0000 (18:10 +0200)
Most threads are filled with "R:OTHER U:OTHER" in their history. Since
anything non-important can use other it's not observable but it pollutes
the history. Let's just drop OTHER entirely during the recording.

include/haproxy/thread.h

index 92bf6a647e8cc4b873a68b503e86b0feeea615ac..d5c27cf9bfbf3122c653fcdeda41784f252f14f8 100644 (file)
@@ -338,11 +338,12 @@ static inline unsigned long thread_isolated()
 
 #define _lock_wait(_LK_, lbl, expr) do {                               \
                (void)(expr);                                           \
-               th_ctx->lock_history = (th_ctx->lock_history << 8) + ((lbl + 1) << 2) + _LK_; \
+               if (lbl != OTHER_LOCK)                                  \
+                       th_ctx->lock_history = (th_ctx->lock_history << 8) + ((lbl + 1) << 2) + _LK_; \
        } while (0)
 #define _lock_cond(_LK_, lbl, expr) ({                                 \
                typeof(expr) _expr = (expr);                            \
-               if (!_expr)                                             \
+               if (lbl != OTHER_LOCK && !_expr)                        \
                        th_ctx->lock_history = (th_ctx->lock_history << 8) + ((lbl + 1) << 2) + _LK_; \
                _expr; \
        })