]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: add traces for stream wake
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 11 May 2023 11:41:41 +0000 (13:41 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 11 May 2023 12:04:51 +0000 (14:04 +0200)
Add traces for when an upper layer stream is woken up by the MUX. This
should help to diagnose frozen stream issues.

This should be backported up to 2.7.

include/haproxy/qmux_trace.h
src/mux_quic.c

index ff850f0c0b84ffc571d697cf92a0a3f500f16aa6..49759a3b80bfe7d1c89df594f832e6856995841f 100644 (file)
@@ -34,21 +34,23 @@ static const struct trace_event qmux_trace_events[] = {
        { .mask = QMUX_EV_STRM_RECV,    .name = "strm_recv",    .desc = "receiving data for stream" },
 #define           QMUX_EV_STRM_SEND     (1ULL << 11)
        { .mask = QMUX_EV_STRM_SEND,    .name = "strm_send",    .desc = "sending data for stream" },
-#define           QMUX_EV_STRM_SHUT     (1ULL << 12)
+#define           QMUX_EV_STRM_WAKE     (1ULL << 12)
+       { .mask = QMUX_EV_STRM_WAKE,    .name = "strm_wake",    .desc = "stream woken up" },
+#define           QMUX_EV_STRM_SHUT     (1ULL << 13)
        { .mask = QMUX_EV_STRM_SHUT,    .name = "strm_shut",    .desc = "stream shutdown" },
-#define           QMUX_EV_STRM_END      (1ULL << 13)
+#define           QMUX_EV_STRM_END      (1ULL << 14)
        { .mask = QMUX_EV_STRM_END,     .name = "strm_end",     .desc = "detaching app-layer stream" },
-#define           QMUX_EV_SEND_FRM      (1ULL << 14)
+#define           QMUX_EV_SEND_FRM      (1ULL << 15)
        { .mask = QMUX_EV_SEND_FRM,     .name = "send_frm",     .desc = "sending QUIC frame" },
 /* special event dedicated to qcs_xfer_data */
-#define           QMUX_EV_QCS_XFER_DATA  (1ULL << 15)
+#define           QMUX_EV_QCS_XFER_DATA  (1ULL << 16)
        { .mask = QMUX_EV_QCS_XFER_DATA,  .name = "qcs_xfer_data", .desc = "qcs_xfer_data" },
 /* special event dedicated to qcs_build_stream_frm */
-#define           QMUX_EV_QCS_BUILD_STRM (1ULL << 16)
+#define           QMUX_EV_QCS_BUILD_STRM (1ULL << 17)
        { .mask = QMUX_EV_QCS_BUILD_STRM, .name = "qcs_build_stream_frm", .desc = "qcs_build_stream_frm" },
-#define           QMUX_EV_PROTO_ERR     (1ULL << 17)
+#define           QMUX_EV_PROTO_ERR     (1ULL << 18)
        { .mask = QMUX_EV_PROTO_ERR,    .name = "proto_err",    .desc = "protocol error" },
-#define           QMUX_EV_QCC_ERR       (1ULL << 18)
+#define           QMUX_EV_QCC_ERR       (1ULL << 19)
        { .mask = QMUX_EV_QCC_ERR,      .name = "qcc_err",      .desc = "connection on error" },
        { }
 };
index fa4abf8e02ab328e7c0d28b2d30c49d4160af106..6070b008823d8acdf959f9f04288a6ae22fd8c3d 100644 (file)
@@ -449,6 +449,7 @@ static void qcs_alert(struct qcs *qcs)
                qcs_notify_send(qcs);
        }
        else if (qcs_sc(qcs) && qcs->sd->sc->app_ops->wake) {
+               TRACE_POINT(QMUX_EV_STRM_WAKE, qcs->qcc->conn, qcs);
                qcs->sd->sc->app_ops->wake(qcs->sd->sc);
        }
 }
@@ -479,6 +480,7 @@ int qcs_subscribe(struct qcs *qcs, int event_type, struct wait_event *es)
 void qcs_notify_recv(struct qcs *qcs)
 {
        if (qcs->subs && qcs->subs->events & SUB_RETRY_RECV) {
+               TRACE_POINT(QMUX_EV_STRM_WAKE, qcs->qcc->conn, qcs);
                tasklet_wakeup(qcs->subs->tasklet);
                qcs->subs->events &= ~SUB_RETRY_RECV;
                if (!qcs->subs->events)
@@ -489,6 +491,7 @@ void qcs_notify_recv(struct qcs *qcs)
 void qcs_notify_send(struct qcs *qcs)
 {
        if (qcs->subs && qcs->subs->events & SUB_RETRY_SEND) {
+               TRACE_POINT(QMUX_EV_STRM_WAKE, qcs->qcc->conn, qcs);
                tasklet_wakeup(qcs->subs->tasklet);
                qcs->subs->events &= ~SUB_RETRY_SEND;
                if (!qcs->subs->events)