From: Amaury Denoyelle Date: Thu, 11 May 2023 11:41:41 +0000 (+0200) Subject: MINOR: mux-quic: add traces for stream wake X-Git-Tag: v2.8-dev12~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d5c3f5cd1d33d87dba6921739b62bd08ad5aecb;p=thirdparty%2Fhaproxy.git MINOR: mux-quic: add traces for stream wake 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. --- diff --git a/include/haproxy/qmux_trace.h b/include/haproxy/qmux_trace.h index ff850f0c0b..49759a3b80 100644 --- a/include/haproxy/qmux_trace.h +++ b/include/haproxy/qmux_trace.h @@ -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" }, { } }; diff --git a/src/mux_quic.c b/src/mux_quic.c index fa4abf8e02..6070b00882 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -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)