From: Jérémie Galarneau Date: Tue, 14 Nov 2017 02:16:18 +0000 (-0500) Subject: Fix: nonsensical message printed by lttng track/untrack X-Git-Tag: v2.11.0-rc1~426 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=efcbc78c435a4ce7689ab6920b35e78372aa0194;hp=18d0885089aafd5665cea5fcff8a7a467b6ff37d Fix: nonsensical message printed by lttng track/untrack 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 --- diff --git a/src/bin/lttng/commands/track-untrack.c b/src/bin/lttng/commands/track-untrack.c index da515b1a9..6db4288c5 100644 --- a/src/bin/lttng/commands/track-untrack.c +++ b/src/bin/lttng/commands/track-untrack.c @@ -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; }