]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: debug: use ltid_bit in ha_thread_dump()
authorWilly Tarreau <w@1wt.eu>
Mon, 27 Jun 2022 14:13:50 +0000 (16:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 Jul 2022 17:15:14 +0000 (19:15 +0200)
Since commit cc7a11ee3 ("MINOR: threads: set the tid, ltid and their bit
in thread_cfg") we ought not use (1UL << thr) to get the group mask for
thread <thr>, but (ha_thread_info[thr].ltid_bit). ha_thread_dump() needs
this.

src/debug.c

index 2ee10387d9bca414efb9f3b92d5f09d2488301ed..50d239e15404793a71ac39b68d4ce95c9b309257 100644 (file)
@@ -158,7 +158,7 @@ void ha_backtrace_to_stderr(void)
  */
 void ha_thread_dump(struct buffer *buf, int thr, int calling_tid)
 {
-       unsigned long thr_bit = 1UL << thr;
+       unsigned long thr_bit = ha_thread_info[thr].ltid_bit;
        unsigned long long p = ha_thread_ctx[thr].prev_cpu_time;
        unsigned long long n = now_cpu_time_thread(thr);
        int stuck = !!(ha_thread_ctx[thr].flags & TH_FL_STUCK);