]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: Increase the tgid from 8bits to 16bits
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 9 Jan 2026 07:27:10 +0000 (08:27 +0100)
committerOlivier Houchard <ohouchard@haproxy.com>
Mon, 12 Jan 2026 08:39:52 +0000 (09:39 +0100)
Increase the size of the stored tgid in the stat file from 8bits to
32bits, so that we can have more than 256 thread group. 65536 should be
enough for some time.

This bumps thet stat file minor version, as the structure changes.

include/haproxy/stats-file-t.h

index a56cba65fd239c583558cc4f2dfbbd1fba870446..a47ddb02931e1577fc1b2e984890551d79ef3225 100644 (file)
@@ -15,7 +15,7 @@ enum stfile_domain {
 };
 
 #define SHM_STATS_FILE_VER_MAJOR         1
-#define SHM_STATS_FILE_VER_MINOR         1
+#define SHM_STATS_FILE_VER_MINOR         2
 
 #define SHM_STATS_FILE_HEARTBEAT_TIMEOUT 60 /* passed this delay (seconds) process which has not
                                              * sent heartbeat will be considered down
@@ -64,9 +64,9 @@ struct shm_stats_file_hdr {
  */
 struct shm_stats_file_object {
        char guid[GUID_MAX_LEN + 1];
-       uint8_t tgid; // thread group ID from 1 to 64
+       uint16_t tgid; // thread group ID
        uint8_t type; // SHM_STATS_FILE_OBJECT_TYPE_* to know how to handle object.data
-       ALWAYS_PAD(6); // 6 bytes hole, ensure it remains the same size 32 vs 64 bits arch
+       ALWAYS_PAD(5); // 5 bytes hole, ensure it remains the same size 32 vs 64 bits arch
        uint64_t users; // bitfield that corresponds to users of the object (see shm_stats_file_hdr slots)
        /* as the struct may hold any of the types described here, let's make it
         * so it may store up to the heaviest one using an union