From: Mathieu Desnoyers Date: Wed, 2 Apr 2014 20:02:37 +0000 (-0400) Subject: Change default loglevel to TRACE_DEBUG_LINE X-Git-Tag: v2.5.0-rc1~21 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=aacb37743add6586531f42c5fc2c6551bf7ffd71;p=lttng-ust.git Change default loglevel to TRACE_DEBUG_LINE We do not want default loglevel to include tracef() debug output. Signed-off-by: Mathieu Desnoyers --- diff --git a/doc/man/lttng-ust.3 b/doc/man/lttng-ust.3 index 61efa509..1d1197f4 100644 --- a/doc/man/lttng-ust.3 +++ b/doc/man/lttng-ust.3 @@ -29,12 +29,15 @@ tracef() API. To do it, in a nutshell: 3) Link your program against liblttng-ust.so. -4) Enable the UST event "lttng_ust_tracef:event" when tracing with the - following sequence of commands from lttng-tools: +4) Enable the UST debug loglevel when tracing with the following + sequence of commands from lttng-tools: - lttng create; lttng enable-event -u "lttng_ust_tracef:event"; lttng start + lttng create + lttng enable-event -u -a --loglevel=TRACE_DEBUG + lttng start [... run your program ...] - lttng stop; lttng view + lttng stop + lttng view That's it! diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index 03acff11..6dc7bfca 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -104,18 +104,23 @@ int lttng_loglevel_match(int loglevel, loglevel = TRACE_DEFAULT; switch (req_type) { case LTTNG_UST_LOGLEVEL_RANGE: - if (loglevel <= req_loglevel || req_loglevel == -1) + if (loglevel <= req_loglevel + || (req_loglevel == -1 && loglevel <= TRACE_DEFAULT)) return 1; else return 0; case LTTNG_UST_LOGLEVEL_SINGLE: - if (loglevel == req_loglevel || req_loglevel == -1) + if (loglevel == req_loglevel + || (req_loglevel == -1 && loglevel <= TRACE_DEFAULT)) return 1; else return 0; case LTTNG_UST_LOGLEVEL_ALL: default: - return 1; + if (loglevel <= TRACE_DEFAULT) + return 1; + else + return 0; } }