mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-11 03:31:36 +00:00
haproxy public development tree
TRACE_PRINTF() can be used to produce arbitrary trace contents at any trace level. It uses the exact same arguments as other TRACE_* macros, but here they are mandatory since they are followed by the format-string, though they may be filled with zeroes. The reason for the arguments is to match tracking or filtering and not pollute other non-inspected objects. It will probably be used inside loops, in which case there are two points to be careful about: - output atomicity is only per-message, so competing threads may see their messages interleaved. As such, it is recommended that the caller places a recognizable unique context at the beginning of the message such as a connection pointer. - iterating over arrays or lists for all requests could be very expensive. In order to avoid this it is best to condition the call via TRACE_ENABLED() with the same arguments, which will return the same decision. - messages longer than TRACE_MAX_MSG-1 (1023 by default) will be truncated. For example, in order to dump the list of HTTP headers between hpack and h2: if (outlen > 0 && TRACE_ENABLED(TRACE_LEVEL_DEVELOPER, H2_EV_RX_FRAME|H2_EV_RX_HDR, h2c->conn, 0, 0, 0)) { int i; for (i = 0; list[i].n.len; i++) TRACE_PRINTF(TRACE_LEVEL_DEVELOPER, H2_EV_RX_FRAME|H2_EV_RX_HDR, h2c->conn, 0, 0, 0, "h2c=%p hdr[%d]=%s:%s", h2c, i, list[i].n.ptr, list[i].v.ptr); } In addition, a lower-level TRACE_PRINTF_LOC() macro is provided, that takes two extra arguments, the caller's location and the caller's function name. This will allow to emit composite traces from central functions on the behalf of another one. |
||
---|---|---|
.github | ||
addons | ||
admin | ||
dev | ||
doc | ||
examples | ||
include | ||
reg-tests | ||
scripts | ||
src | ||
tests | ||
.cirrus.yml | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.travis.yml | ||
BRANCHES | ||
CHANGELOG | ||
CONTRIBUTING | ||
INSTALL | ||
LICENSE | ||
MAINTAINERS | ||
Makefile | ||
README | ||
SUBVERS | ||
VERDATE | ||
VERSION |
The HAProxy documentation has been split into a number of different files for ease of use. Please refer to the following files depending on what you're looking for : - INSTALL for instructions on how to build and install HAProxy - BRANCHES to understand the project's life cycle and what version to use - LICENSE for the project's license - CONTRIBUTING for the process to follow to submit contributions The more detailed documentation is located into the doc/ directory : - doc/intro.txt for a quick introduction on HAProxy - doc/configuration.txt for the configuration's reference manual - doc/lua.txt for the Lua's reference manual - doc/SPOE.txt for how to use the SPOE engine - doc/network-namespaces.txt for how to use network namespaces under Linux - doc/management.txt for the management guide - doc/regression-testing.txt for how to use the regression testing suite - doc/peers.txt for the peers protocol reference - doc/coding-style.txt for how to adopt HAProxy's coding style - doc/internals for developer-specific documentation (not all up to date)