From 2d22144559f84838b15e4d5c72a40bcbe7e1e729 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 25 Sep 2019 06:55:34 +0200 Subject: [PATCH] MINOR: h2/trace: indicate 'F' or 'B' to locate the side of an h2c in traces 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mux_h2.c b/src/mux_h2.c index 9ea56c2c3..c1d18b7b2 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -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