From: David Goulet Date: Wed, 26 Feb 2014 18:22:32 +0000 (-0500) Subject: Fix: add loglevel type to lttng list X-Git-Tag: v2.5.0-rc1~147 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=1f0e17de5dc2c936acb87fde4fe92be546f03500 Fix: add loglevel type to lttng list For range loglevel, the <= is used and for single ==. For instance: ev_log_range (loglevel <= TRACE_WARNING (4)) (type: tracepoint) ev_log_single (loglevel == TRACE_NOTICE (5)) (type: tracepoint) Fixes #628 Signed-off-by: David Goulet --- diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 66a322a06..1a46bb72b 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -217,6 +217,18 @@ static const char *loglevel_string(int value) } } +static const char *logleveltype_string(enum lttng_loglevel_type value) +{ + switch (value) { + case LTTNG_EVENT_LOGLEVEL_RANGE: + return "<="; + case LTTNG_EVENT_LOGLEVEL_SINGLE: + return "=="; + default: + return "<>"; + } +} + /* * Pretty print single event. */ @@ -226,9 +238,10 @@ static void print_events(struct lttng_event *event) case LTTNG_EVENT_TRACEPOINT: { if (event->loglevel != -1) { - MSG("%s%s (loglevel: %s (%d)) (type: tracepoint)%s%s%s", + MSG("%s%s (loglevel %s %s (%d)) (type: tracepoint)%s%s%s", indent6, event->name, + logleveltype_string(event->loglevel_type), loglevel_string(event->loglevel), event->loglevel, enabled_string(event->enabled),