]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: trace: remove the QUIC-specific ifdefs
authorWilly Tarreau <w@1wt.eu>
Tue, 24 Jan 2023 15:02:27 +0000 (16:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 26 Jan 2023 14:49:43 +0000 (15:49 +0100)
There are ifdefs at several places to only define TRC_ARGS_QCON when
QUIC is defined, but nothing prevents this code from building without.
Let's just remove those ifdefs, the single "if" they avoid is not worth
the extra maintenance burden.

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

index dcdaec3a47641b4ea06310b5396cabeed055f28c..e08714cd8617faf375b5ced8065df03a2114a123 100644 (file)
 #define TRC_ARG_SESS  (1 << 1)
 #define TRC_ARG_STRM  (1 << 2)
 #define TRC_ARG_CHK   (1 << 3)
-#ifdef USE_QUIC
 #define TRC_ARG_QCON  (1 << 4)
-#endif
 
 #define TRC_ARG1_PRIV (TRC_ARG_PRIV << 0)
 #define TRC_ARG1_CONN (TRC_ARG_CONN << 0)
 #define TRC_ARG1_SESS (TRC_ARG_SESS << 0)
 #define TRC_ARG1_STRM (TRC_ARG_STRM << 0)
 #define TRC_ARG1_CHK  (TRC_ARG_CHK  << 0)
-#ifdef USE_QUIC
 #define TRC_ARG1_QCON (TRC_ARG_QCON << 0)
-#endif
 
 #define TRC_ARG2_PRIV (TRC_ARG_PRIV << 8)
 #define TRC_ARG2_CONN (TRC_ARG_CONN << 8)
 #define TRC_ARG2_SESS (TRC_ARG_SESS << 8)
 #define TRC_ARG2_STRM (TRC_ARG_STRM << 8)
 #define TRC_ARG2_CHK  (TRC_ARG_CHK  << 8)
-#ifdef USE_QUIC
 #define TRC_ARG2_QCON (TRC_ARG_QCON << 8)
-#endif
 
 #define TRC_ARG3_PRIV (TRC_ARG_PRIV << 16)
 #define TRC_ARG3_CONN (TRC_ARG_CONN << 16)
 #define TRC_ARG3_SESS (TRC_ARG_SESS << 16)
 #define TRC_ARG3_STRM (TRC_ARG_STRM << 16)
 #define TRC_ARG3_CHK  (TRC_ARG_CHK  << 16)
-#ifdef USE_QUIC
 #define TRC_ARG3_QCON (TRC_ARG_QCON << 16)
-#endif
 
 #define TRC_ARG4_PRIV (TRC_ARG_PRIV << 24)
 #define TRC_ARG4_CONN (TRC_ARG_CONN << 24)
 #define TRC_ARG4_SESS (TRC_ARG_SESS << 24)
 #define TRC_ARG4_STRM (TRC_ARG_STRM << 24)
 #define TRC_ARG4_CHK  (TRC_ARG_CHK  << 24)
-#ifdef USE_QUIC
 #define TRC_ARG4_QCON (TRC_ARG_QCON << 24)
-#endif
 
 /* usable to detect the presence of any arg of the desired type */
 #define TRC_ARGS_CONN (TRC_ARG_CONN * 0x01010101U)
 #define TRC_ARGS_SESS (TRC_ARG_SESS * 0x01010101U)
 #define TRC_ARGS_STRM (TRC_ARG_STRM * 0x01010101U)
 #define TRC_ARGS_CHK  (TRC_ARG_CHK  * 0x01010101U)
-#ifdef USE_QUIC
 #define TRC_ARGS_QCON (TRC_ARG_QCON * 0x01010101U)
-#endif
 
 
 enum trace_state {
@@ -122,9 +110,7 @@ enum trace_lockon {
        TRACE_LOCKON_SESSION,     // lock on the session that started the trace
        TRACE_LOCKON_STREAM,      // lock on the stream that started the trace
        TRACE_LOCKON_CHECK,       // lock on the check that started the trace
-#ifdef USE_QUIC
        TRACE_LOCKON_QCON,        // lock on the QUIC connection that started the trace
-#endif
        TRACE_LOCKON_ARG1,        // lock on arg1, totally source-dependent
        TRACE_LOCKON_ARG2,        // lock on arg2, totally source-dependent
        TRACE_LOCKON_ARG3,        // lock on arg3, totally source-dependent
index 9c0b3f2057311002dd76fcab004e84dabd233dfc..d0856850aa0e912539690728a8c3997fe7ca8b63 100644 (file)
@@ -87,9 +87,7 @@ void __trace(enum trace_level level, uint64_t mask, struct trace_source *src,
        const struct stream *strm = NULL;
        const struct connection *conn = NULL;
        const struct check *check = NULL;
-#ifdef USE_QUIC
        const struct quic_conn *qc = NULL;
-#endif
        const void *lockon_ptr = NULL;
        struct ist ist_func = ist(func);
        char tnum[4];
@@ -116,10 +114,8 @@ void __trace(enum trace_level level, uint64_t mask, struct trace_source *src,
        if (src->arg_def & TRC_ARGS_CHK)
                check = trace_pick_arg(src->arg_def & TRC_ARGS_CHK, a1, a2, a3, a4);
 
-#ifdef USE_QUIC
        if (src->arg_def & TRC_ARGS_QCON)
                qc = trace_pick_arg(src->arg_def & TRC_ARGS_QCON, a1, a2, a3, a4);
-#endif
 
        if (!sess && strm)
                sess = strm->sess;
@@ -180,9 +176,7 @@ void __trace(enum trace_level level, uint64_t mask, struct trace_source *src,
                case TRACE_LOCKON_STREAM:     lockon_ptr = strm; break;
                case TRACE_LOCKON_CHECK:      lockon_ptr = check; break;
                case TRACE_LOCKON_THREAD:     lockon_ptr = ti;   break;
-#ifdef USE_QUIC
                case TRACE_LOCKON_QCON:       lockon_ptr = qc;   break;
-#endif
                case TRACE_LOCKON_ARG1:       lockon_ptr = a1;   break;
                case TRACE_LOCKON_ARG2:       lockon_ptr = a2;   break;
                case TRACE_LOCKON_ARG3:       lockon_ptr = a3;   break;