From: Amaury Denoyelle Date: Thu, 28 Nov 2024 10:27:56 +0000 (+0100) Subject: MINOR: quic: add traces X-Git-Tag: v3.2-dev2~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dcd2369e210f617f738d68f6764ccc229309528;p=thirdparty%2Fhaproxy.git MINOR: quic: add traces Add some traces to better follow QUIC MUX scheduling, in particular with pacing interaction. This should be backported up to 3.1. --- diff --git a/src/mux_quic.c b/src/mux_quic.c index 6fe9461094..8792d68431 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -2806,6 +2806,8 @@ static void qcc_purge_sending(struct qcc *qcc) enum quic_tx_err ret = QUIC_TX_ERR_PACING; int sent = 0; + TRACE_ENTER(QMUX_EV_QCC_WAKE, qcc->conn); + /* This function is reserved for pacing usage. */ BUG_ON(!qcc_is_pacing_active(qcc->conn)); @@ -2835,6 +2837,8 @@ static void qcc_purge_sending(struct qcc *qcc) HA_ATOMIC_AND(&qcc->wait_event.tasklet->state, ~TASK_F_USR1); } } + + TRACE_LEAVE(QMUX_EV_QCC_WAKE, qcc->conn); } struct task *qcc_io_cb(struct task *t, void *ctx, unsigned int status) @@ -2845,7 +2849,7 @@ struct task *qcc_io_cb(struct task *t, void *ctx, unsigned int status) if (status & TASK_F_USR1) { qcc_purge_sending(qcc); - return NULL; + goto end; } if (!(qcc->wait_event.events & SUB_RETRY_SEND)) diff --git a/src/quic_conn.c b/src/quic_conn.c index 901a57a423..c28725af7a 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -864,6 +864,7 @@ struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state) /* Wake up connection layer if on wait-for-handshake. */ if (qc->subs && qc->subs->events & SUB_RETRY_RECV) { + TRACE_STATE("notify upper layer (recv)", QUIC_EV_CONN_IO_CB, qc); tasklet_wakeup(qc->subs->tasklet); qc->subs->events &= ~SUB_RETRY_RECV; if (!qc->subs->events) @@ -1768,6 +1769,8 @@ int qc_notify_send(struct quic_conn *qc) { const struct quic_pktns *pktns = qc->apktns; + TRACE_STATE("notify upper layer (send)", QUIC_EV_CONN_IO_CB, qc); + /* Wake up MUX for new emission unless there is no congestion room or * connection FD is not ready. */