From cc3083746886be8518d7c1c31541c6047a3ad43f Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 26 May 2017 22:23:41 -0400 Subject: [PATCH] cli: check for cancellation before running the graph, add relevant logging MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- cli/babeltrace.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cli/babeltrace.c b/cli/babeltrace.c index f63150a2..e547c40f 100644 --- a/cli/babeltrace.c +++ b/cli/babeltrace.c @@ -1736,6 +1736,13 @@ int cmd_run(struct bt_config *cfg) goto error; } + if (canceled) { + BT_LOGI_STR("Canceled by user before creating components."); + goto error; + } + + BT_LOGI_STR("Creating components."); + /* Create the requested component instances */ if (cmd_run_ctx_create_components(&ctx)) { BT_LOGE_STR("Cannot create components."); @@ -1743,6 +1750,13 @@ int cmd_run(struct bt_config *cfg) goto error; } + if (canceled) { + BT_LOGI_STR("Canceled by user before connecting components."); + goto error; + } + + BT_LOGI_STR("Connecting components."); + /* Connect the initially visible component ports */ if (cmd_run_ctx_connect_ports(&ctx)) { BT_LOGE_STR("Cannot connect initial component ports."); @@ -1751,7 +1765,8 @@ int cmd_run(struct bt_config *cfg) } if (canceled) { - goto end; + BT_LOGI_STR("Canceled by user before running the graph."); + goto error; } BT_LOGI_STR("Running the graph."); -- 2.34.1