]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h2/trace: indicate 'F' or 'B' to locate the side of an h2c in traces
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Sep 2019 04:55:34 +0000 (06:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 Sep 2019 05:30:59 +0000 (07:30 +0200)
It was difficult in traces showing h2-to-h2 communications to figure the
connection side solely based on the pointer. With this patch we prepend
'F' or 'B' before the state to make this more explicit:

[06|h2|4|mux_h2.c:5487] h2_rcv_buf(): entering : h2c=0x7f6acc026440(F,FRH) h2s=0x7f6acc021720(1,CLO)
[06|h2|4|mux_h2.c:5547] h2_rcv_buf(): leaving : h2c=0x7f6acc026440(F,FRH) h2s=0x7f6acc021720(1,CLO)
[06|h2|4|mux_h2.c:4040] h2_shutw(): entering : h2c=0x7f6acc026440(F,FRH) h2s=0x7f6acc021720(1,CLO)

src/mux_h2.c

index 9ea56c2c365eabd56a2d6133c9c57493c6e69be2..c1d18b7b29dbc37692410178a4216e6073a0dc4f 100644 (file)
@@ -503,11 +503,11 @@ static void h2_trace(enum trace_level level, uint64_t mask, const struct trace_s
 
        if (src->verbosity > H2_VERB_CLEAN) {
                if (!h2s || h2c->st0 < H2_CS_FRAME_H)
-                       chunk_appendf(&trace_buf, " : h2c=%p(%s)", h2c, h2c_st_to_str(h2c->st0));
+                       chunk_appendf(&trace_buf, " : h2c=%p(%c,%s)", h2c, conn_is_back(conn) ? 'B' : 'F', h2c_st_to_str(h2c->st0));
                else if (h2s->id <= 0)
-                       chunk_appendf(&trace_buf, " : h2c=%p(%s) dsi=%d h2s=%p(%d,%s)", h2c, h2c_st_to_str(h2c->st0), h2c->dsi, h2s, h2s->id, h2s_st_to_str(h2s->st));
+                       chunk_appendf(&trace_buf, " : h2c=%p(%c,%s) dsi=%d h2s=%p(%d,%s)", h2c, conn_is_back(conn) ? 'B' : 'F', h2c_st_to_str(h2c->st0), h2c->dsi, h2s, h2s->id, h2s_st_to_str(h2s->st));
                else
-                       chunk_appendf(&trace_buf, " : h2c=%p(%s) h2s=%p(%d,%s)", h2c, h2c_st_to_str(h2c->st0), h2s, h2s->id, h2s_st_to_str(h2s->st));
+                       chunk_appendf(&trace_buf, " : h2c=%p(%c,%s) h2s=%p(%d,%s)", h2c, conn_is_back(conn) ? 'B' : 'F', h2c_st_to_str(h2c->st0), h2s, h2s->id, h2s_st_to_str(h2s->st));
        }
 
        /* Let's dump decoded requests and responses right after parsing. They