update loglevel printout
[lttng-tools.git] / lttng / commands / list.c
index 035269a5860ac8c43364ae2044f9f48be389c3fa..991ad28d6b01c7238fff29ee3cf912e651d1b826 100644 (file)
@@ -131,6 +131,26 @@ const char *enabled_string(int value)
        }
 }
 
+static
+const char *loglevel_string_pre(const char *loglevel)
+{
+       if (loglevel[0] == '\0') {
+               return "";
+       } else {
+               return " (loglevel: ";
+       }
+}
+
+static
+const char *loglevel_string_post(const char *loglevel)
+{
+       if (loglevel[0] == '\0') {
+               return "";
+       } else {
+               return ")";
+       }
+}
+
 /*
  * Pretty print single event.
  */
@@ -138,9 +158,26 @@ static void print_events(struct lttng_event *event)
 {
        switch (event->type) {
        case LTTNG_EVENT_TRACEPOINT:
-               MSG("%s%s (type: tracepoint)%s", indent6,
-                               event->name, enabled_string(event->enabled));
+       {
+               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));
@@ -165,6 +202,11 @@ static void print_events(struct lttng_event *event)
                MSG("%s (type: noop)%s", indent6,
                                enabled_string(event->enabled));
                break;
+       case LTTNG_EVENT_TRACEPOINT_LOGLEVEL:
+               MSG("%s%s (type: tracepoint loglevel)%s", indent6,
+                       event->name,
+                       enabled_string(event->enabled));
+               break;
        case LTTNG_EVENT_ALL:
                /* We should never have "all" events in list. */
                assert(0);
@@ -279,7 +321,7 @@ static int list_events(const char *channel_name)
 
        MSG("\n%sEvents:", indent4);
        if (count == 0) {
-               MSG("%sNone", indent6);
+               MSG("%sNone\n", indent6);
                goto end;
        }
 
@@ -482,7 +524,7 @@ error:
 int cmd_list(int argc, const char **argv)
 {
        int opt, i, ret = CMD_SUCCESS;
-       unsigned int nb_domain;
+       int nb_domain;
        const char *session_name;
        static poptContext pc;
        struct lttng_domain domain;
This page took 0.024158 seconds and 4 git commands to generate.