From efcbc78c435a4ce7689ab6920b35e78372aa0194 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 13 Nov 2017 21:16:18 -0500 Subject: [PATCH] Fix: nonsensical message printed by lttng track/untrack MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng/commands/track-untrack.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; } -- 2.34.1