Otherwise the CLI prints "unknown error" at the end. Now it prints:
ERROR: [Babeltrace CLI] (babeltrace2.c:2579)
Graph was canceled by user.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ia910e91d75586e30bb017bd9332615891606c115
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1659
Tested-by: jenkins <jenkins@lttng.org>
- BT_LOGI("Canceled by user before executing the query: "
+ BT_CLI_LOGW_APPEND_CAUSE(
+ "Canceled by user before executing the query: "
"comp-cls-addr=%p, comp-cls-name=\"%s\", "
"query-obj=\"%s\"", comp_cls,
bt_component_class_get_name(comp_cls), obj);
"comp-cls-addr=%p, comp-cls-name=\"%s\", "
"query-obj=\"%s\"", comp_cls,
bt_component_class_get_name(comp_cls), obj);
if (usleep(sleep_time_us)) {
if (bt_query_executor_is_canceled(the_query_executor)) {
if (usleep(sleep_time_us)) {
if (bt_query_executor_is_canceled(the_query_executor)) {
- BT_LOGI("Query was canceled by user: "
+ BT_CLI_LOGW_APPEND_CAUSE(
+ "Query was canceled by user: "
"comp-cls-addr=%p, comp-cls-name=\"%s\", "
"query-obj=\"%s\"", comp_cls,
bt_component_class_get_name(comp_cls),
"comp-cls-addr=%p, comp-cls-name=\"%s\", "
"query-obj=\"%s\"", comp_cls,
bt_component_class_get_name(comp_cls),
case BT_GRAPH_CONNECT_PORTS_STATUS_OK:
break;
case BT_GRAPH_CONNECT_PORTS_STATUS_CANCELED:
case BT_GRAPH_CONNECT_PORTS_STATUS_OK:
break;
case BT_GRAPH_CONNECT_PORTS_STATUS_CANCELED:
- BT_LOGI_STR("Graph was canceled by user.");
+ BT_CLI_LOGW_APPEND_CAUSE("Graph was canceled by user.");
break;
default:
BT_CLI_LOGE_APPEND_CAUSE(
break;
default:
BT_CLI_LOGE_APPEND_CAUSE(
- BT_LOGI_STR("Canceled by user before creating components.");
+ BT_CLI_LOGW_APPEND_CAUSE(
+ "Canceled by user before creating components.");
- BT_LOGI_STR("Canceled by user before connecting components.");
+ BT_CLI_LOGW_APPEND_CAUSE(
+ "Canceled by user before connecting components.");
- BT_LOGI_STR("Canceled by user before running the graph.");
+ BT_CLI_LOGW_APPEND_CAUSE(
+ "Canceled by user before running the graph.");
case BT_GRAPH_RUN_STATUS_OK:
break;
case BT_GRAPH_RUN_STATUS_CANCELED:
case BT_GRAPH_RUN_STATUS_OK:
break;
case BT_GRAPH_RUN_STATUS_CANCELED:
- BT_LOGI_STR("Graph was canceled by user.");
+ BT_CLI_LOGW_APPEND_CAUSE("Graph was canceled by user.");
goto error;
case BT_GRAPH_RUN_STATUS_AGAIN:
if (bt_graph_is_canceled(ctx.graph)) {
goto error;
case BT_GRAPH_RUN_STATUS_AGAIN:
if (bt_graph_is_canceled(ctx.graph)) {
- BT_LOGI_STR("Graph was canceled by user.");
+ BT_CLI_LOGW_APPEND_CAUSE(
+ "Graph was canceled by user.");
if (usleep(cfg->cmd_data.run.retry_duration_us)) {
if (bt_graph_is_canceled(ctx.graph)) {
if (usleep(cfg->cmd_data.run.retry_duration_us)) {
if (bt_graph_is_canceled(ctx.graph)) {
- BT_LOGI_STR("Graph was canceled by user.");
+ BT_CLI_LOGW_APPEND_CAUSE(
+ "Graph was canceled by user.");