MINOR: debug: remove the redundant process.thread_info array from post_mortem
authorWilly Tarreau <w@1wt.eu>
Mon, 28 Oct 2024 06:47:23 +0000 (07:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Nov 2024 18:04:38 +0000 (19:04 +0100)
That one is huge and unneeded since we now have the pointer to the
whole thread_info[] array, which does contain the freshest version
of these info and many more. Let's just get rid of it entirely.

(cherry picked from commit 52240680f1d98cc7eb1e762a04becaf54660e96b)
[wt: adjusted ctx in feed_post_mortem_late()]
Signed-off-by: Willy Tarreau <w@1wt.eu>

src/debug.c

index 108754a..2086abf 100644 (file)
@@ -118,13 +118,6 @@ struct post_mortem {
                struct rlimit limit_fd;  // RLIMIT_NOFILE
                struct rlimit limit_ram; // RLIMIT_DATA
                char **argv;
-
-#if defined(USE_THREAD)
-               struct {
-                       ullong pth_id;   // pthread_t cast to a ullong
-                       void *stack_top; // top of the stack
-               } thread_info[MAX_THREADS];
-#endif
                unsigned char argc;
        } process;
 
@@ -2441,13 +2434,9 @@ static int feed_post_mortem_late()
 {
        static int per_thread_info_collected;
 
-       if (HA_ATOMIC_ADD_FETCH(&per_thread_info_collected, 1) == global.nbthread) {
-               int i;
-               for (i = 0; i < global.nbthread; i++) {
-                       post_mortem.process.thread_info[i].pth_id = ha_thread_info[i].pth_id;
-                       post_mortem.process.thread_info[i].stack_top = ha_thread_info[i].stack_top;
-               }
-       }
+       if (HA_ATOMIC_ADD_FETCH(&per_thread_info_collected, 1) != global.nbthread)
+               return 1;
+
        return 1;
 }