From: Mathieu Desnoyers Date: Fri, 10 Feb 2012 18:22:11 +0000 (-0500) Subject: Print loglevel value in list -u X-Git-Tag: v2.0-pre21~5 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8b703175f140287205a8dba654f0201b9947761d;p=lttng-tools.git Print loglevel value in list -u Signed-off-by: Mathieu Desnoyers --- diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index f7a5c576b..93758381c 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -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: