]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Show the SD iobuf in trace messages on stream send events
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 16 Oct 2024 12:54:47 +0000 (14:54 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 17 Oct 2024 11:53:40 +0000 (13:53 +0200)
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

index ba530e63a47baf002e1bd1b0e162fd041f9f47e4..ca85b2623816226cadf6b30395a3ecd82db420f2 100644 (file)
@@ -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) */