MINOR: mux-h2: make the "show fd" helper also decode the h2s subscriber when known

When dumping a valid h2 stream, also dump the subscriber, its events,
tasklet context and handler. Example:

    128 : st=0x21(R:rA W:Ra) ev=0x01(heopI) [lc] tmask=0x1 umask=0x0 owner=0x7f40380d7370 iocb=0x65b71b(sock_conn_iocb) back=0 cflg=0x00001300 fe=recv mux=H2 ctx=0x1ad23e0 h2c.st0=FRP .err=0 .maxid=3 .lastid=-1 .flg=0x10000 .nbst=2 .nbcs=2 .fctl_cnt=0 .send_cnt=0 .tree_cnt=2 .orph_cnt=0 .sub=1 .dsi=3 .dbuf=16366@0x1ea9380+16441/16448 .msi=-1 .mbuf=[1..1|32],h=[0@(nil)+0/0],t=[0@(nil)+0/0] last_h2s=0x20a8340 .id=3 .st=OPN .flg=0x4100 .rxbuf=0@(nil)+0/0 .cs=0x20a8440(.flg=0x00100000 .data=0x20a8738) .subs=0x20a8760(ev=1 tl=0x20a89b0 tl.calls=22 tl.ctx=0x20a8738 tl.fct=si_cs_io_cb) xprt=SSL xprt_ctx=0x1aaf4c0 xctx.st=0 .xprt=RAW .wait.ev=1 .subs=0x1ad28e0(ev=1 tl=0x1ab3c70 tl.calls=176 tl.ctx=0x1ad23e0 tl.fct=h2_io_cb) .sent_early=0 .early_in=0
This commit is contained in:
Willy Tarreau 2021-01-20 16:27:01 +01:00
parent 691d503896
commit 98e40b9818

View File

@ -6247,8 +6247,20 @@ static void h2_show_fd(struct buffer *msg, struct connection *conn)
(unsigned int)b_head_ofs(&h2s->rxbuf), (unsigned int)b_size(&h2s->rxbuf),
h2s->cs);
if (h2s->cs)
chunk_appendf(msg, " .cs.flg=0x%08x .cs.data=%p",
chunk_appendf(msg, "(.flg=0x%08x .data=%p)",
h2s->cs->flags, h2s->cs->data);
chunk_appendf(&trash, " .subs=%p", h2s->subs);
if (h2s->subs) {
if (h2s->subs) {
chunk_appendf(&trash, "(ev=%d tl=%p", h2s->subs->events, h2s->subs->tasklet);
chunk_appendf(&trash, " tl.calls=%d tl.ctx=%p tl.fct=",
h2s->subs->tasklet->calls,
h2s->subs->tasklet->context);
resolve_sym_name(&trash, NULL, h2s->subs->tasklet->process);
chunk_appendf(&trash, ")");
}
}
}
}