From: Christopher Faulet Date: Mon, 23 Nov 2026 14:23:41 +0000 (+0100) Subject: MINOR: stream: use regular TRACE_* macros for stream traces X-Git-Url: https://git.kaiwu.me/http/%7B@url%7D?a=commitdiff_plain;h=4dc888d04475d825a24344b23c4448f86905f729;p=haproxy.git MINOR: stream: use regular TRACE_* macros for stream traces The stream trace messages are only emitted when HAProxy is compiled in DEBUG mode, because they rely on the DBG_TRACE_* macros that are no-ops unless DEBUG_DEV or DEBUG_FULL is defined. Now the stream traces are enabled in any build with USE_TRACE, all the DBG_TRACE_* macros in the stream trace sources were replaced by the regular TRACE_* macros: * src/stream.c: 23 DBG_TRACE_* -> TRACE_* * src/backend.c: 44 DBG_TRACE_* -> TRACE_* * src/http_ana.c: 61 DBG_TRACE_* -> TRACE_* * src/tcp_rules.c: 8 DBG_TRACE_* -> TRACE_* All these files use the 'strm' trace source, so their messages are now available via 'trace strm' in non-DEBUG builds. --- diff --git a/src/backend.c b/src/backend.c index d5ab12fbe..140922c05 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1698,7 +1698,7 @@ int be_reuse_connection(int64_t hash, struct session *sess, /* first, search for a matching connection in the session's idle conns */ srv_conn = session_get_conn(sess, target, hash); if (srv_conn) { - //DBG_TRACE_STATE("reuse connection from session", STRM_EV_STRM_PROC|STRM_EV_CS_ST, strm); + //TRACE_STATE("reuse connection from session", STRM_EV_STRM_PROC|STRM_EV_CS_ST, strm); } else if (srv && reuse_mode != PR_O_REUSE_NEVR) { /* Below we pick connections from the safe, idle or @@ -1724,7 +1724,7 @@ int be_reuse_connection(int64_t hash, struct session *sess, if (srv_conn) { /* connection cannot be in idle list if used as an avail idle conn. */ BUG_ON(LIST_INLIST(&srv_conn->idle_list)); - //DBG_TRACE_STATE("reuse connection from avail", STRM_EV_STRM_PROC|STRM_EV_CS_ST, strm); + //TRACE_STATE("reuse connection from avail", STRM_EV_STRM_PROC|STRM_EV_CS_ST, strm); } } @@ -1755,7 +1755,7 @@ int be_reuse_connection(int64_t hash, struct session *sess, } if (srv_conn) { - //DBG_TRACE_STATE("reuse connection from idle/safe", STRM_EV_STRM_PROC|STRM_EV_CS_ST, strm); + //TRACE_STATE("reuse connection from idle/safe", STRM_EV_STRM_PROC|STRM_EV_CS_ST, strm); } } } @@ -1855,7 +1855,7 @@ int connect_server(struct stream *s) * same as the main protocol of the server. */ if (unlikely(s->flags & SF_WEBSOCKET) && srv && !srv_check_reuse_ws(srv)) { - DBG_TRACE_STATE("skip idle connections reuse: websocket stream", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("skip idle connections reuse: websocket stream", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); } else { const int not_first_req = s->txn.http && s->txn.http->flags & TX_NOT_FIRST; @@ -1934,7 +1934,7 @@ int connect_server(struct stream *s) unsigned int total_conns; if (srv && (srv->flags & SRV_F_RHTTP)) { - DBG_TRACE_USER("cannot open a new connection for reverse server", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_USER("cannot open a new connection for reverse server", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); s->conn_err_type = STRM_ET_CONN_ERR; return SF_ERR_INTERNAL; } @@ -1976,7 +1976,7 @@ int connect_server(struct stream *s) } srv_conn = conn_new(s->target); if (srv_conn) { - DBG_TRACE_STATE("alloc new be connection", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("alloc new be connection", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); srv_conn->owner = s->sess; /* connection will be attached to the session if @@ -2168,7 +2168,7 @@ int connect_server(struct stream *s) */ may_start_mux_now = 0; srv_conn->flags |= CO_FL_SSL_NO_CACHED_INFO; - DBG_TRACE_STATE("update alpn for websocket", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("update alpn for websocket", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); } } #endif @@ -2471,7 +2471,7 @@ void back_try_conn_req(struct stream *s) struct stconn *sc = s->scb; struct channel *req = &s->req; - DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); if (sc->state == SC_ST_ASS) { /* Server assigned to connection request, we have to try to connect now */ @@ -2482,7 +2482,7 @@ void back_try_conn_req(struct stream *s) */ if (back_may_abort_req(req, s)) { s->conn_err_type |= STRM_ET_CONN_ABRT; - DBG_TRACE_STATE("connection aborted", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("connection aborted", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); goto abort_connection; } @@ -2495,7 +2495,7 @@ void back_try_conn_req(struct stream *s) srv_inc_sess_ctr(srv); if (srv) srv_set_sess_last(srv); - DBG_TRACE_STATE("connection attempt", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("connection attempt", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); goto end; } @@ -2535,7 +2535,7 @@ void back_try_conn_req(struct stream *s) sc->state = SC_ST_CLO; if (s->srv_error) s->srv_error(s, sc); - DBG_TRACE_STATE("internal error during connection", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("internal error during connection", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); goto end; } @@ -2547,7 +2547,7 @@ void back_try_conn_req(struct stream *s) sc->flags &= ~SC_FL_ERROR; back_handle_st_cer(s); - DBG_TRACE_STATE("connection error, retry", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("connection error, retry", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); /* now sc->state is one of SC_ST_CLO, SC_ST_TAR, SC_ST_ASS, SC_ST_REQ */ } else if (sc->state == SC_ST_QUE) { @@ -2565,7 +2565,7 @@ void back_try_conn_req(struct stream *s) s->logs.t_queue = ns_to_ms(now_ns - s->logs.accept_ts); sc->state = SC_ST_ASS; } - DBG_TRACE_STATE("dequeue connection request", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("dequeue connection request", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); goto end; } @@ -2591,7 +2591,7 @@ void back_try_conn_req(struct stream *s) sc->state = SC_ST_CLO; if (s->srv_error) s->srv_error(s, sc); - DBG_TRACE_STATE("connection request still queued", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("connection request still queued", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); goto end; } @@ -2603,7 +2603,7 @@ void back_try_conn_req(struct stream *s) pendconn_cond_unlink(s->pend_pos); s->conn_err_type |= STRM_ET_QUEUE_ABRT; - DBG_TRACE_STATE("abort queued connection request", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("abort queued connection request", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); goto abort_connection; } @@ -2613,7 +2613,7 @@ void back_try_conn_req(struct stream *s) /* Connection request might be aborted */ if (back_may_abort_req(req, s)) { s->conn_err_type |= STRM_ET_CONN_ABRT; - DBG_TRACE_STATE("connection aborted", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("connection aborted", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); goto abort_connection; } @@ -2632,11 +2632,11 @@ void back_try_conn_req(struct stream *s) else sc->state = SC_ST_REQ; - DBG_TRACE_STATE("retry connection now", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("retry connection now", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); } end: - DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); return; abort_connection: @@ -2648,7 +2648,7 @@ abort_connection: sc->state = SC_ST_CLO; if (s->srv_error) s->srv_error(s, sc); - DBG_TRACE_DEVEL("leaving on error", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_DEVEL("leaving on error", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); return; } @@ -2665,7 +2665,7 @@ void back_handle_st_req(struct stream *s) if (sc->state != SC_ST_REQ) return; - DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); if (unlikely(obj_type(s->target) == OBJ_TYPE_APPLET)) { struct appctx *appctx = sc_appctx(sc); @@ -2686,10 +2686,10 @@ void back_handle_st_req(struct stream *s) sc->state = SC_ST_CLO; if (s->srv_error) s->srv_error(s, sc); - DBG_TRACE_STATE("failed to register applet", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("failed to register applet", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); goto end; } - DBG_TRACE_STATE("applet registered", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("applet registered", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); } BUG_ON(appctx->applet != __objt_applet(s->target)); @@ -2698,7 +2698,7 @@ void back_handle_st_req(struct stream *s) sc_will_read(sc); applet_need_more_data(appctx); appctx_wakeup(appctx); - DBG_TRACE_STATE("applet ready", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("applet ready", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); goto end; } @@ -2708,7 +2708,7 @@ void back_handle_st_req(struct stream *s) * connection request, or we encountered an error. */ if (sc->state == SC_ST_QUE) { - DBG_TRACE_STATE("connection request queued", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("connection request queued", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); goto end; } @@ -2721,7 +2721,7 @@ void back_handle_st_req(struct stream *s) sc->state = SC_ST_CLO; if (s->srv_error) s->srv_error(s, sc); - DBG_TRACE_STATE("connection request failed", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("connection request failed", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); goto end; } @@ -2729,10 +2729,10 @@ void back_handle_st_req(struct stream *s) s->logs.t_queue = ns_to_ms(now_ns - s->logs.accept_ts); sc->state = SC_ST_ASS; be_set_sess_last(s->be); - DBG_TRACE_STATE("connection request assigned to a server", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("connection request assigned to a server", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); end: - DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); } /* This function is called with (sc->state == SC_ST_CON) meaning that a @@ -2747,7 +2747,7 @@ void back_handle_st_con(struct stream *s) struct stconn *sc = s->scb; struct channel *req = &s->req; - DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); /* the client might want to abort */ if ((s->scf->flags & SC_FL_SHUT_DONE) || @@ -2759,7 +2759,7 @@ void back_handle_st_con(struct stream *s) if (s->srv_error) s->srv_error(s, sc); /* Note: state = SC_ST_DIS now */ - DBG_TRACE_STATE("client abort during connection attempt", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("client abort during connection attempt", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); goto end; } @@ -2774,11 +2774,11 @@ void back_handle_st_con(struct stream *s) } sc->state = SC_ST_CER; - DBG_TRACE_STATE("connection failed, retry", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("connection failed, retry", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); } end: - DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); } /* This function is called with (sc->state == SC_ST_CER) meaning that a @@ -2795,7 +2795,7 @@ void back_handle_st_cer(struct stream *s) struct stconn *sc = s->scb; int must_tar = !!(sc->flags & SC_FL_ERROR); - DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); s->conn_exp = TICK_ETERNITY; s->flags &= ~SF_CONN_EXP; @@ -2830,7 +2830,7 @@ void back_handle_st_cer(struct stream *s) * client provoke retries. */ s->conn_retries = s->max_retries; - DBG_TRACE_DEVEL("Bad SSL cert, disable connection retries", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_DEVEL("Bad SSL cert, disable connection retries", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); } } @@ -2856,7 +2856,7 @@ void back_handle_st_cer(struct stream *s) if (s->srv_error) s->srv_error(s, sc); - DBG_TRACE_STATE("connection failed", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("connection failed", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); goto end; } @@ -2890,7 +2890,7 @@ void back_handle_st_cer(struct stream *s) if (s->srv_error) s->srv_error(s, sc); - DBG_TRACE_STATE("error resetting endpoint", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("error resetting endpoint", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); goto end; } @@ -2922,11 +2922,11 @@ void back_handle_st_cer(struct stream *s) sc->state = SC_ST_TAR; s->conn_exp = tick_add(now_ms, MS_TO_TICKS(delay)); } - DBG_TRACE_STATE("retry a new connection", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("retry a new connection", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); } end: - DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); } /* This function is called with (sc->state == SC_ST_RDY) meaning that a @@ -2941,7 +2941,7 @@ void back_handle_st_rdy(struct stream *s) struct stconn *sc = s->scb; struct channel *req = &s->req; - DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); if (unlikely(obj_type(s->target) == OBJ_TYPE_APPLET)) { /* Here the appctx must exists because the SC was set to @@ -2984,7 +2984,7 @@ void back_handle_st_rdy(struct stream *s) s->conn_err_type |= STRM_ET_CONN_ABRT; if (s->srv_error) s->srv_error(s, sc); - DBG_TRACE_STATE("client abort during connection attempt", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("client abort during connection attempt", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); goto end; } @@ -2993,7 +2993,7 @@ void back_handle_st_rdy(struct stream *s) if (!s->conn_err_type) s->conn_err_type = STRM_ET_CONN_ERR; sc->state = SC_ST_CER; - DBG_TRACE_STATE("connection failed, retry", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("connection failed, retry", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); goto end; } } @@ -3001,12 +3001,12 @@ void back_handle_st_rdy(struct stream *s) /* data were sent and/or we had no error, back_establish() will * now take over. */ - DBG_TRACE_STATE("connection established", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_STATE("connection established", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); s->conn_err_type = STRM_ET_NONE; sc->state = SC_ST_EST; end: - DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); } /* sends a log message when a backend goes down, and also sets last @@ -3040,7 +3040,7 @@ int tcp_persist_rdp_cookie(struct stream *s, struct channel *req, int an_bit) uint32_t addr; char *p; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); if (s->flags & SF_ASSIGNED) goto no_cookie; @@ -3082,7 +3082,7 @@ int tcp_persist_rdp_cookie(struct stream *s, struct channel *req, int an_bit) no_cookie: req->analysers &= ~an_bit; req->analyse_exp = TICK_ETERNITY; - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); return 1; } diff --git a/src/http_ana.c b/src/http_ana.c index d0e77c437..b85dec1c4 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -98,7 +98,7 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit) struct htx_sl *sl; char http_ver; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); if (unlikely(!IS_HTX_STRM(s))) { /* It is only possible when a TCP stream is upgrade to HTTP. @@ -121,10 +121,10 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit) stream_abort(s); req->analysers &= AN_REQ_FLT_END; req->analyse_exp = TICK_ETERNITY; - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA, s); + TRACE_LEAVE(STRM_EV_STRM_ANA, s); return 1; } - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA, s); + TRACE_LEAVE(STRM_EV_STRM_ANA, s); return 0; } @@ -358,7 +358,7 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit) req->analysers &= ~an_bit; req->analyse_exp = TICK_ETERNITY; - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 1; return_int_err: @@ -385,7 +385,7 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit) http_set_term_flags(s); http_reply_and_close(s, txn->status, http_error_message(s)); - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; } @@ -410,7 +410,7 @@ int http_process_req_common(struct stream *s, struct channel *req, int an_bit, s struct connection *conn = objt_conn(sess->origin); int stats_rules = 0; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); htx = htxbuf(&req->buf); @@ -573,7 +573,7 @@ int http_process_req_common(struct stream *s, struct channel *req, int an_bit, s done_without_exp: /* done with this analyser, but don't reset the analyse_exp. */ req->analysers &= ~an_bit; s->current_rule = s->current_rule_list = NULL; - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 1; tarpit: @@ -672,19 +672,19 @@ int http_process_req_common(struct stream *s, struct channel *req, int an_bit, s req->analysers &= AN_REQ_FLT_END; req->analyse_exp = TICK_ETERNITY; s->current_rule = s->current_rule_list = NULL; - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; return_prx_yield: channel_dont_connect(req); - DBG_TRACE_DEVEL("waiting for more data", + TRACE_DEVEL("waiting for more data", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; return_prx_fyield: channel_dont_connect(req); - DBG_TRACE_DEVEL("forced yield", + TRACE_DEVEL("forced yield", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; } @@ -701,7 +701,7 @@ int http_process_request(struct stream *s, struct channel *req, int an_bit) struct htx *htx; struct connection *cli_conn = objt_conn(strm_sess(s)->origin); - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); /* * Right now, we know that we have processed the entire headers @@ -785,7 +785,7 @@ int http_process_request(struct stream *s, struct channel *req, int an_bit) s->logs.request_ts = now_ns; /* OK let's go on with the BODY now */ - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 1; return_fail_rewrite: @@ -816,7 +816,7 @@ int http_process_request(struct stream *s, struct channel *req, int an_bit) http_set_term_flags(s); http_reply_and_close(s, txn->status, http_error_message(s)); - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; } @@ -829,7 +829,7 @@ int http_process_tarpit(struct stream *s, struct channel *req, int an_bit) { struct http_txn *txn = s->txn.http; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, &txn->req); + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, &txn->req); /* This connection is being tarpitted. The CLIENT side has * already set the connect expiration date to the right * timeout. We just have to check that the client is still @@ -840,7 +840,7 @@ int http_process_tarpit(struct stream *s, struct channel *req, int an_bit) !tick_is_expired(req->analyse_exp, now_ms)) { /* Be sure to drain all data from the request channel */ channel_htx_erase(req, htxbuf(&req->buf)); - DBG_TRACE_DEVEL("waiting for tarpit timeout expiry", + TRACE_DEVEL("waiting for tarpit timeout expiry", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; } @@ -858,7 +858,7 @@ int http_process_tarpit(struct stream *s, struct channel *req, int an_bit) http_set_term_flags(s); http_reply_and_close(s, txn->status, (!(s->scf->flags & SC_FL_ERROR) ? http_error_message(s) : NULL)); - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; } @@ -875,7 +875,7 @@ int http_wait_for_request_body(struct stream *s, struct channel *req, int an_bit struct session *sess = s->sess; struct http_txn *txn = s->txn.http; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, &s->txn.http->req); @@ -904,12 +904,12 @@ int http_wait_for_request_body(struct stream *s, struct channel *req, int an_bit s->logs.request_ts = now_ns; /* update the request timer to reflect full request */ req->analysers &= ~an_bit; req->analyse_exp = TICK_ETERNITY; - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 1; missing_data_or_waiting: channel_dont_connect(req); - DBG_TRACE_DEVEL("waiting for more data", + TRACE_DEVEL("waiting for more data", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; @@ -945,7 +945,7 @@ int http_wait_for_request_body(struct stream *s, struct channel *req, int an_bit req->analysers &= AN_REQ_FLT_END; req->analyse_exp = TICK_ETERNITY; - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; } @@ -969,7 +969,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit) short status = 0; int ret; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); htx = htxbuf(&req->buf); @@ -1079,7 +1079,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit) http_end_request(s); if (!(req->analysers & an_bit)) { - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 1; } @@ -1100,7 +1100,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit) * on some systems (eg: Linux). */ channel_auto_read(req); } - DBG_TRACE_DEVEL("waiting for the end of the HTTP txn", + TRACE_DEVEL("waiting for the end of the HTTP txn", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; @@ -1143,7 +1143,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit) if (HAS_REQ_DATA_FILTERS(s)) s->scb->flags |= SC_FL_SND_EXP_MORE; - DBG_TRACE_DEVEL("waiting for more data to forward", + TRACE_DEVEL("waiting for more data to forward", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; @@ -1208,7 +1208,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit) txn->status = status; http_reply_and_close(s, txn->status, http_error_message(s)); } - DBG_TRACE_DEVEL("leaving on error ", + TRACE_DEVEL("leaving on error ", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; } @@ -1272,7 +1272,7 @@ static __inline int do_l7_retry(struct stream *s, struct stconn *sc) s->txn.http->l7_buffer = BUF_NULL; co_set_data(req, co_data); - DBG_TRACE_DEVEL("perform a L7 retry", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, + TRACE_DEVEL("perform a L7 retry", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, s->txn.http); b_reset(&res->buf); @@ -1304,7 +1304,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) struct htx_sl *sl; int n, l7_retry_failed = 0; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); htx = htxbuf(&rep->buf); @@ -1351,7 +1351,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) (s->be->retry_type & PR_RE_EARLY_ERROR) && conn && conn->err_code == CO_ER_SSL_EARLY_FAILED) { if (do_l7_retry(s, s->scb) == 0) { - DBG_TRACE_DEVEL("leaving on L7 retry", + TRACE_DEVEL("leaving on L7 retry", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; } @@ -1381,7 +1381,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) http_set_term_flags(s); http_reply_and_close(s, txn->status, http_error_message(s)); - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; } @@ -1394,7 +1394,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) if ((txn->flags & TX_L7_RETRY) && (s->be->retry_type & PR_RE_TIMEOUT)) { if (co_data(rep) || do_l7_retry(s, s->scb) == 0) { - DBG_TRACE_DEVEL("leaving on L7 retry", + TRACE_DEVEL("leaving on L7 retry", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; } @@ -1413,7 +1413,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) http_set_term_flags(s); http_reply_and_close(s, txn->status, http_error_message(s)); - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; } @@ -1439,7 +1439,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) http_reply_and_close(s, txn->status, http_error_message(s)); /* process_stream() will take care of the error */ - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; } @@ -1452,7 +1452,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) if ((txn->flags & TX_L7_RETRY) && (s->be->retry_type & PR_RE_DISCONNECTED)) { if (co_data(rep) || do_l7_retry(s, s->scb) == 0) { - DBG_TRACE_DEVEL("leaving on L7 retry", + TRACE_DEVEL("leaving on L7 retry", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; } @@ -1476,7 +1476,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) http_set_term_flags(s); http_reply_and_close(s, txn->status, http_error_message(s)); - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; } @@ -1498,14 +1498,14 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) /* process_stream() will take care of the error */ http_reply_and_close(s, txn->status, NULL); - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; } channel_dont_close(rep); s->scb->flags |= SC_FL_RCV_ONCE; /* try to get back here ASAP */ - DBG_TRACE_DEVEL("waiting for more data", + TRACE_DEVEL("waiting for more data", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; } @@ -1552,7 +1552,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) if ((txn->flags & TX_L7_RETRY) && l7_status_match(s->be, sl->info.res.status) && do_l7_retry(s, s->scb) == 0) { - DBG_TRACE_DEVEL("leaving on L7 retry", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); + TRACE_DEVEL("leaving on L7 retry", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; } @@ -1776,7 +1776,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) rep->analysers &= ~an_bit; rep->analyse_exp = TICK_ETERNITY; channel_auto_close(rep); - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 1; return_int_err: @@ -1798,7 +1798,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) if ((s->be->retry_type & PR_RE_JUNK_REQUEST) && (txn->flags & TX_L7_RETRY) && do_l7_retry(s, s->scb) == 0) { - DBG_TRACE_DEVEL("leaving on L7 retry", + TRACE_DEVEL("leaving on L7 retry", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; } @@ -1818,7 +1818,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) http_reply_and_close(s, txn->status, http_error_message(s)); s->scb->flags |= SC_FL_NOLINGER; - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; @@ -1832,7 +1832,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) s->logs.level = 0; s->scf->flags &= ~SC_FL_SND_EXP_MORE; /* speed up sending a previous response */ http_reply_and_close(s, txn->status, NULL); - DBG_TRACE_DEVEL("leaving by closing K/A connection", + TRACE_DEVEL("leaving by closing K/A connection", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; } @@ -1855,7 +1855,7 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s if (unlikely(msg->msg_state < HTTP_MSG_BODY)) /* we need more data */ return 0; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); htx = htxbuf(&rep->buf); @@ -2097,7 +2097,7 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s } done: - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); rep->analysers &= ~an_bit; rep->analyse_exp = TICK_ETERNITY; s->current_rule = s->current_rule_list = NULL; @@ -2170,19 +2170,19 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s s->req.analysers &= AN_REQ_FLT_END; rep->analyse_exp = TICK_ETERNITY; s->current_rule = s->current_rule_list = NULL; - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; return_prx_yield: channel_dont_close(rep); - DBG_TRACE_DEVEL("waiting for more data", + TRACE_DEVEL("waiting for more data", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; return_prx_fyield: channel_dont_close(rep); - DBG_TRACE_DEVEL("forced yield", + TRACE_DEVEL("forced yield", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; @@ -2225,7 +2225,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit struct htx *htx; int ret; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn, msg); htx = htxbuf(&res->buf); @@ -2331,10 +2331,10 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit http_end_response(s); if (!(res->analysers & an_bit)) { - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 1; } - DBG_TRACE_DEVEL("waiting for the end of the HTTP txn", + TRACE_DEVEL("waiting for the end of the HTTP txn", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; @@ -2376,7 +2376,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit s->scf->flags |= SC_FL_SND_EXP_MORE; /* the stream handler will take care of timeouts and errors */ - DBG_TRACE_DEVEL("waiting for more data to forward", + TRACE_DEVEL("waiting for more data to forward", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn); return 0; @@ -2437,7 +2437,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit /* don't send any error message as we're in the body */ http_set_term_flags(s); http_reply_and_close(s, txn->status, NULL); - DBG_TRACE_DEVEL("leaving on error", + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn); return 0; } @@ -4622,10 +4622,10 @@ static void http_end_request(struct stream *s) struct channel *chn = &s->req; struct http_txn *txn = s->txn.http; - DBG_TRACE_ENTER(STRM_EV_HTTP_ANA, s, txn); + TRACE_ENTER(STRM_EV_HTTP_ANA, s, txn); if (unlikely(txn->req.msg_state < HTTP_MSG_DONE)) { - DBG_TRACE_DEVEL("waiting end of the request", STRM_EV_HTTP_ANA, s, txn); + TRACE_DEVEL("waiting end of the request", STRM_EV_HTTP_ANA, s, txn); return; } @@ -4659,7 +4659,7 @@ static void http_end_request(struct stream *s) * backend SC is not closed, so we don't want to move in * order not to upset it. */ - DBG_TRACE_DEVEL("waiting end of the response", STRM_EV_HTTP_ANA, s, txn); + TRACE_DEVEL("waiting end of the response", STRM_EV_HTTP_ANA, s, txn); return; } @@ -4708,7 +4708,7 @@ static void http_end_request(struct stream *s) txn->req.msg_state = HTTP_MSG_CLOSED; goto http_msg_closed; } - DBG_TRACE_LEAVE(STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_HTTP_ANA, s, txn); return; } @@ -4742,7 +4742,7 @@ static void http_end_request(struct stream *s) } channel_auto_close(chn); channel_auto_read(chn); - DBG_TRACE_LEAVE(STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_HTTP_ANA, s, txn); } @@ -4754,10 +4754,10 @@ static void http_end_response(struct stream *s) struct channel *chn = &s->res; struct http_txn *txn = s->txn.http; - DBG_TRACE_ENTER(STRM_EV_HTTP_ANA, s, txn); + TRACE_ENTER(STRM_EV_HTTP_ANA, s, txn); if (unlikely(txn->rsp.msg_state < HTTP_MSG_DONE)) { - DBG_TRACE_DEVEL("waiting end of the response", STRM_EV_HTTP_ANA, s, txn); + TRACE_DEVEL("waiting end of the response", STRM_EV_HTTP_ANA, s, txn); return; } @@ -4775,7 +4775,7 @@ static void http_end_response(struct stream *s) * We have the choice of either breaking the connection * or letting it pass through. Let's do the later. */ - DBG_TRACE_DEVEL("waiting end of the request", STRM_EV_HTTP_ANA, s, txn); + TRACE_DEVEL("waiting end of the request", STRM_EV_HTTP_ANA, s, txn); return; } @@ -4813,7 +4813,7 @@ static void http_end_response(struct stream *s) txn->rsp.msg_state = HTTP_MSG_CLOSED; goto http_msg_closed; } - DBG_TRACE_LEAVE(STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_HTTP_ANA, s, txn); return; } @@ -4844,7 +4844,7 @@ static void http_end_response(struct stream *s) } channel_auto_close(chn); channel_auto_read(chn); - DBG_TRACE_LEAVE(STRM_EV_HTTP_ANA, s, txn); + TRACE_LEAVE(STRM_EV_HTTP_ANA, s, txn); } /* Forward a response generated by HAProxy (error/redirect/return). This diff --git a/src/stream.c b/src/stream.c index bf9fd4486..cb5032778 100644 --- a/src/stream.c +++ b/src/stream.c @@ -392,7 +392,7 @@ void *stream_new(struct session *sess, struct stconn *sc, struct buffer *input) struct stream *s; struct task *t; - DBG_TRACE_ENTER(STRM_EV_STRM_NEW); + TRACE_ENTER(STRM_EV_STRM_NEW); if (unlikely((s = pool_alloc(pool_head_stream)) == NULL)) goto out_fail_alloc; @@ -641,7 +641,7 @@ void *stream_new(struct session *sess, struct stconn *sc, struct buffer *input) * stream is fully initialized before calling task_wakeup. So * the caller must handle the task_wakeup */ - DBG_TRACE_LEAVE(STRM_EV_STRM_NEW, s); + TRACE_LEAVE(STRM_EV_STRM_NEW, s); task_wakeup(s->task, TASK_WOKEN_INIT); return s; @@ -659,7 +659,7 @@ void *stream_new(struct session *sess, struct stconn *sc, struct buffer *input) if (s) pool_free(pool_head_strm_memslot, s->memory_slot); pool_free(pool_head_stream, s); - DBG_TRACE_DEVEL("leaving on error", STRM_EV_STRM_NEW|STRM_EV_STRM_ERR); + TRACE_DEVEL("leaving on error", STRM_EV_STRM_NEW|STRM_EV_STRM_ERR); return NULL; } @@ -674,7 +674,7 @@ void stream_free(struct stream *s) int i; int flush_pools = 0; - DBG_TRACE_POINT(STRM_EV_STRM_FREE, s); + TRACE_POINT(STRM_EV_STRM_FREE, s); /* detach the stream from its own task before even releasing it so * that walking over a task list never exhibits a dying stream. @@ -1070,7 +1070,7 @@ void back_establish(struct stream *s) struct channel *rep = &s->res; uint8_t do_log = 0; - DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); /* First, centralize the timers information, and clear any irrelevant * timeout. */ @@ -1083,7 +1083,7 @@ void back_establish(struct stream *s) s->req.flags |= CF_WRITE_EVENT; s->res.flags |= CF_READ_EVENT; s->conn_err_type = STRM_ET_DATA_ERR; - DBG_TRACE_STATE("read/write error", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("read/write error", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); } if (objt_server(s->target)) @@ -1137,10 +1137,10 @@ void back_establish(struct stream *s) * left to send, or can't, switch to SC_ST_DIS now. */ if ((s->scb->flags & (SC_FL_EOS|SC_FL_ABRT_DONE)) || (s->scf->flags & SC_FL_SHUT_DONE)) { s->scb->state = SC_ST_DIS; - DBG_TRACE_STATE("response channel shutdwn for read/write", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); + TRACE_STATE("response channel shutdwn for read/write", STRM_EV_STRM_PROC|STRM_EV_CS_ST|STRM_EV_STRM_ERR, s); } - DBG_TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + TRACE_LEAVE(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); } /* Set correct stream termination flags in case no analyser has done it. It @@ -1269,7 +1269,7 @@ static int process_switching_rules(struct stream *s, struct channel *req, int an req->analysers &= ~an_bit; req->analyse_exp = TICK_ETERNITY; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA, s); + TRACE_ENTER(STRM_EV_STRM_ANA, s); /* now check whether we have some switching rules for this request */ if (!(s->flags & SF_BE_ASSIGNED)) { @@ -1316,7 +1316,7 @@ static int process_switching_rules(struct stream *s, struct channel *req, int an if (!backend) { if ((s->flags & SF_IGNORE)) { /* TCP stream upgrade to HTTP/2. */ - DBG_TRACE_DEVEL("leaving with no backend because of a destructive upgrade", STRM_EV_STRM_ANA, s); + TRACE_DEVEL("leaving with no backend because of a destructive upgrade", STRM_EV_STRM_ANA, s); return 0; } @@ -1373,7 +1373,7 @@ static int process_switching_rules(struct stream *s, struct channel *req, int an break; } - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA, s); + TRACE_LEAVE(STRM_EV_STRM_ANA, s); return 1; sw_failed: @@ -1389,7 +1389,7 @@ static int process_switching_rules(struct stream *s, struct channel *req, int an s->txn.http->status = 500; s->req.analysers &= AN_REQ_FLT_END; s->req.analyse_exp = TICK_ETERNITY; - DBG_TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_STRM_ERR, s); + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_STRM_ERR, s); return 0; } @@ -1403,7 +1403,7 @@ static int process_server_rules(struct stream *s, struct channel *req, int an_bi struct session *sess = s->sess; struct server_rule *rule; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA, s); + TRACE_ENTER(STRM_EV_STRM_ANA, s); if (!(s->flags & SF_ASSIGNED)) { list_for_each_entry(rule, &px->server_rules, list) { @@ -1440,7 +1440,7 @@ static int process_server_rules(struct stream *s, struct channel *req, int an_bi req->analysers &= ~an_bit; req->analyse_exp = TICK_ETERNITY; - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA, s); + TRACE_LEAVE(STRM_EV_STRM_ANA, s); return 1; } @@ -1497,7 +1497,7 @@ static int process_sticking_rules(struct stream *s, struct channel *req, int an_ struct session *sess = s->sess; struct sticking_rule *rule; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA, s); + TRACE_ENTER(STRM_EV_STRM_ANA, s); list_for_each_entry(rule, &px->sticking_rules, list) { struct stktable_key *key; @@ -1551,7 +1551,7 @@ static int process_sticking_rules(struct stream *s, struct channel *req, int an_ req->analysers &= ~an_bit; req->analyse_exp = TICK_ETERNITY; - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA, s); + TRACE_LEAVE(STRM_EV_STRM_ANA, s); return 1; } @@ -1567,7 +1567,7 @@ static int process_store_rules(struct stream *s, struct channel *rep, int an_bit int i; int nbreq = s->store_count; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA, s); + TRACE_ENTER(STRM_EV_STRM_ANA, s); list_for_each_entry(rule, &px->storersp_rules, list) { struct stktable_key *key; @@ -1660,7 +1660,7 @@ static int process_store_rules(struct stream *s, struct channel *rep, int an_bit rep->analysers &= ~an_bit; rep->analyse_exp = TICK_ETERNITY; - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA, s); + TRACE_LEAVE(STRM_EV_STRM_ANA, s); return 1; } @@ -1950,7 +1950,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) scf = s->scf; scb = s->scb; - DBG_TRACE_ENTER(STRM_EV_STRM_PROC, s); + TRACE_ENTER(STRM_EV_STRM_PROC, s); /* This flag must explicitly be set every time */ req->flags &= ~CF_WAKE_WRITE; @@ -2118,7 +2118,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) rp_prod_last = scb->state; /* Check for connection closure */ - DBG_TRACE_POINT(STRM_EV_STRM_PROC, s); + TRACE_POINT(STRM_EV_STRM_PROC, s); /* nothing special to be done on client side */ if (unlikely(scf->state == SC_ST_DIS)) { @@ -2625,7 +2625,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) b_free(&req->buf); offer_buffers(s, 1); req->buf = sbuf; - DBG_TRACE_DEVEL("request moved to a small buffer", STRM_EV_STRM_PROC, s); + TRACE_DEVEL("request moved to a small buffer", STRM_EV_STRM_PROC, s); } } while (scb->state == SC_ST_ASS); @@ -2839,11 +2839,11 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) s->pending_events &= ~STRM_EVT_TIMER; stream_release_buffers(s); - DBG_TRACE_DEVEL("queuing", STRM_EV_STRM_PROC, s); + TRACE_DEVEL("queuing", STRM_EV_STRM_PROC, s); return t; /* nothing more to do */ } - DBG_TRACE_DEVEL("releasing", STRM_EV_STRM_PROC, s); + TRACE_DEVEL("releasing", STRM_EV_STRM_PROC, s); if (s->flags & SF_BE_ASSIGNED) _HA_ATOMIC_DEC(&s->be->beconn); diff --git a/src/tcp_rules.c b/src/tcp_rules.c index 3ba85fdc9..cdc5bc24b 100644 --- a/src/tcp_rules.c +++ b/src/tcp_rules.c @@ -100,7 +100,7 @@ int tcp_inspect_request(struct stream *s, struct channel *req, int an_bit) int partial; int act_opts = 0; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); def_rules = ((s->be->defpx && (sess->fe->mode == PR_MODE_TCP || sess->fe->mode == PR_MODE_HTTP) && @@ -253,7 +253,7 @@ resume_execution: req->analysers &= ~an_bit; s->current_rule = s->current_rule_list = NULL; req->analyse_exp = s->rules_exp = TICK_ETERNITY; - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); return 1; missing_data: @@ -262,7 +262,7 @@ resume_execution: if (!tick_isset(s->rules_exp) && s->be->tcp_req.inspect_delay) s->rules_exp = tick_add(now_ms, s->be->tcp_req.inspect_delay); req->analyse_exp = tick_first((tick_is_expired(req->analyse_exp, now_ms) ? 0 : req->analyse_exp), s->rules_exp); - DBG_TRACE_DEVEL("waiting for more data", STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); + TRACE_DEVEL("waiting for more data", STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); return 0; deny: @@ -304,7 +304,7 @@ resume_execution: s->flags |= SF_ERR_PRXCOND; if (!(s->flags & SF_FINST_MASK)) s->flags |= SF_FINST_R; - DBG_TRACE_DEVEL("leaving on error|deny|abort", STRM_EV_STRM_ANA|STRM_EV_TCP_ANA|STRM_EV_TCP_ERR, s); + TRACE_DEVEL("leaving on error|deny|abort", STRM_EV_STRM_ANA|STRM_EV_TCP_ANA|STRM_EV_TCP_ERR, s); return 0; } @@ -322,7 +322,7 @@ int tcp_inspect_response(struct stream *s, struct channel *rep, int an_bit) int partial; int act_opts = 0; - DBG_TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); + TRACE_ENTER(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); def_rules = (s->be->defpx && (s->be->mode == PR_MODE_TCP || s->be->mode == PR_MODE_HTTP) ? &s->be->defpx->tcp_rep.inspect_rules : NULL); rules = &s->be->tcp_rep.inspect_rules; @@ -481,7 +481,7 @@ resume_execution: rep->analysers &= ~an_bit; s->current_rule = s->current_rule_list = NULL; rep->analyse_exp = s->rules_exp = TICK_ETERNITY; - DBG_TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); + TRACE_LEAVE(STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); return 1; missing_data: @@ -490,7 +490,7 @@ resume_execution: if (!tick_isset(s->rules_exp) && s->be->tcp_rep.inspect_delay) s->rules_exp = tick_add(now_ms, s->be->tcp_rep.inspect_delay); rep->analyse_exp = tick_first((tick_is_expired(rep->analyse_exp, now_ms) ? 0 : rep->analyse_exp), s->rules_exp); - DBG_TRACE_DEVEL("waiting for more data", STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); + TRACE_DEVEL("waiting for more data", STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s); return 0; deny: @@ -539,7 +539,7 @@ resume_execution: s->flags |= SF_ERR_PRXCOND; if (!(s->flags & SF_FINST_MASK)) s->flags |= SF_FINST_D; - DBG_TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_TCP_ANA|STRM_EV_TCP_ERR, s); + TRACE_DEVEL("leaving on error", STRM_EV_STRM_ANA|STRM_EV_TCP_ANA|STRM_EV_TCP_ERR, s); return 0; }