Change default loglevel to TRACE_DEBUG_LINE
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 2 Apr 2014 20:02:37 +0000 (16:02 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 2 Apr 2014 20:02:37 +0000 (16:02 -0400)
We do not want default loglevel to include tracef() debug output.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/man/lttng-ust.3
liblttng-ust/lttng-events.c

index 61efa5094611d39859a88761dff90cb4eabfccc6..1d1197f4672b18af258e29e48a8c0311a9f2940c 100644 (file)
@@ -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!
 
index 03acff110466405976fccdb509d85077377f532b..6dc7bfcaf40d89b73fcce0c936a8e560e6b0f4f8 100644 (file)
@@ -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;
        }
 }
 
This page took 0.034586 seconds and 4 git commands to generate.