From aacb37743add6586531f42c5fc2c6551bf7ffd71 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 2 Apr 2014 16:02:37 -0400 Subject: [PATCH] Change default loglevel to TRACE_DEBUG_LINE We do not want default loglevel to include tracef() debug output. Signed-off-by: Mathieu Desnoyers --- doc/man/lttng-ust.3 | 11 +++++++---- liblttng-ust/lttng-events.c | 11 ++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) 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; } } -- 2.34.1