]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1/trace: add a state trace on stream creation/upgrade
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Aug 2024 13:31:56 +0000 (15:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Aug 2024 14:02:59 +0000 (16:02 +0200)
Logging below the developer level doesn't always yield very convenient
traces as we don't know well where streams are allocated nor released.
Let's just make that more explicit by using state-level traces. Note that
h1s destruction was already logged as closing connection or switching
to idle mode.

src/mux_h1.c

index ee5bea72b1058ead7c1099279105ca0cc600499b..43bc6d57e94cef4f6bfa3aa3b42da3776e22731c 100644 (file)
@@ -830,6 +830,8 @@ static struct stconn *h1s_upgrade_sc(struct h1s *h1s, struct buffer *input)
                goto err;
        }
 
+       TRACE_STATE("upgraded H1 stream", H1_EV_H1S_NEW, h1s->h1c->conn, h1s);
+
        h1s->h1c->state = H1_CS_RUNNING;
        TRACE_LEAVE(H1_EV_STRM_NEW, h1s->h1c->conn, h1s);
        return h1s_sc(h1s);
@@ -921,6 +923,8 @@ static struct h1s *h1c_frt_stream_new(struct h1c *h1c, struct stconn *sc, struct
 
        h1c->idle_exp = TICK_ETERNITY;
        h1_set_idle_expiration(h1c);
+
+       TRACE_STATE("created new H1 front stream", H1_EV_H1S_NEW, h1c->conn, h1s);
        TRACE_LEAVE(H1_EV_H1S_NEW, h1c->conn, h1s);
        return h1s;
 
@@ -957,6 +961,7 @@ static struct h1s *h1c_bck_stream_new(struct h1c *h1c, struct stconn *sc, struct
        HA_ATOMIC_INC(&h1c->px_counters->open_streams);
        HA_ATOMIC_INC(&h1c->px_counters->total_streams);
 
+       TRACE_STATE("created new H1 back stream", H1_EV_H1S_NEW, h1c->conn, h1s);
        TRACE_LEAVE(H1_EV_H1S_NEW, h1c->conn, h1s);
        return h1s;