autodisc: make it possible to interrupt auto source discovery
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 20 Aug 2019 00:56:26 +0000 (20:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Sep 2019 15:58:22 +0000 (11:58 -0400)
commit3f8644ec9eb190bc376544916cccf65a44a0ff8d
tree2896225188b6eef0b0331bc6fc6aaf101f25e58d
parent1fc6f118e0b90e20c465624f0035038337cf1480
autodisc: make it possible to interrupt auto source discovery

It is currently not possible to interrupt babeltrace2 while it is doing
auto source discovery.  However, it can be a quite long process that the
user might want to interrupt using ctrl-C.  This patch makes it possible
to do that.

An interrupter object is taken by the auto source discovery code and
passed all the way to support_info_query_all_sources.  In the CLI, the
global `the_interrupter` object, which is set on sigint, is passed.

Because support_info_query_all_sources (and other internal functions)
can now return a few different values (success with a match, success
without a match, error and interrupted), I changed it to return an enum
type.  The entry point of auto source discovery,
auto_discover_source_components, can now return "interrupted" as well.
However, since that function doesn't return "no match", I didn't want to
make it use the same return type as support_info_query_all_sources.  I
therefore made an "internal" and public version of the status enum.

With this patch, there is no way to interrupt an auto source discovery
started from Python.

Change-Id: I0040c7fab1887c4e05decd0659fa8ff3c85a16a1
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1972
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/autodisc/autodisc.c
src/autodisc/autodisc.h
src/bindings/python/bt2/bt2/native_bt_autodisc.i.h
src/cli/babeltrace2-cfg-cli-args-default.c
src/cli/babeltrace2-cfg-cli-args-default.h
src/cli/babeltrace2-cfg-cli-args.c
src/cli/babeltrace2-cfg-cli-args.h
src/cli/babeltrace2.c
This page took 0.028059 seconds and 4 git commands to generate.