Cleanup list command printout for loglevel
[lttng-tools.git] / src / bin / lttng / commands / list.c
index 3bac86ecdcd93220653c4119111dc542527d4a49..e4ab97cbe920c67c385e30fceccb8a68a271a145 100644 (file)
@@ -196,11 +196,10 @@ static void print_events(struct lttng_event *event)
        switch (event->type) {
        case LTTNG_EVENT_TRACEPOINT:
        {
-               MSG("%s%s%s%s%d%s (type: tracepoint)%s", indent6,
+               MSG("%s%s%s%s%s (type: tracepoint)%s", indent6,
                                event->name,
                                loglevel_string_pre(event->loglevel),
                                loglevel_string(event->loglevel),
-                               event->loglevel,
                                loglevel_string_post(event->loglevel),
                                enabled_string(event->enabled));
                break;
@@ -480,7 +479,8 @@ static int list_sessions(const char *session_name)
                        continue;
                }
 
-               MSG("  %d) %s (%s)%s", i + 1, sessions[i].name, sessions[i].path, active_string(sessions[i].enabled));
+               MSG("  %d) %s (%s)%s", i + 1, sessions[i].name, sessions[i].path,
+                               active_string(sessions[i].enabled));
 
                if (session_found) {
                        break;
@@ -490,7 +490,9 @@ static int list_sessions(const char *session_name)
        free(sessions);
 
        if (!session_found && session_name != NULL) {
-               ERR("Session %s not found", session_name);
+               ERR("Session '%s' not found", session_name);
+               ret = CMD_ERROR;
+               goto error;
        }
 
        if (session_name == NULL) {
@@ -601,7 +603,7 @@ int cmd_list(int argc, const char **argv)
        if (session_name == NULL) {
                if (!opt_kernel && !opt_userspace) {
                        ret = list_sessions(NULL);
-                       if (ret < 0) {
+                       if (ret != 0) {
                                goto end;
                        }
                }
@@ -620,7 +622,7 @@ int cmd_list(int argc, const char **argv)
        } else {
                /* List session attributes */
                ret = list_sessions(session_name);
-               if (ret < 0) {
+               if (ret != 0) {
                        goto end;
                }
 
This page took 0.026449 seconds and 5 git commands to generate.