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)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 26 Aug 2019 20:02:11 +0000 (16:02 -0400)
commit3dae1685cf1f1a368cd83928433eb778c8815dab
treeb4372475a0d4c563cd549c82eed9e8c1cc7ada03
parentf0c01bee96c083f86cc98af9e3eb635629be128b
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.025267 seconds and 4 git commands to generate.