# USE_CLOSEFROM : enable use of closefrom() on *bsd, solaris. Automatic.
# USE_PRCTL : enable use of prctl(). Automatic.
# USE_PROCCTL : enable use of procctl(). Automatic.
+# USE_TRACE : enable trace subsystem. Always on.
# USE_ZLIB : enable zlib library support and disable SLZ
# USE_SLZ : enable slz library instead of zlib (default=enabled)
# USE_CPU_AFFINITY : enable pinning processes to CPU on Linux. Automatic.
USE_TPROXY USE_LINUX_TPROXY USE_LINUX_CAP \
USE_LINUX_SPLICE USE_LIBCRYPT USE_CRYPT_H USE_ENGINE \
USE_GETADDRINFO USE_OPENSSL USE_OPENSSL_WOLFSSL USE_OPENSSL_AWSLC \
- USE_ECH \
+ USE_ECH USE_TRACE \
USE_SSL USE_LUA USE_ACCEPT4 USE_CLOSEFROM USE_ZLIB USE_SLZ \
USE_CPU_AFFINITY USE_TFO USE_NS USE_DL USE_RT USE_LIBATOMIC \
USE_MATH USE_DEVICEATLAS USE_51DEGREES \
# on the make command line.
USE_POLL = default
+# traces are always enabled
+USE_TRACE = default
+
# SLZ is always supported unless explicitly disabled by passing USE_SLZ=""
# or disabled by enabling ZLIB using USE_ZLIB=1
ifeq ($(USE_ZLIB:0=),)
#define _TRC_LOC(f,l) __TRC_LOC(f, ":", l)
#define __TRC_LOC(f,c,l) f c #l
+#if defined(USE_TRACE)
+
/* truncate a macro arg list to exactly 5 args and replace missing ones with NULL.
* The first one (a0) is always ignored.
*/
&trace_no_cb, ist2(_msg, _msg_len)); \
} \
} while (0)
+#else
+# define TRACE_ENABLED(level, mask, args...) 0
+# define TRACE(msg, mask, args...) do { /* do nothing */ } while(0)
+# define TRACE_ERROR(msg, mask, args...) do { /* do nothing */ } while(0)
+# define TRACE_USER(msg, mask, args...) do { /* do nothing */ } while(0)
+# define TRACE_DATA(msg, mask, args...) do { /* do nothing */ } while(0)
+# define TRACE_PROTO(msg, mask, args...) do { /* do nothing */ } while(0)
+# define TRACE_STATE(msg, mask, args...) do { /* do nothing */ } while(0)
+# define TRACE_DEVEL(msg, mask, args...) do { /* do nothing */ } while(0)
+# define TRACE_ENTER(mask, args...) do { /* do nothing */ } while(0)
+# define TRACE_LEAVE(mask, args...) do { /* do nothing */ } while(0)
+# define TRACE_POINT(mask, args...) do { /* do nothing */ } while(0)
+# define TRACE_PRINTF(level, args...) do { /* do nothing */ } while(0)
+# define TRACE_PRINTF_LOC(level, args...) do { /* do nothing */ } while(0)
+#endif
-#if defined(DEBUG_DEV) || defined(DEBUG_FULL)
+#if defined (USE_TRACE) && (defined(DEBUG_DEV) || defined(DEBUG_FULL))
# define DBG_TRACE(msg, mask, args...) TRACE(msg, mask, ##args)
# define DBG_TRACE_ERROR(msg, mask, args...) TRACE_ERROR(msg, mask, ##args)
# define DBG_TRACE_USER(msg, mask, args...) TRACE_USER(msg, mask, ##args)