]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
WIP: trace: add hstream argument definition
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 15 Jan 2026 15:10:10 +0000 (16:10 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Mon, 19 Jan 2026 14:31:05 +0000 (15:31 +0100)
Add support for httpterm stream instances as TRACE() argument. This
is to be used by the httpterm.c module to come which will have to
handle hstream objects (in place of struct stream objects).

include/haproxy/trace-t.h
src/trace.c

index 8955ffcfaa4ea63cbbc2f779a40f8ac9ee2e47e4..2fa63bc84a04c91d639ede3fbed635370096880b 100644 (file)
@@ -45,6 +45,7 @@
 #define TRC_ARG_CHK    (1 << 3)
 #define TRC_ARG_QCON   (1 << 4)
 #define TRC_ARG_APPCTX (1 << 5)
+#define TRC_ARG_HSTRM  (1 << 6)
 
 #define TRC_ARG1_PRIV   (TRC_ARG_PRIV << 0)
 #define TRC_ARG1_CONN   (TRC_ARG_CONN << 0)
@@ -53,6 +54,7 @@
 #define TRC_ARG1_CHK    (TRC_ARG_CHK  << 0)
 #define TRC_ARG1_QCON   (TRC_ARG_QCON << 0)
 #define TRC_ARG1_APPCTX (TRC_ARG_APPCTX << 0)
+#define TRC_ARG1_HSTRM  (TRC_ARG_HSTRM << 0)
 
 #define TRC_ARG2_PRIV   (TRC_ARG_PRIV << 8)
 #define TRC_ARG2_CONN   (TRC_ARG_CONN << 8)
@@ -61,6 +63,7 @@
 #define TRC_ARG2_CHK    (TRC_ARG_CHK  << 8)
 #define TRC_ARG2_QCON   (TRC_ARG_QCON << 8)
 #define TRC_ARG2_APPCTX (TRC_ARG_APPCTX << 8)
+#define TRC_ARG2_HSTRM  (TRC_ARG_HSTRM << 8)
 
 #define TRC_ARG3_PRIV   (TRC_ARG_PRIV << 16)
 #define TRC_ARG3_CONN   (TRC_ARG_CONN << 16)
@@ -69,6 +72,7 @@
 #define TRC_ARG3_CHK    (TRC_ARG_CHK  << 16)
 #define TRC_ARG3_QCON   (TRC_ARG_QCON << 16)
 #define TRC_ARG3_APPCTX (TRC_ARG_APPCTX << 16)
+#define TRC_ARG3_HSTRM  (TRC_ARG_HSTRM << 16)
 
 #define TRC_ARG4_PRIV   (TRC_ARG_PRIV << 24)
 #define TRC_ARG4_CONN   (TRC_ARG_CONN << 24)
@@ -77,6 +81,7 @@
 #define TRC_ARG4_CHK    (TRC_ARG_CHK  << 24)
 #define TRC_ARG4_QCON   (TRC_ARG_QCON << 24)
 #define TRC_ARG4_APPCTX (TRC_ARG_APPCTX << 24)
+#define TRC_ARG4_HSTRM  (TRC_ARG_HSTRM << 24)
 
 /* usable to detect the presence of any arg of the desired type */
 #define TRC_ARGS_CONN   (TRC_ARG_CONN * 0x01010101U)
@@ -85,6 +90,7 @@
 #define TRC_ARGS_CHK    (TRC_ARG_CHK  * 0x01010101U)
 #define TRC_ARGS_QCON   (TRC_ARG_QCON * 0x01010101U)
 #define TRC_ARGS_APPCTX (TRC_ARG_APPCTX * 0x01010101U)
+#define TRC_ARGS_HSTRM  (TRC_ARG_HSTRM * 0x01010101U)
 
 
 enum trace_state {
@@ -148,6 +154,7 @@ struct trace_ctx {
        const struct check *check;
        const struct quic_conn *qc;
        const struct appctx *appctx;
+       const struct hstream *hs;
 };
 
 /* Regarding the verbosity, if <decoding> is not NULL, it must point to a NULL-
index ecf4e654b6fbabd3a807d2c11567fd9989f511e7..43956681fc35d0dad56ec196e4891505dacd70ca 100644 (file)
@@ -128,6 +128,9 @@ int __trace_enabled(enum trace_level level, uint64_t mask, struct trace_source *
        if (src->arg_def & TRC_ARGS_APPCTX)
                ctx.appctx = trace_pick_arg(src->arg_def & TRC_ARGS_APPCTX, a1, a2, a3, a4);
 
+       if (src->arg_def & TRC_ARGS_HSTRM)
+               ctx.hs = trace_pick_arg(src->arg_def & TRC_ARGS_HSTRM, a1, a2, a3, a4);
+
        if (src->fill_ctx)
                src->fill_ctx(&ctx, src, a1, a2, a3, a4);