]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: make the "show fd" helper also decode the h1s subscriber when known
authorWilly Tarreau <w@1wt.eu>
Wed, 20 Jan 2021 16:05:58 +0000 (17:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 20 Jan 2021 16:17:40 +0000 (17:17 +0100)
When dumping a live h1 stream, also take the opportunity for reporting
the subscriber including the event, tasklet, handler and context. Example:

   3030 : st=0x21(R:rA W:Ra) ev=0x04(heOpi) [Lc] tmask=0x4 umask=0x0 owner=0x7f97805c1f70 iocb=0x65b847(sock_conn_iocb) back=1 cflg=0x00002300 sv=s1/recv mux=H1 ctx=0x7f97805c21b0 h1c.flg=0x80000200 .sub=1 .ibuf=0@(nil)+0/0 .obuf=0@(nil)+0/0 h1s=0x7f97805c2380 h1s.flg=0x4010 .req.state=MSG_DATA .res.state=MSG_RPBEFORE .meth=POST status=0 .cs.flg=0x00000000 .cs.data=0x7f97805c1720 .subs=0x7f97805c1748(ev=1 tl=0x7f97805c1990 tl.calls=2 tl.ctx=0x7f97805c1720 tl.fct=si_cs_io_cb) xprt=RAW

src/mux_h1.c

index 857b1c380b62a38bc3a3b38436452676f38aa331..4a4b5edc464af22d7105ee6af9239cb2a7c6f922 100644 (file)
@@ -3168,6 +3168,18 @@ static void h1_show_fd(struct buffer *msg, struct connection *conn)
                if (h1s->cs)
                        chunk_appendf(msg, " .cs.flg=0x%08x .cs.data=%p",
                                      h1s->cs->flags, h1s->cs->data);
+
+               chunk_appendf(&trash, " .subs=%p", h1s->subs);
+               if (h1s->subs) {
+                       if (h1s->subs) {
+                               chunk_appendf(&trash, "(ev=%d tl=%p", h1s->subs->events, h1s->subs->tasklet);
+                               chunk_appendf(&trash, " tl.calls=%d tl.ctx=%p tl.fct=",
+                                             h1s->subs->tasklet->calls,
+                                             h1s->subs->tasklet->context);
+                               resolve_sym_name(&trash, NULL, h1s->subs->tasklet->process);
+                               chunk_appendf(&trash, ")");
+                       }
+               }
        }
 }