From: Philippe Proulx Date: Sat, 27 May 2017 02:23:41 +0000 (-0400) Subject: cli: check for cancellation before running the graph, add relevant logging X-Git-Tag: v2.0.0-pre1~133 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=cc3083746886be8518d7c1c31541c6047a3ad43f;p=babeltrace.git cli: check for cancellation before running the graph, add relevant logging Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- 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.");