const struct ist where, const struct ist func,
const void *a1, const void *a2, const void *a3, const void *a4);
+static void qmux_trace_fill_ctx(struct trace_ctx *ctx, const struct trace_source *src,
+ const void *a1, const void *a2, const void *a3, const void *a4);
+
static const struct name_desc qmux_trace_lockon_args[4] = {
/* arg1 */ { /* already used by the connection */ },
/* arg2 */ { .name="qcs", .desc="QUIC stream" },
.desc = "QUIC multiplexer",
.arg_def = TRC_ARG1_CONN, /* TRACE()'s first argument is always a connection */
.default_cb = qmux_trace,
+ .fill_ctx = qmux_trace_fill_ctx,
.known_events = qmux_trace_events,
.lockon_args = qmux_trace_lockon_args,
.decoding = qmux_trace_decoding,
}
}
+/* This fills the trace_ctx with extra info guessed from the args */
+static void qmux_trace_fill_ctx(struct trace_ctx *ctx, const struct trace_source *src,
+ const void *a1, const void *a2, const void *a3, const void *a4)
+{
+ const struct connection *conn = a1;
+ const struct qcc *qcc = conn ? conn->ctx : NULL;
+ const struct qcs *qcs = a2;
+
+ if (!ctx->conn)
+ ctx->conn = conn;
+
+ if (qcc) {
+ if (!ctx->fe)
+ ctx->fe = qcc->proxy;
+ }
+
+ if (qcs) {
+ if (!ctx->strm && qcs->sd && qcs->sd->sc)
+ ctx->strm = sc_strm(qcs->sd->sc);
+ }
+}
+
/* register qmux traces */
INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);