static EVP_PKEY *tmp_pkey = NULL;
static X509 *tmp_x509 = NULL;
+#if defined(USE_TRACE)
static void acme_trace(enum trace_level level, uint64_t mask, const struct trace_source *src,
const struct ist where, const struct ist func,
}
}
}
+#endif
struct eb_root acme_tasks = EB_ROOT_UNIQUE;
__decl_thread(HA_RWLOCK_T acme_lock);
DECLARE_TYPED_POOL(pool_head_appctx, "appctx", struct appctx);
-/* trace source and events */
-static void applet_trace(enum trace_level level, uint64_t mask,
- const struct trace_source *src,
- const struct ist where, const struct ist func,
- const void *a1, const void *a2, const void *a3, const void *a4);
-
/* The event representation is split like this :
* app - applet
*/
-static const struct trace_event applet_trace_events[] = {
+static const struct trace_event applet_trace_events[] __maybe_unused = {
#define APPLET_EV_NEW (1ULL << 0)
{ .mask = APPLET_EV_NEW, .name = "app_new", .desc = "new appctx" },
#define APPLET_EV_FREE (1ULL << 1)
{}
};
+#if defined(USE_TRACE)
+
+/* trace source and events */
+static void applet_trace(enum trace_level level, uint64_t mask,
+ const struct trace_source *src,
+ const struct ist where, const struct ist func,
+ const void *a1, const void *a2, const void *a3, const void *a4);
+
static const struct name_desc applet_trace_lockon_args[4] = {
/* arg1 */ { /* already used by the applet */ },
/* arg2 */ { },
}
}
+#endif /* USE_TRACE */
+
/* Tries to allocate a new appctx and initialize all of its fields. The appctx
* is returned on success, NULL on failure. The appctx must be released using
* appctx_free(). <applet> is assigned as the applet, but it can be NULL. <thr>
#include <haproxy/trace.h>
#include <haproxy/vars.h>
+/* Dummy frontend used to create all checks sessions. */
+struct proxy checks_fe;
+
+#if defined(USE_TRACE)
+
/* trace source and events */
static void check_trace(enum trace_level level, uint64_t mask,
const struct trace_source *src,
#define TRACE_SOURCE &trace_check
INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);
-
-/* Dummy frontend used to create all checks sessions. */
-struct proxy checks_fe;
-
-
static inline void check_trace_buf(const struct buffer *buf, size_t ofs, size_t len)
{
size_t block1, block2;
}
+#endif /* USE_TRACE */
/**************************************************************************/
/************************ Handle check results ****************************/
static size_t hstream_add_ff_data(struct hstream *hs, struct sedesc *sd, unsigned long long len);
static size_t hstream_add_htx_data(struct hstream *hs, struct htx *htx, unsigned long long len);
-#define TRACE_SOURCE &trace_haterm
-struct trace_source trace_haterm;
-static void hterm_trace(enum trace_level level, uint64_t mask, const struct trace_source *src,
- const struct ist where, const struct ist func,
- const void *a1, const void *a2, const void *a3, const void *a4);
-
-static const struct name_desc hterm_trace_logon_args[4] = {
- /* arg1 */ { /* already used by the haterm stream */ },
- /* arg2 */ {
- .name="haterm",
- .desc="haterm server",
- },
- /* arg3 */ { },
- /* arg4 */ { }
-};
-
-static const struct trace_event hterm_trace_events[] = {
+static const struct trace_event hterm_trace_events[] __maybe_unused = {
#define HS_EV_HSTRM_NEW (1ULL << 0)
{ .mask = HS_EV_HSTRM_NEW, .name = "hstrm_new", .desc = "new haterm stream" },
#define HS_EV_PROCESS_HSTRM (1ULL << 1)
{ .mask = HS_EV_HSTRM_ADD_DATA, .name = "hstrm_add_data", .desc = "add data to HTX haterm stream" },
};
+#if defined(USE_TRACE)
+
+#define TRACE_SOURCE &trace_haterm
+struct trace_source trace_haterm;
+static void hterm_trace(enum trace_level level, uint64_t mask, const struct trace_source *src,
+ const struct ist where, const struct ist func,
+ const void *a1, const void *a2, const void *a3, const void *a4);
+
+static const struct name_desc hterm_trace_logon_args[4] = {
+ /* arg1 */ { /* already used by the haterm stream */ },
+ /* arg2 */ {
+ .name="haterm",
+ .desc="haterm server",
+ },
+ /* arg3 */ { },
+ /* arg4 */ { }
+};
+
static const struct name_desc hterm_trace_decoding[] = {
#define HATERM_VERB_CLEAN 1
{ .name = "clean", .desc = "only user-friendly stuff, generally suitable for level \"user\"" },
}
+#endif /* USE_TRACE */
+
int hstream_buf_available(void *target)
{
struct hstream *hs = target;
/* Maximum amount of data we're OK with re-aligning for buffer optimizations */
#define MAX_DATA_REALIGN 1024
-/* trace source and events */
-static void fcgi_trace(enum trace_level level, uint64_t mask,
- const struct trace_source *src,
- const struct ist where, const struct ist func,
- const void *a1, const void *a2, const void *a3, const void *a4);
-
/* The event representation is split like this :
* fconn - internal FCGI connection
* fstrm - internal FCGI stream
* tx - data transmission
* rsp - response parsing
*/
-static const struct trace_event fcgi_trace_events[] = {
+static const struct trace_event fcgi_trace_events[] __maybe_unused = {
#define FCGI_EV_FCONN_NEW (1ULL << 0)
{ .mask = FCGI_EV_FCONN_NEW, .name = "fconn_new", .desc = "new FCGI connection" },
#define FCGI_EV_FCONN_RECV (1ULL << 1)
{ }
};
+#if defined(USE_TRACE)
+
+/* trace source and events */
+static void fcgi_trace(enum trace_level level, uint64_t mask,
+ const struct trace_source *src,
+ const struct ist where, const struct ist func,
+ const void *a1, const void *a2, const void *a3, const void *a4);
+
static const struct name_desc fcgi_trace_lockon_args[4] = {
/* arg1 */ { /* already used by the connection */ },
/* arg2 */ { .name="fstrm", .desc="FCGI stream" },
#define TRACE_SOURCE &trace_fcgi
INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);
+#endif /* USE_TRACE */
+
/* FCGI connection and stream pools */
DECLARE_STATIC_TYPED_POOL(pool_head_fcgi_conn, "fcgi_conn", struct fcgi_conn);
DECLARE_STATIC_TYPED_POOL(pool_head_fcgi_strm, "fcgi_strm", struct fcgi_strm);
}
+#if defined(USE_TRACE)
+
/* the FCGI traces always expect that arg1, if non-null, is of type connection
* (from which we can derive fconn), that arg2, if non-null, is of type fstrm,
* and that arg3, if non-null, is a htx for rx/tx headers.
}
}
+#endif /* USE_TRACE */
+
/*****************************************************/
/* functions below are for dynamic buffer management */
/*****************************************************/
static int h1_be_glitches_threshold = 0; /* backend's max glitches: unlimited */
static int h1_fe_glitches_threshold = 0; /* frontend's max glitches: unlimited */
-/* trace source and events */
-static void h1_trace(enum trace_level level, uint64_t mask,
- const struct trace_source *src,
- const struct ist where, const struct ist func,
- const void *a1, const void *a2, const void *a3, const void *a4);
-
-static void h1_trace_fill_ctx(struct trace_ctx *ctx, const struct trace_source *src,
- const void *a1, const void *a2, const void *a3, const void *a4);
-
/* The event representation is split like this :
* h1c - internal H1 connection
* h1s - internal H1 stream
* tx - data transmission
*
*/
-static const struct trace_event h1_trace_events[] = {
+static const struct trace_event h1_trace_events[] __maybe_unused = {
#define H1_EV_H1C_NEW (1ULL << 0)
{ .mask = H1_EV_H1C_NEW, .name = "h1c_new", .desc = "new H1 connection" },
#define H1_EV_H1C_RECV (1ULL << 1)
{ }
};
+#if defined(USE_TRACE)
+
+/* trace source and events */
+static void h1_trace(enum trace_level level, uint64_t mask,
+ const struct trace_source *src,
+ const struct ist where, const struct ist func,
+ const void *a1, const void *a2, const void *a3, const void *a4);
+
+static void h1_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 h1_trace_lockon_args[4] = {
/* arg1 */ { /* already used by the connection */ },
/* arg2 */ { .name="h1s", .desc="H1 stream" },
#define TRACE_SOURCE &trace_h1
INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);
+#endif /* USE_TRACE */
/* h1 stats module */
enum {
return h1s->sd->sc;
}
+#if defined(USE_TRACE)
+
/* the H1 traces always expect that arg1, if non-null, is of type connection
* (from which we can derive h1c), that arg2, if non-null, is of type h1s, and
* that arg3, if non-null, is a htx for rx/tx headers.
}
}
+#endif /* USE_TRACE */
+
/* report one or more glitches on the connection. That is any unexpected event
* that may occasionally happen but if repeated a bit too much, might indicate
* a misbehaving or completely bogus peer. It normally returns zero, unless the
DECLARE_STATIC_TYPED_POOL(pool_head_pt_ctx, "mux_pt", struct mux_pt_ctx);
-/* trace source and events */
-static void pt_trace(enum trace_level level, uint64_t mask,
- const struct trace_source *src,
- const struct ist where, const struct ist func,
- const void *a1, const void *a2, const void *a3, const void *a4);
+/* returns the stconn associated to the stream */
+static forceinline struct stconn *pt_sc(const struct mux_pt_ctx *pt)
+{
+ return pt->sd->sc;
+}
/* The event representation is split like this :
* pt_ctx - internal PT context
* strm - application layer
*/
-static const struct trace_event pt_trace_events[] = {
+static const struct trace_event pt_trace_events[] __maybe_unused = {
#define PT_EV_CONN_NEW (1ULL << 0)
{ .mask = PT_EV_CONN_NEW, .name = "pt_conn_new", .desc = "new PT connection" },
#define PT_EV_CONN_WAKE (1ULL << 1)
{}
};
+#if defined(USE_TRACE)
+
+/* trace source and events */
+static void pt_trace(enum trace_level level, uint64_t mask,
+ const struct trace_source *src,
+ const struct ist where, const struct ist func,
+ const void *a1, const void *a2, const void *a3, const void *a4);
static const struct name_desc pt_trace_decoding[] = {
#define PT_VERB_CLEAN 1
#define TRACE_SOURCE &trace_pt
INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);
-/* returns the stconn associated to the stream */
-static forceinline struct stconn *pt_sc(const struct mux_pt_ctx *pt)
-{
- return pt->sd->sc;
-}
-
static inline void pt_trace_buf(const struct buffer *buf, size_t ofs, size_t len)
{
size_t block1, block2;
}
}
}
+#endif
static inline void mux_pt_report_term_evt(struct mux_pt_ctx *ctx, enum muxc_term_event_type type)
{
uint8_t type; /* frame type */
};
-/* trace source and events */
-static void spop_trace(enum trace_level level, uint64_t mask,
- const struct trace_source *src,
- const struct ist where, const struct ist func,
- const void *a1, const void *a2, const void *a3, const void *a4);
-
/* The event representation is split like this :
* spop_conn - internal SPOP connection
* spop_strm - internal SPOP stream
* rx - data receipt
* tx - data transmission
*/
-static const struct trace_event spop_trace_events[] = {
+static const struct trace_event spop_trace_events[] __maybe_unused = {
#define SPOP_EV_SPOP_CONN_NEW (1ULL << 0)
{ .mask = SPOP_EV_SPOP_CONN_NEW, .name = "spop_conn_new", .desc = "new SPOP connection" },
#define SPOP_EV_SPOP_CONN_RECV (1ULL << 1)
{ }
};
+#if defined(USE_TRACE)
+
+/* trace source and events */
+static void spop_trace(enum trace_level level, uint64_t mask,
+ const struct trace_source *src,
+ const struct ist where, const struct ist func,
+ const void *a1, const void *a2, const void *a3, const void *a4);
+
static const struct name_desc spop_trace_lockon_args[4] = {
/* arg1 */ { /* already used by the connection */ },
/* arg2 */ { .name="spop_strm", .desc="SPOP stream" },
#define TRACE_SOURCE &trace_spop
INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);
+#endif /* USE_TRACE */
+
/* SPOP connection and stream pools */
DECLARE_STATIC_TYPED_POOL(pool_head_spop_conn, "spop_conn", struct spop_conn);
DECLARE_STATIC_TYPED_POOL(pool_head_spop_strm, "spop_strm", struct spop_strm);
return se_opposite(spop_strm->sd);
}
+#if defined(USE_TRACE)
+
static inline void spop_trace_buf(const struct buffer *buf, size_t ofs, size_t len)
{
size_t block1, block2;
}
}
+#endif /* USE_TRACE */
/*****************************************************/
/* functions below are for dynamic buffer management */
struct dcache_tx_entry *i);
static inline void flush_dcache(struct peer *peer);
-/* trace source and events */
-static void peers_trace(enum trace_level level, uint64_t mask,
- const struct trace_source *src,
- const struct ist where, const struct ist func,
- const void *a1, const void *a2, const void *a3, const void *a4);
-
static const char *statuscode_str(int statuscode);
static const char *peer_app_state_str(enum peer_app_state appstate);
static const char *peer_learn_state_str(enum peer_learn_state learnstate);
static const char *peer_applet_state_str(int state);
-static const struct trace_event peers_trace_events[] = {
+static const struct trace_event peers_trace_events[] __maybe_unused = {
#define PEERS_EV_SESS_NEW (1ULL << 0)
{ .mask = PEERS_EV_SESS_NEW, .name = "sess_new", .desc = "create new peer session" },
#define PEERS_EV_SESS_END (1ULL << 1)
{ }
};
+#if defined(USE_TRACE)
+
+/* trace source and events */
+static void peers_trace(enum trace_level level, uint64_t mask,
+ const struct trace_source *src,
+ const struct ist where, const struct ist func,
+ const void *a1, const void *a2, const void *a3, const void *a4);
+
static const struct name_desc peers_trace_lockon_args[4] = {
/* arg1 */ { /* already used by the appctx */ },
/* arg2 */ { .name="peer", .desc="Peer" },
return;
}
+#endif /* USE_TRACE */
+
static const char *statuscode_str(int statuscode)
{
switch (statuscode) {
}
}
-static const char *peer_applet_state_str(int state)
+static inline const char *peer_applet_state_str(int state)
{
switch (state) {
case PEER_SESS_ST_ACCEPT: return "ACCEPT";
#include <haproxy/quic_utils.h>
#include <haproxy/stconn.h>
+#if defined(USE_TRACE)
+
/* trace source and events */
static void qcm_trace(enum trace_level level, uint64_t mask,
const struct trace_source *src,
/* register qcm traces */
INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);
+#endif /* USE_TRACE*/
+
static char *qcc_app_st_to_str(const enum qcc_app_st st)
{
switch (st) {
#include <haproxy/quic_tp.h>
#include <haproxy/trace.h>
+#if defined(USE_TRACE)
+
static void quic_trace(enum trace_level level, uint64_t mask, const struct trace_source *src,
const struct ist where, const struct ist func,
const void *a1, const void *a2, const void *a3, const void *a4);
}
+#endif /* USE_TRACE */
+
void quic_dump_qc_info(struct buffer *msg, const struct quic_conn *qc)
{
chunk_appendf(msg, " qc.wnd=%llu/%llu", (ullong)qc->path->in_flight,
int conn_complete_session(struct connection *conn);
-static const struct trace_event sess_trace_events[] = {
+static const struct trace_event sess_trace_events[] __maybe_unused = {
#define SESS_EV_NEW (1ULL << 0)
{ .mask = SESS_EV_NEW, .name = "sess_new", .desc = "new session creation" },
#define SESS_EV_END (1ULL << 1)
{ }
};
+#if defined(USE_TRACE)
+
static const struct name_desc sess_trace_lockon_args[4] = {
/* arg1 */ { /* already used by the session */ },
/* arg2 */ { },
#define TRACE_SOURCE &trace_sess
INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);
+#endif /* USE_TRACE */
+
/* Create a a new session and assign it to frontend <fe>, listener <li>,
* origin <origin>, set the current date and clear the stick counters pointers.
* Returns the session upon success or NULL. The session may be released using
static struct list service_keywords = LIST_HEAD_INIT(service_keywords);
+#if defined(USE_TRACE)
+
/* trace source and events */
static void strm_trace(enum trace_level level, uint64_t mask,
const struct trace_source *src,
htx_dump(&trace_buf, htx, full);
}
}
+#endif
/* Upgrade an existing stream for stream connector <sc>. Return < 0 on error. This
* is only valid right after a TCP to H1 upgrade. The stream should be