X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=lttng%2Fcommands%2Flist.c;h=8c1dadac8e5dc66bddebe81d7a564c9fc7c20555;hp=4b29d4dc98dced934593c6f1317a6fb1730440d2;hb=e4baff1ed855ca743e95068ca6449fd906d2d833;hpb=13dce3b738049495c54e14b7401c6f2aa421f5ed diff --git a/lttng/commands/list.c b/lttng/commands/list.c index 4b29d4dc9..8c1dadac8 100644 --- a/lttng/commands/list.c +++ b/lttng/commands/list.c @@ -134,19 +134,21 @@ const char *enabled_string(int value) static const char *loglevel_string_pre(const char *loglevel) { - if (loglevel[0] == '\0') + if (loglevel[0] == '\0') { return ""; - else + } else { return " (loglevel: "; + } } static const char *loglevel_string_post(const char *loglevel) { - if (loglevel[0] == '\0') + if (loglevel[0] == '\0') { return ""; - else + } else { return ")"; + } } /* @@ -156,13 +158,26 @@ 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, + { + char ll_value[LTTNG_SYMBOL_NAME_LEN] = ""; + + if (event->loglevel[0] != '\0') { + int ret; + + ret = snprintf(ll_value, LTTNG_SYMBOL_NAME_LEN, + ", %lld", (long long) event->loglevel_value); + if (ret < 0) + ERR("snprintf error"); + } + MSG("%s%s%s%s%s%s (type: tracepoint)%s", indent6, event->name, loglevel_string_pre(event->loglevel), event->loglevel, + ll_value, loglevel_string_post(event->loglevel), enabled_string(event->enabled)); break; + } case LTTNG_EVENT_PROBE: MSG("%s%s (type: probe)%s", indent6, event->name, enabled_string(event->enabled)); @@ -189,7 +204,8 @@ static void print_events(struct lttng_event *event) break; case LTTNG_EVENT_TRACEPOINT_LOGLEVEL: MSG("%s%s (type: tracepoint loglevel)%s", indent6, - event->name, enabled_string(event->enabled)); + event->name, + enabled_string(event->enabled)); break; case LTTNG_EVENT_ALL: /* We should never have "all" events in list. */