Fix: nonsensical message printed by lttng track/untrack
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 14 Nov 2017 02:16:18 +0000 (21:16 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 14 Nov 2017 02:17:56 +0000 (21:17 -0500)
The lttng track/untrack command, when used to track/untrack all
PIDs, prints a message of the following form:

"PID -1 untracked in session auto-20171113-210309"

This is because -1 is taken to mean "all" by the API and is used
as-is to print the message on the CLI.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/track-untrack.c

index da515b1a9c1d6b189ddb9bfc89bd667b96012f54..6db4288c59ec471cf181a8429dfa424a0ff75762 100644 (file)
@@ -257,8 +257,14 @@ enum cmd_error_code track_untrack_pid(enum cmd_type cmd_type, const char *cmd_st
                                break;
                        }
                } else {
-                       MSG("PID %i %sed in session %s",
-                                       pid_list[i], cmd_str, session_name);
+                       if (pid_list[i] != -1) {
+                               MSG("PID %i %sed in session %s",
+                                               pid_list[i], cmd_str,
+                                               session_name);
+                       } else {
+                               MSG("All PIDs %sed in session %s",
+                                               cmd_str, session_name);
+                       }
                        success = 1;
                }
 
This page took 0.026891 seconds and 4 git commands to generate.