We do not want default loglevel to include tracef() debug output.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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!
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;
}
}