From 2c82ca60c61eb452f673113d2c86b18a66b11628 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 16 Oct 2024 14:54:47 +0200 Subject: [PATCH] MINOR: mux-h1: Show the SD iobuf in trace messages on stream send events Info about the SD iobuf are now dumped in trace messages when a stream send event is processed. It is a useful information to debug zero-copy forwarding issues. --- src/mux_h1.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mux_h1.c b/src/mux_h1.c index ba530e63a..ca85b2623 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -433,10 +433,17 @@ static void h1_trace(enum trace_level level, uint64_t mask, const struct trace_s (unsigned int)b_data(&h1c->ibuf), b_orig(&h1c->ibuf), (unsigned int)b_head_ofs(&h1c->ibuf), (unsigned int)b_size(&h1c->ibuf)); if (src->verbosity == H1_VERB_COMPLETE || - (src->verbosity == H1_VERB_ADVANCED && (mask & (H1_EV_H1C_SEND|H1_EV_STRM_SEND)))) + (src->verbosity == H1_VERB_ADVANCED && (mask & (H1_EV_H1C_SEND|H1_EV_STRM_SEND)))) { chunk_appendf(&trace_buf, " obuf=%u@%p+%u/%u", (unsigned int)b_data(&h1c->obuf), b_orig(&h1c->obuf), (unsigned int)b_head_ofs(&h1c->obuf), (unsigned int)b_size(&h1c->obuf)); + + if (h1s && h1s->sd) + chunk_appendf(&trace_buf, " iobuf(.pipe=%d, .data=%u+%u, .flags=0x%x)", + (h1s->sd->iobuf.pipe ? h1s->sd->iobuf.pipe->data : 0), + (unsigned int)h1s->sd->iobuf.data, (unsigned int)h1s->sd->iobuf.offset, + h1s->sd->iobuf.flags); + } } /* Display htx info if defined (level > USER) */