]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli/activity: show the dumping thread ID starting at 1
authorWilly Tarreau <w@1wt.eu>
Thu, 16 May 2019 14:19:47 +0000 (16:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 16 May 2019 16:02:03 +0000 (18:02 +0200)
Both the config and gdb report thread IDs starting at 1, so better do the
same in "show activity" to limit confusion. We also display the full
permitted range.

This could be backported to 1.9 since it was present there.

src/cli.c

index 3aa5f230bf27772079b10339e3cc0b0f5e8b5bd3..23ab57b7330ea62176648acc1a007a059d370c4e 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1068,7 +1068,7 @@ static int cli_io_handler_show_activity(struct appctx *appctx)
 
        chunk_reset(&trash);
 
-       chunk_appendf(&trash, "thread_id: %u", tid);
+       chunk_appendf(&trash, "thread_id: %u (%u..%u)", tid + 1, 1, global.nbthread);
        chunk_appendf(&trash, "\ndate_now: %lu.%06lu", (long)now.tv_sec, (long)now.tv_usec);
        chunk_appendf(&trash, "\nloops:");        for (thr = 0; thr < global.nbthread; thr++) chunk_appendf(&trash, " %u", activity[thr].loops);
        chunk_appendf(&trash, "\nwake_cache:");   for (thr = 0; thr < global.nbthread; thr++) chunk_appendf(&trash, " %u", activity[thr].wake_cache);