mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
MINOR: debug: dump streams when an applet, iocb or stream is known
Whenever we can retrieve a valid stream pointer, we now call stream_dump() to get a detailed dump of the stream currently running on the processor. This is used by "show threads" and by ha_panic().
This commit is contained in:
parent
5484d58a17
commit
578ea8be55
12
src/debug.c
12
src/debug.c
@ -81,6 +81,8 @@ void ha_thread_dump(struct buffer *buf, int thr, int calling_tid)
|
|||||||
*/
|
*/
|
||||||
void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx)
|
void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx)
|
||||||
{
|
{
|
||||||
|
const struct stream *s = NULL;
|
||||||
|
|
||||||
if (!task) {
|
if (!task) {
|
||||||
chunk_appendf(buf, "0\n");
|
chunk_appendf(buf, "0\n");
|
||||||
return;
|
return;
|
||||||
@ -108,6 +110,16 @@ void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx)
|
|||||||
task->process == si_cs_io_cb ? "si_cs_io_cb" :
|
task->process == si_cs_io_cb ? "si_cs_io_cb" :
|
||||||
"?",
|
"?",
|
||||||
task->context);
|
task->context);
|
||||||
|
|
||||||
|
if (task->process == process_stream && task->context)
|
||||||
|
s = (struct stream *)task->context;
|
||||||
|
else if (task->process == task_run_applet && task->context)
|
||||||
|
s = si_strm(((struct appctx *)task->context)->owner);
|
||||||
|
else if (task->process == si_cs_io_cb && task->context)
|
||||||
|
s = si_strm((struct stream_interface *)task->context);
|
||||||
|
|
||||||
|
if (s)
|
||||||
|
stream_dump(buf, s, pfx, '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function dumps all profiling settings. It returns 0 if the output
|
/* This function dumps all profiling settings. It returns 0 if the output
|
||||||
|
Loading…
Reference in New Issue
Block a user