summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Denoyelle <adenoyelle@haproxy.com>2023-05-11 13:41:41 +0200
committerAmaury Denoyelle <adenoyelle@haproxy.com>2023-05-11 14:04:51 +0200
commit2d5c3f5cd1d33d87dba6921739b62bd08ad5aecb (patch)
treea3b436cf7dd5b5b0d067f83f6736c42b12e1e7f5
parent69670e88bddbaf60e3abbfaf7a151ce2e11b952f (diff)
downloadhaproxy-2d5c3f5cd1d33d87dba6921739b62bd08ad5aecb.tar.gz
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.
-rw-r--r--include/haproxy/qmux_trace.h16
-rw-r--r--src/mux_quic.c3
2 files changed, 12 insertions, 7 deletions
diff --git a/include/haproxy/qmux_trace.h b/include/haproxy/qmux_trace.h
index ff850f0c0..49759a3b8 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 fa4abf8e0..6070b0088 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)