]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: trace: add definitions for haload streams
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 19 Mar 2026 13:27:18 +0000 (14:27 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Fri, 24 Apr 2026 09:32:45 +0000 (11:32 +0200)
haload is the successor to the h1load HTTP benchmarking tool.

This patch adds haload stream definitions as arguments for the TRACE API.
These will be used by the upcoming haload module, which will handle
hldstream struct objects instead of regular stream structs.

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

index 2d32d99f2f754248b234e96edd60faf861374dae..1a902e375338c6f5898684b2af1458dc48cbf8be 100644 (file)
@@ -46,6 +46,7 @@
 #define TRC_ARG_QCON   (1 << 4)
 #define TRC_ARG_APPCTX (1 << 5)
 #define TRC_ARG_HSTRM  (1 << 6)
+#define TRC_ARG_HLDSTRM (1 << 7)
 
 #define TRC_ARG1_PRIV   (TRC_ARG_PRIV << 0)
 #define TRC_ARG1_CONN   (TRC_ARG_CONN << 0)
@@ -55,6 +56,7 @@
 #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_ARG1_HLDSTRM (TRC_ARG_HLDSTRM << 0)
 
 #define TRC_ARG2_PRIV   (TRC_ARG_PRIV << 8)
 #define TRC_ARG2_CONN   (TRC_ARG_CONN << 8)
@@ -64,6 +66,7 @@
 #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_ARG2_HLDSTRM (TRC_ARG_HLDSTRM << 8)
 
 #define TRC_ARG3_PRIV   (TRC_ARG_PRIV << 16)
 #define TRC_ARG3_CONN   (TRC_ARG_CONN << 16)
@@ -73,6 +76,7 @@
 #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_ARG3_HLDSTRM (TRC_ARG_HLDSTRM << 16)
 
 #define TRC_ARG4_PRIV   (TRC_ARG_PRIV << 24)
 #define TRC_ARG4_CONN   (TRC_ARG_CONN << 24)
@@ -82,6 +86,7 @@
 #define TRC_ARG4_QCON   (TRC_ARG_QCON << 24)
 #define TRC_ARG4_APPCTX (TRC_ARG_APPCTX << 24)
 #define TRC_ARG4_HSTRM  (TRC_ARG_HSTRM << 24)
+#define TRC_ARG4_HLDSTRM (TRC_ARG_HLDSTRM << 24)
 
 /* usable to detect the presence of any arg of the desired type */
 #define TRC_ARGS_CONN   (TRC_ARG_CONN * 0x01010101U)
@@ -91,6 +96,7 @@
 #define TRC_ARGS_QCON   (TRC_ARG_QCON * 0x01010101U)
 #define TRC_ARGS_APPCTX (TRC_ARG_APPCTX * 0x01010101U)
 #define TRC_ARGS_HSTRM  (TRC_ARG_HSTRM * 0x01010101U)
+#define TRC_ARGS_HLDSTRM (TRC_ARG_HLDSTRM * 0x01010101U)
 
 
 enum trace_state {
@@ -155,6 +161,7 @@ struct trace_ctx {
        const struct quic_conn *qc;
        const struct appctx *appctx;
        const struct hstream *hs;
+       const struct hldstream *hldstrm;
 };
 
 /* Regarding the verbosity, if <decoding> is not NULL, it must point to a NULL-
index 303b3e690802963a6d32ce556ca9f7f5acb50f4e..ba8b4ab4c37d82854471ac2570f7de082c4a95a5 100644 (file)
@@ -139,6 +139,9 @@ int __trace_enabled(enum trace_level level, uint64_t mask, struct trace_source *
        if (src->arg_def & TRC_ARGS_HSTRM)
                ctx.hs = trace_pick_arg(src->arg_def & TRC_ARGS_HSTRM, a1, a2, a3, a4);
 
+       if (src->arg_def & TRC_ARGS_HLDSTRM)
+               ctx.hldstrm = trace_pick_arg(src->arg_def & TRC_ARGS_HLDSTRM, a1, a2, a3, a4);
+
        if (src->fill_ctx)
                src->fill_ctx(&ctx, src, a1, a2, a3, a4);