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.
This commit is contained in:
Amaury Denoyelle 2023-05-11 13:41:41 +02:00
parent 69670e88bd
commit 2d5c3f5cd1
2 changed files with 12 additions and 7 deletions

View 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" },
{ }
};

View 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)