listing and activation of loglevel by number
[lttng-tools.git] / lttng / commands / list.c
index 4b29d4dc98dced934593c6f1317a6fb1730440d2..8c1dadac8e5dc66bddebe81d7a564c9fc7c20555 100644 (file)
@@ -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. */
This page took 0.032026 seconds and 4 git commands to generate.