]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: debug: use resolve_sym_name() to dump task handlers
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Mar 2020 16:13:02 +0000 (17:13 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 3 Mar 2020 17:19:04 +0000 (18:19 +0100)
Now in "show threads", the task/tasklet handler will be resolved
using this function, which will provide more detailed results and
will still support offsets to main for unresolved symbols.

src/debug.c

index e6e3047e719a243185555721efc59b0e94167f82..4b7f65e72432fb48aa4aa40cd02fad10b304fe2e 100644 (file)
@@ -120,20 +120,9 @@ void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx)
                              task->call_date ? (unsigned long long)(now_mono_time() - task->call_date) : 0,
                              task->call_date ? " ns ago" : "");
 
-       chunk_appendf(buf, "%s"
-                     "  fct=%p=main%s%ld (%s) ctx=%p",
-                     pfx,
-                     task->process,
-                     ((void *)task->process - (void *)main) < 0 ? "" : "+",
-                     (long)((void *)task->process - (void *)main),
-                     task->process == process_stream ? "process_stream" :
-                     task->process == task_run_applet ? "task_run_applet" :
-                     task->process == si_cs_io_cb ? "si_cs_io_cb" :
-#ifdef USE_LUA
-                     task->process == hlua_process_task ? "hlua_process_task" :
-#endif
-                     "?",
-                     task->context);
+       chunk_appendf(buf, "%s  fct=%p(", pfx, task->process);
+       resolve_sym_name(buf, NULL, task->process);
+       chunk_appendf(buf,") ctx=%p", task->context);
 
        if (task->process == task_run_applet && (appctx = task->context))
                chunk_appendf(buf, "(%s)\n", appctx->applet->name);