From 58d9621fc8613d06928a46a9b00ebaa5ef86979f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 16 May 2019 16:19:47 +0200 Subject: [PATCH] MINOR: cli/activity: show the dumping thread ID starting at 1 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.c b/src/cli.c index 3aa5f230b..23ab57b73 100644 --- 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);