the libc fails to resolve an address, the startup sequence is not
interrupted.
+ -dt : activate traces on stderr. This enables all trace sources on error
+ level. This can notably be useful to detect protocol violations from
+ clients or servers.
+
-m <limit> : limit the total allocatable memory to <limit> megabytes across
all processes. This may cause some connection refusals or some slowdowns
depending on the amount of memory needed for normal operations. This is
void trace_register_source(struct trace_source *source);
+int trace_parse_cmd();
+
/* return a single char to describe a trace state */
static inline char trace_state_char(enum trace_state st)
{
#include <haproxy/thread.h>
#include <haproxy/time.h>
#include <haproxy/tools.h>
+#include <haproxy/trace.h>
#include <haproxy/uri_auth-t.h>
#include <haproxy/vars.h>
#include <haproxy/version.h>
" -v displays version ; -vv shows known build options.\n"
" -d enters debug mode ; -db only disables background mode.\n"
" -dM[<byte>,help,...] debug memory (default: poison with <byte>/0x50)\n"
+ " -dt activate traces on stderr\n"
" -V enters verbose mode (disables quiet mode)\n"
" -D goes daemon ; -C changes to <dir> before loading files.\n"
" -W master-worker mode.\n"
arg_mode |= MODE_DUMP_KWD;
kwd_dump = flag + 2;
}
+ else if (*flag == 'd' && flag[1] == 't') {
+ trace_parse_cmd();
+ }
else if (*flag == 'd')
arg_mode |= MODE_DEBUG;
else if (*flag == 'c' && flag[1] == 'c') {
}
+/* Parse a process argument specified via "-dt".
+ *
+ * Returns 0 on success else non-zero.
+ */
+int trace_parse_cmd()
+{
+ struct trace_source *src;
+
+ list_for_each_entry(src, &trace_sources, source_link) {
+ src->sink = sink_find("stderr");
+ src->level = TRACE_LEVEL_ERROR;
+ src->verbosity = 1;
+ src->state = TRACE_STATE_RUNNING;
+ }
+
+ return 0;
+}
+
/* parse a "trace" statement in the "global" section, returns 1 if a message is returned, otherwise zero */
static int cfg_parse_trace(char **args, int section_type, struct proxy *curpx,
const struct proxy *defpx, const char *file, int line,