Print loglevel value in list -u
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 10 Feb 2012 18:22:11 +0000 (13:22 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 10 Feb 2012 18:22:11 +0000 (13:22 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/bin/lttng/commands/list.c

index f7a5c576bc58b63e0bf4e8037551075a3161c78e..93758381c9678a9afb5554c9d220d9776f272afd 100644 (file)
@@ -144,26 +144,6 @@ const char *enabled_string(int value)
        }
 }
 
-static
-const char *loglevel_string_pre(int loglevel)
-{
-       if (loglevel == -1) {
-               return "";
-       } else {
-               return " (loglevel: ";
-       }
-}
-
-static
-const char *loglevel_string_post(int loglevel)
-{
-       if (loglevel == -1) {
-               return "";
-       } else {
-               return ")";
-       }
-}
-
 static const char *loglevel_string(int value)
 {
        switch (value) {
@@ -212,12 +192,19 @@ static void print_events(struct lttng_event *event)
        switch (event->type) {
        case LTTNG_EVENT_TRACEPOINT:
        {
-               MSG("%s%s%s%s%s (type: tracepoint)%s", indent6,
+               if (event->loglevel != -1) {
+                       MSG("%s%s (loglevel: %s (%d)) (type: tracepoint)%s",
+                               indent6,
                                event->name,
-                               loglevel_string_pre(event->loglevel),
                                loglevel_string(event->loglevel),
-                               loglevel_string_post(event->loglevel),
+                               event->loglevel,
                                enabled_string(event->enabled));
+               } else {
+                       MSG("%s%s (type: tracepoint)%s",
+                               indent6,
+                               event->name,
+                               enabled_string(event->enabled));
+               }
                break;
        }
        case LTTNG_EVENT_PROBE:
This page took 0.026811 seconds and 4 git commands to generate.