From 14a1ab75d0c7cad46bd343f74702dc4f864f7f12 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 17 May 2019 10:34:25 +0200 Subject: [PATCH] BUG/MINOR: debug: make ha_task_dump() actually dump the requested task It used to only dump the current task, which isn't different for now but the purpose clearly is to dump the requested task. No backport is needed. --- src/debug.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/debug.c b/src/debug.c index 47bf6e53b..be17df30c 100644 --- a/src/debug.c +++ b/src/debug.c @@ -75,27 +75,27 @@ void ha_thread_dump(int thr) */ void ha_task_dump(const struct task *task, const char *pfx) { - if (!curr_task) { + if (!task) { chunk_appendf(&trash, "0\n"); return; } chunk_appendf(&trash, "%p (%s) calls=%u last=%llu%s\n", - curr_task, TASK_IS_TASKLET(curr_task) ? "tasklet" : "task", - curr_task->calls, - curr_task->call_date ? (unsigned long long)(now_mono_time() - curr_task->call_date) : 0, - curr_task->call_date ? " ns ago" : ""); + task, TASK_IS_TASKLET(task) ? "tasklet" : "task", + task->calls, + task->call_date ? (unsigned long long)(now_mono_time() - task->call_date) : 0, + task->call_date ? " ns ago" : ""); chunk_appendf(&trash, "%s" " fct=%p (%s) ctx=%p\n", pfx, - curr_task->process, - curr_task->process == process_stream ? "process_stream" : - curr_task->process == task_run_applet ? "task_run_applet" : - curr_task->process == si_cs_io_cb ? "si_cs_io_cb" : + task->process, + task->process == process_stream ? "process_stream" : + task->process == task_run_applet ? "task_run_applet" : + task->process == si_cs_io_cb ? "si_cs_io_cb" : "?", - curr_task->context); + task->context); }