]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEBUG: threads: display held locks in threads dumps
authorWilly Tarreau <w@1wt.eu>
Tue, 6 May 2025 03:11:56 +0000 (05:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 6 May 2025 03:20:37 +0000 (05:20 +0200)
commit3bb6eea6d56d0328437ed34ac97d4479051ee2c9
tree0e829800ccb431b1c80a2ffea7e49aad05503183
parentfeaac66b5e2dda4ffc0ab97ac3f3ecacf8aa86c2
DEBUG: threads: display held locks in threads dumps

Based on the lock history, we can spot some locks that are still held
by checking the last operation that happened on them: if it's not an
unlock, then we know the lock is held. In this case we append the list
after "locked:" with their label and state like below:

  U:QUEUE S:IDLE_CONNS U:IDLE_CONNS R:TASK_WQ U:TASK_WQ S:QUEUE S:QUEUE S:QUEUE locked: QUEUE(S)
  S:IDLE_CONNS U:IDLE_CONNS S:TASK_RQ U:TASK_RQ S:QUEUE U:QUEUE S:IDLE_CONNS locked: IDLE_CONNS(S)
  R:TASK_WQ S:TASK_WQ R:TASK_WQ S:TASK_WQ R:TASK_WQ S:TASK_WQ R:TASK_WQ locked: TASK_WQ(R)
  W:STK_TABLE W:STK_TABLE_UPDT U:STK_TABLE_UPDT W:STK_TABLE W:STK_TABLE_UPDT U:STK_TABLE_UPDT W:STK_TABLE W:STK_TABLE_UPDT locked: STK_TABLE(W) STK_TABLE_UPDT(W)

The format is slightly different (label(status)) so as to easily
differentiate them visually from the history.
src/debug.c