]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h2: report the mbuf's head and tail in "show fd"
authorWilly Tarreau <w@1wt.eu>
Sun, 26 May 2019 09:32:27 +0000 (11:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 26 May 2019 09:33:18 +0000 (11:33 +0200)
It's useful to know how the mbuf spans over the whole area and to have
access to the first and last ones, so let's dump just this.

src/mux_h2.c

index 1d64d261ebd1759530971fbc7cb9e1a2f9f4d23f..e727549176987765387f5b87fbd1c6b1ba9035f0 100644 (file)
@@ -5620,7 +5620,7 @@ static void h2_show_fd(struct buffer *msg, struct connection *conn)
        int send_cnt = 0;
        int tree_cnt = 0;
        int orph_cnt = 0;
-       struct buffer *tmbuf;
+       struct buffer *hmbuf, *tmbuf;
 
        if (!h2c)
                return;
@@ -5641,16 +5641,21 @@ static void h2_show_fd(struct buffer *msg, struct connection *conn)
                node = eb32_next(node);
        }
 
+       hmbuf = br_head(h2c->mbuf);
        tmbuf = br_tail(h2c->mbuf);
        chunk_appendf(msg, " h2c.st0=%d .err=%d .maxid=%d .lastid=%d .flg=0x%04x"
                      " .nbst=%u .nbcs=%u .fctl_cnt=%d .send_cnt=%d .tree_cnt=%d"
-                     " .orph_cnt=%d .sub=%d .dsi=%d .dbuf=%u@%p+%u/%u .msi=%d .mbuf=%u@%p+%u/%u",
+                     " .orph_cnt=%d .sub=%d .dsi=%d .dbuf=%u@%p+%u/%u .msi=%d"
+                     " .mbuf=[%u..%u|%u],h=[%u@%p+%u/%u],t=[%u@%p+%u/%u]",
                      h2c->st0, h2c->errcode, h2c->max_id, h2c->last_sid, h2c->flags,
                      h2c->nb_streams, h2c->nb_cs, fctl_cnt, send_cnt, tree_cnt, orph_cnt,
                      h2c->wait_event.events, h2c->dsi,
                      (unsigned int)b_data(&h2c->dbuf), b_orig(&h2c->dbuf),
                      (unsigned int)b_head_ofs(&h2c->dbuf), (unsigned int)b_size(&h2c->dbuf),
                      h2c->msi,
+                     br_head_idx(h2c->mbuf), br_tail_idx(h2c->mbuf), br_size(h2c->mbuf),
+                     (unsigned int)b_data(hmbuf), b_orig(hmbuf),
+                     (unsigned int)b_head_ofs(hmbuf), (unsigned int)b_size(hmbuf),
                      (unsigned int)b_data(tmbuf), b_orig(tmbuf),
                      (unsigned int)b_head_ofs(tmbuf), (unsigned int)b_size(tmbuf));