blob: 3ea5ae4024b926126b2f5aa2e9be82f5400e2eff [file] [log] [blame]
Willy Tarreau4e2b6462019-05-16 17:44:30 +02001/*
2 * Process debugging functions.
3 *
4 * Copyright 2000-2019 Willy Tarreau <willy@haproxy.org>.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
13#include <signal.h>
14#include <time.h>
15#include <stdio.h>
Willy Tarreau6bdf3e92019-05-20 14:25:05 +020016#include <stdlib.h>
Willy Tarreau4e2b6462019-05-16 17:44:30 +020017
Willy Tarreau5cf64dd2019-05-17 10:36:08 +020018#include <common/buf.h>
Willy Tarreau4e2b6462019-05-16 17:44:30 +020019#include <common/config.h>
20#include <common/debug.h>
21#include <common/hathreads.h>
22#include <common/initcall.h>
23#include <common/standard.h>
24
25#include <types/global.h>
26
27#include <proto/cli.h>
28#include <proto/fd.h>
29#include <proto/stream_interface.h>
30#include <proto/task.h>
31
Willy Tarreaua37cb182019-07-31 19:20:39 +020032/* mask of threads still having to dump, used to respect ordering. Only used
33 * when USE_THREAD_DUMP is set.
34 */
35volatile unsigned long threads_to_dump = 0;
36
Willy Tarreau5cf64dd2019-05-17 10:36:08 +020037/* Dumps to the buffer some known information for the desired thread, and
38 * optionally extra info for the current thread. The dump will be appended to
39 * the buffer, so the caller is responsible for preliminary initializing it.
40 * The calling thread ID needs to be passed in <calling_tid> to display a star
Willy Tarreaue6a02fa2019-05-22 07:06:44 +020041 * in front of the calling thread's line (usually it's tid). Any stuck thread
42 * is also prefixed with a '>'.
Willy Tarreau4e2b6462019-05-16 17:44:30 +020043 */
Willy Tarreau5cf64dd2019-05-17 10:36:08 +020044void ha_thread_dump(struct buffer *buf, int thr, int calling_tid)
Willy Tarreau4e2b6462019-05-16 17:44:30 +020045{
46 unsigned long thr_bit = 1UL << thr;
Willy Tarreau9c8800a2019-05-20 20:52:20 +020047 unsigned long long p = thread_info[thr].prev_cpu_time;
48 unsigned long long n = now_cpu_time_thread(&thread_info[thr]);
Willy Tarreaue6a02fa2019-05-22 07:06:44 +020049 int stuck = !!(thread_info[thr].flags & TI_FL_STUCK);
Willy Tarreau4e2b6462019-05-16 17:44:30 +020050
Willy Tarreau5cf64dd2019-05-17 10:36:08 +020051 chunk_appendf(buf,
Willy Tarreaue6a02fa2019-05-22 07:06:44 +020052 "%c%cThread %-2u: act=%d glob=%d wq=%d rq=%d tl=%d tlsz=%d rqsz=%d\n"
Olivier Houchard305d5ab2019-07-24 18:07:06 +020053 " stuck=%d prof=%d",
Willy Tarreaue6a02fa2019-05-22 07:06:44 +020054 (thr == calling_tid) ? '*' : ' ', stuck ? '>' : ' ', thr + 1,
Olivier Houchardcfbb3e62019-05-29 19:22:43 +020055 thread_has_tasks(),
Willy Tarreau4e2b6462019-05-16 17:44:30 +020056 !!(global_tasks_mask & thr_bit),
57 !eb_is_empty(&task_per_thread[thr].timers),
58 !eb_is_empty(&task_per_thread[thr].rqueue),
59 !LIST_ISEMPTY(&task_per_thread[thr].task_list),
60 task_per_thread[thr].task_list_size,
61 task_per_thread[thr].rqueue_size,
Willy Tarreaue6a02fa2019-05-22 07:06:44 +020062 stuck,
Willy Tarreau4e2b6462019-05-16 17:44:30 +020063 !!(task_profiling_mask & thr_bit));
64
Willy Tarreau5cf64dd2019-05-17 10:36:08 +020065 chunk_appendf(buf,
Willy Tarreau4e2b6462019-05-16 17:44:30 +020066 " harmless=%d wantrdv=%d",
67 !!(threads_harmless_mask & thr_bit),
68 !!(threads_want_rdv_mask & thr_bit));
Willy Tarreau4e2b6462019-05-16 17:44:30 +020069
Willy Tarreau5cf64dd2019-05-17 10:36:08 +020070 chunk_appendf(buf, "\n");
Willy Tarreau9c8800a2019-05-20 20:52:20 +020071 chunk_appendf(buf, " cpu_ns: poll=%llu now=%llu diff=%llu\n", p, n, n-p);
Willy Tarreau4e2b6462019-05-16 17:44:30 +020072
73 /* this is the end of what we can dump from outside the thread */
74
75 if (thr != tid)
76 return;
77
Willy Tarreau5cf64dd2019-05-17 10:36:08 +020078 chunk_appendf(buf, " curr_task=");
79 ha_task_dump(buf, curr_task, " ");
Willy Tarreau4e2b6462019-05-16 17:44:30 +020080}
81
82
Willy Tarreau5cf64dd2019-05-17 10:36:08 +020083/* dumps into the buffer some information related to task <task> (which may
Willy Tarreau4e2b6462019-05-16 17:44:30 +020084 * either be a task or a tasklet, and prepend each line except the first one
Willy Tarreau5cf64dd2019-05-17 10:36:08 +020085 * with <pfx>. The buffer is only appended and the first output starts by the
86 * pointer itself. The caller is responsible for making sure the task is not
87 * going to vanish during the dump.
Willy Tarreau4e2b6462019-05-16 17:44:30 +020088 */
Willy Tarreau5cf64dd2019-05-17 10:36:08 +020089void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx)
Willy Tarreau4e2b6462019-05-16 17:44:30 +020090{
Willy Tarreau578ea8b2019-05-22 09:43:09 +020091 const struct stream *s = NULL;
Willy Tarreaua512b022019-08-21 14:12:19 +020092 const struct appctx __maybe_unused *appctx = NULL;
Willy Tarreau578ea8b2019-05-22 09:43:09 +020093
Willy Tarreau14a1ab72019-05-17 10:34:25 +020094 if (!task) {
Willy Tarreau5cf64dd2019-05-17 10:36:08 +020095 chunk_appendf(buf, "0\n");
Willy Tarreau231ec392019-05-17 10:39:47 +020096 return;
97 }
98
Willy Tarreau20db9112019-05-17 14:14:35 +020099 if (TASK_IS_TASKLET(task))
100 chunk_appendf(buf,
101 "%p (tasklet) calls=%u\n",
102 task,
103 task->calls);
104 else
105 chunk_appendf(buf,
106 "%p (task) calls=%u last=%llu%s\n",
107 task,
108 task->calls,
109 task->call_date ? (unsigned long long)(now_mono_time() - task->call_date) : 0,
110 task->call_date ? " ns ago" : "");
Willy Tarreau4e2b6462019-05-16 17:44:30 +0200111
Willy Tarreau5cf64dd2019-05-17 10:36:08 +0200112 chunk_appendf(buf, "%s"
Willy Tarreaua512b022019-08-21 14:12:19 +0200113 " fct=%p (%s) ctx=%p",
Willy Tarreau4e2b6462019-05-16 17:44:30 +0200114 pfx,
Willy Tarreau14a1ab72019-05-17 10:34:25 +0200115 task->process,
116 task->process == process_stream ? "process_stream" :
117 task->process == task_run_applet ? "task_run_applet" :
118 task->process == si_cs_io_cb ? "si_cs_io_cb" :
Willy Tarreau4e2b6462019-05-16 17:44:30 +0200119 "?",
Willy Tarreau14a1ab72019-05-17 10:34:25 +0200120 task->context);
Willy Tarreau578ea8b2019-05-22 09:43:09 +0200121
Willy Tarreaua512b022019-08-21 14:12:19 +0200122 if (task->process == task_run_applet && (appctx = task->context))
123 chunk_appendf(buf, "(%s)\n", appctx->applet->name);
124 else
125 chunk_appendf(buf, "\n");
126
Willy Tarreau578ea8b2019-05-22 09:43:09 +0200127 if (task->process == process_stream && task->context)
128 s = (struct stream *)task->context;
129 else if (task->process == task_run_applet && task->context)
130 s = si_strm(((struct appctx *)task->context)->owner);
131 else if (task->process == si_cs_io_cb && task->context)
132 s = si_strm((struct stream_interface *)task->context);
133
134 if (s)
135 stream_dump(buf, s, pfx, '\n');
Willy Tarreau4e2b6462019-05-16 17:44:30 +0200136}
137
Willy Tarreau4e2b6462019-05-16 17:44:30 +0200138/* This function dumps all profiling settings. It returns 0 if the output
139 * buffer is full and it needs to be called again, otherwise non-zero.
140 */
141static int cli_io_handler_show_threads(struct appctx *appctx)
142{
143 struct stream_interface *si = appctx->owner;
144 int thr;
145
146 if (unlikely(si_ic(si)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
147 return 1;
148
149 if (appctx->st0)
150 thr = appctx->st1;
151 else
152 thr = 0;
153
Willy Tarreau5cf64dd2019-05-17 10:36:08 +0200154 chunk_reset(&trash);
Willy Tarreauc7091d82019-05-17 10:08:49 +0200155 ha_thread_dump_all_to_trash();
Willy Tarreau5cf64dd2019-05-17 10:36:08 +0200156
157 if (ci_putchk(si_ic(si), &trash) == -1) {
158 /* failed, try again */
159 si_rx_room_blk(si);
160 appctx->st1 = thr;
161 return 0;
162 }
Willy Tarreau4e2b6462019-05-16 17:44:30 +0200163 return 1;
164}
165
Willy Tarreau56131ca2019-05-20 13:48:29 +0200166/* dumps a state of all threads into the trash and on fd #2, then aborts. */
167void ha_panic()
168{
169 chunk_reset(&trash);
Willy Tarreaua9f9fc92019-05-20 17:45:35 +0200170 chunk_appendf(&trash, "Thread %u is about to kill the process.\n", tid + 1);
Willy Tarreau56131ca2019-05-20 13:48:29 +0200171 ha_thread_dump_all_to_trash();
Tim Duesterhusdda11552019-06-12 20:47:30 +0200172 shut_your_big_mouth_gcc(write(2, trash.area, trash.data));
Willy Tarreau56131ca2019-05-20 13:48:29 +0200173 for (;;)
174 abort();
175}
176
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200177#if defined(DEBUG_DEV)
178/* parse a "debug dev exit" command. It always returns 1, though it should never return. */
179static int debug_parse_cli_exit(char **args, char *payload, struct appctx *appctx, void *private)
180{
181 int code = atoi(args[3]);
182
183 if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
184 return 1;
185
186 exit(code);
187 return 1;
188}
189
190/* parse a "debug dev close" command. It always returns 1. */
191static int debug_parse_cli_close(char **args, char *payload, struct appctx *appctx, void *private)
192{
193 int fd;
194
195 if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
196 return 1;
197
Willy Tarreau9d008692019-08-09 11:21:01 +0200198 if (!*args[3])
199 return cli_err(appctx, "Missing file descriptor number.\n");
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200200
201 fd = atoi(args[3]);
Willy Tarreau9d008692019-08-09 11:21:01 +0200202 if (fd < 0 || fd >= global.maxsock)
203 return cli_err(appctx, "File descriptor out of range.\n");
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200204
Willy Tarreau9d008692019-08-09 11:21:01 +0200205 if (!fdtab[fd].owner)
206 return cli_msg(appctx, LOG_INFO, "File descriptor was already closed.\n");
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200207
208 fd_delete(fd);
209 return 1;
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200210}
211
212/* parse a "debug dev delay" command. It always returns 1. */
213static int debug_parse_cli_delay(char **args, char *payload, struct appctx *appctx, void *private)
214{
215 int delay = atoi(args[3]);
216
217 if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
218 return 1;
219
220 usleep((long)delay * 1000);
221 return 1;
222}
223
224/* parse a "debug dev log" command. It always returns 1. */
225static int debug_parse_cli_log(char **args, char *payload, struct appctx *appctx, void *private)
226{
227 int arg;
228
229 if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
230 return 1;
231
232 chunk_reset(&trash);
233 for (arg = 3; *args[arg]; arg++) {
234 if (arg > 3)
235 chunk_strcat(&trash, " ");
236 chunk_strcat(&trash, args[arg]);
237 }
238
239 send_log(NULL, LOG_INFO, "%s\n", trash.area);
240 return 1;
241}
242
243/* parse a "debug dev loop" command. It always returns 1. */
244static int debug_parse_cli_loop(char **args, char *payload, struct appctx *appctx, void *private)
245{
246 struct timeval deadline, curr;
247 int loop = atoi(args[3]);
248
249 if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
250 return 1;
251
252 gettimeofday(&curr, NULL);
253 tv_ms_add(&deadline, &curr, loop);
254
255 while (tv_ms_cmp(&curr, &deadline) < 0)
256 gettimeofday(&curr, NULL);
257
258 return 1;
259}
260
261/* parse a "debug dev panic" command. It always returns 1, though it should never return. */
262static int debug_parse_cli_panic(char **args, char *payload, struct appctx *appctx, void *private)
263{
264 if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
265 return 1;
266
267 ha_panic();
268 return 1;
269}
270
271/* parse a "debug dev exec" command. It always returns 1. */
272static int debug_parse_cli_exec(char **args, char *payload, struct appctx *appctx, void *private)
273{
274 FILE *f;
275 int arg;
276
277 if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
278 return 1;
279
280 chunk_reset(&trash);
281 for (arg = 3; *args[arg]; arg++) {
282 if (arg > 3)
283 chunk_strcat(&trash, " ");
284 chunk_strcat(&trash, args[arg]);
285 }
286
287 f = popen(trash.area, "re");
Willy Tarreau9d008692019-08-09 11:21:01 +0200288 if (!f)
289 return cli_err(appctx, "Failed to execute command.\n");
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200290
291 chunk_reset(&trash);
292 while (1) {
293 size_t ret = fread(trash.area + trash.data, 1, trash.size - 20 - trash.data, f);
294 if (!ret)
295 break;
296 trash.data += ret;
297 if (trash.data + 20 == trash.size) {
298 chunk_strcat(&trash, "\n[[[TRUNCATED]]]\n");
299 break;
300 }
301 }
302
303 fclose(f);
304 trash.area[trash.data] = 0;
Willy Tarreau9d008692019-08-09 11:21:01 +0200305 return cli_msg(appctx, LOG_INFO, trash.area);
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200306}
307
308/* parse a "debug dev hex" command. It always returns 1. */
309static int debug_parse_cli_hex(char **args, char *payload, struct appctx *appctx, void *private)
310{
311 unsigned long start, len;
312
313 if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
314 return 1;
315
Willy Tarreau9d008692019-08-09 11:21:01 +0200316 if (!*args[3])
317 return cli_err(appctx, "Missing memory address to dump from.\n");
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200318
319 start = strtoul(args[3], NULL, 0);
Willy Tarreau9d008692019-08-09 11:21:01 +0200320 if (!start)
321 return cli_err(appctx, "Will not dump from NULL address.\n");
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200322
323 /* by default, dump ~128 till next block of 16 */
324 len = strtoul(args[4], NULL, 0);
325 if (!len)
326 len = ((start + 128) & -16) - start;
327
328 chunk_reset(&trash);
Willy Tarreau37101052019-05-20 16:48:20 +0200329 dump_hex(&trash, " ", (const void *)start, len, 1);
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200330 trash.area[trash.data] = 0;
Willy Tarreau9d008692019-08-09 11:21:01 +0200331 return cli_msg(appctx, LOG_INFO, trash.area);
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200332}
333
334/* parse a "debug dev tkill" command. It always returns 1. */
335static int debug_parse_cli_tkill(char **args, char *payload, struct appctx *appctx, void *private)
336{
337 int thr = 0;
338 int sig = SIGABRT;
339
340 if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
341 return 1;
342
343 if (*args[3])
344 thr = atoi(args[3]);
345
Willy Tarreau9d008692019-08-09 11:21:01 +0200346 if (thr < 0 || thr > global.nbthread)
347 return cli_err(appctx, "Thread number out of range (use 0 for current).\n");
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200348
349 if (*args[4])
350 sig = atoi(args[4]);
351
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200352 if (thr)
Willy Tarreaufade80d2019-05-22 08:46:59 +0200353 ha_tkill(thr - 1, sig);
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200354 else
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200355 raise(sig);
356 return 1;
357}
358
359#endif
360
Willy Tarreauc7091d82019-05-17 10:08:49 +0200361#ifndef USE_THREAD_DUMP
362
363/* This function dumps all threads' state to the trash. This version is the
364 * most basic one, which doesn't inspect other threads.
365 */
366void ha_thread_dump_all_to_trash()
367{
368 unsigned int thr;
369
370 for (thr = 0; thr < global.nbthread; thr++)
371 ha_thread_dump(&trash, thr, tid);
372}
373
374#else /* below USE_THREAD_DUMP is set */
375
Willy Tarreauddd85332019-05-22 06:28:54 +0200376/* The signal to trigger a debug dump on a thread is SIGURG. It has the benefit
377 * of not stopping gdb by default, so that issuing "show threads" in a process
378 * being debugged has no adverse effect.
379 */
380#define DEBUGSIG SIGURG
Willy Tarreauc7091d82019-05-17 10:08:49 +0200381
Willy Tarreauc7091d82019-05-17 10:08:49 +0200382/* ID of the thread requesting the dump */
383static unsigned int thread_dump_tid;
384
385/* points to the buffer where the dump functions should write. It must
386 * have already been initialized by the requester. Nothing is done if
387 * it's NULL.
388 */
389struct buffer *thread_dump_buffer = NULL;
390
391void ha_thread_dump_all_to_trash()
392{
Willy Tarreauc7091d82019-05-17 10:08:49 +0200393 unsigned long old;
394
395 while (1) {
396 old = 0;
397 if (HA_ATOMIC_CAS(&threads_to_dump, &old, all_threads_mask))
398 break;
399 ha_thread_relax();
400 }
401
402 thread_dump_buffer = &trash;
403 thread_dump_tid = tid;
Willy Tarreaufade80d2019-05-22 08:46:59 +0200404 ha_tkillall(DEBUGSIG);
Willy Tarreauc7091d82019-05-17 10:08:49 +0200405}
406
407/* handles DEBUGSIG to dump the state of the thread it's working on */
408void debug_handler(int sig, siginfo_t *si, void *arg)
409{
410 /* There are 4 phases in the dump process:
411 * 1- wait for our turn, i.e. when all lower bits are gone.
412 * 2- perform the action if our bit is set
413 * 3- remove our bit to let the next one go, unless we're
Willy Tarreauc0773622019-07-31 19:15:45 +0200414 * the last one and have to put them all as a signal
415 * 4- wait out bit to re-appear, then clear it and quit.
Willy Tarreauc7091d82019-05-17 10:08:49 +0200416 */
417
418 /* wait for all previous threads to finish first */
419 while (threads_to_dump & (tid_bit - 1))
420 ha_thread_relax();
421
422 /* dump if needed */
423 if (threads_to_dump & tid_bit) {
424 if (thread_dump_buffer)
425 ha_thread_dump(thread_dump_buffer, tid, thread_dump_tid);
426 if ((threads_to_dump & all_threads_mask) == tid_bit) {
427 /* last one */
Willy Tarreauc0773622019-07-31 19:15:45 +0200428 HA_ATOMIC_STORE(&threads_to_dump, all_threads_mask);
Willy Tarreauc7091d82019-05-17 10:08:49 +0200429 thread_dump_buffer = NULL;
430 }
431 else
432 HA_ATOMIC_AND(&threads_to_dump, ~tid_bit);
433 }
434
435 /* now wait for all others to finish dumping. The last one will set all
Willy Tarreauc0773622019-07-31 19:15:45 +0200436 * bits again to broadcast the leaving condition so we'll see ourselves
437 * present again. This way the threads_to_dump variable never passes to
438 * zero until all visitors have stopped waiting.
Willy Tarreauc7091d82019-05-17 10:08:49 +0200439 */
Willy Tarreauc0773622019-07-31 19:15:45 +0200440 while (!(threads_to_dump & tid_bit))
441 ha_thread_relax();
442 HA_ATOMIC_AND(&threads_to_dump, ~tid_bit);
Willy Tarreaue6a02fa2019-05-22 07:06:44 +0200443
444 /* mark the current thread as stuck to detect it upon next invocation
445 * if it didn't move.
446 */
447 if (!((threads_harmless_mask|sleeping_thread_mask) & tid_bit))
448 ti->flags |= TI_FL_STUCK;
Willy Tarreauc7091d82019-05-17 10:08:49 +0200449}
450
451static int init_debug_per_thread()
452{
453 sigset_t set;
454
455 /* unblock the DEBUGSIG signal we intend to use */
456 sigemptyset(&set);
457 sigaddset(&set, DEBUGSIG);
458 ha_sigmask(SIG_UNBLOCK, &set, NULL);
459 return 1;
460}
461
462static int init_debug()
463{
464 struct sigaction sa;
465
466 sa.sa_handler = NULL;
467 sa.sa_sigaction = debug_handler;
468 sigemptyset(&sa.sa_mask);
469 sa.sa_flags = SA_SIGINFO;
470 sigaction(DEBUGSIG, &sa, NULL);
471 return 0;
472}
473
474REGISTER_POST_CHECK(init_debug);
475REGISTER_PER_THREAD_INIT(init_debug_per_thread);
476
477#endif /* USE_THREAD_DUMP */
478
Willy Tarreau4e2b6462019-05-16 17:44:30 +0200479/* register cli keywords */
480static struct cli_kw_list cli_kws = {{ },{
Willy Tarreau6bdf3e92019-05-20 14:25:05 +0200481#if defined(DEBUG_DEV)
482 {{ "debug", "dev", "close", NULL }, "debug dev close <fd> : close this file descriptor", debug_parse_cli_close, NULL },
483 {{ "debug", "dev", "delay", NULL }, "debug dev delay [ms] : sleep this long", debug_parse_cli_delay, NULL },
484 {{ "debug", "dev", "exec", NULL }, "debug dev exec [cmd] ... : show this command's output", debug_parse_cli_exec, NULL },
485 {{ "debug", "dev", "exit", NULL }, "debug dev exit [code] : immediately exit the process", debug_parse_cli_exit, NULL },
486 {{ "debug", "dev", "hex", NULL }, "debug dev hex <addr> [len]: dump a memory area", debug_parse_cli_hex, NULL },
487 {{ "debug", "dev", "log", NULL }, "debug dev log [msg] ... : send this msg to global logs", debug_parse_cli_log, NULL },
488 {{ "debug", "dev", "loop", NULL }, "debug dev loop [ms] : loop this long", debug_parse_cli_loop, NULL },
489 {{ "debug", "dev", "panic", NULL }, "debug dev panic : immediately trigger a panic", debug_parse_cli_panic, NULL },
490 {{ "debug", "dev", "tkill", NULL }, "debug dev tkill [thr] [sig] : send signal to thread", debug_parse_cli_tkill, NULL },
491#endif
Willy Tarreau4e2b6462019-05-16 17:44:30 +0200492 { { "show", "threads", NULL }, "show threads : show some threads debugging information", NULL, cli_io_handler_show_threads, NULL },
493 {{},}
494}};
495
496INITCALL1(STG_REGISTER, cli_register_kw, &cli_kws);