From: Willy Tarreau Date: Fri, 17 May 2019 08:34:25 +0000 (+0200) Subject: BUG/MINOR: debug: make ha_task_dump() actually dump the requested task X-Git-Tag: v2.0-dev4~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14a1ab75d0c7cad46bd343f74702dc4f864f7f12;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/debug.c b/src/debug.c index 47bf6e53bb..be17df30c8 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); }