]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: add traces
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 28 Nov 2024 10:27:56 +0000 (11:27 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 18 Dec 2024 08:20:20 +0000 (09:20 +0100)
Add some traces to better follow QUIC MUX scheduling, in particular with
pacing interaction.

This should be backported up to 3.1.

src/mux_quic.c
src/quic_conn.c

index 6fe9461094650a1b8688670ec29d3254c138e269..8792d68431c886c8ce4d21969d474605046cb850 100644 (file)
@@ -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))
index 901a57a423abe264f8a3206db4c1a8aa7f8e6b4d..c28725af7a3769f1eb4a0801fcb73ed199d7a4e1 100644 (file)
@@ -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.
         */