Move autodisc to its own convenience library
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 5 Aug 2019 15:05:08 +0000 (11:05 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 12 Aug 2019 02:19:51 +0000 (22:19 -0400)
commit9701066527431ae10c70a05d7c92196f6dfd6e27
treed5480e90535bdd78c604500a9de57c138a34ac16
parentdc807017742411a9a0e328bb25a592aaf10df11e
Move autodisc to its own convenience library

Since we'll want to make TraceCollectionMessageIterator have an
automatic source discovery feature, like the CLI has, move the auto
discovery code to its own library, which doesn't have any dependency on
the CLI.

To avoid dependencies on the CLI, here are the changes done to the auto
discovery code:

- To avoid depending on cli_query, use a simplified version,
  simple_query, included in the auto discovery code.  It doesn't handle
  retrying if the status is TRY_AGAIN, as it is not very likely that a
  babeltrace2.support-info query implementation will need to do that, as
  we want them to be very fast (we can always revisit it in the future).
- Avoid using BT_CLI_LOGE_APPEND_CAUSE, replace with the new
  BT_AUTODISC_LOGE_AND_APPEND.
- Don't use require_loaded_plugins, get_loaded_plugins_count and
  borrow_loaded_plugin, as those are CLI-specific.  Instead, the caller of
  auto_discover_source_components must provide an array of plugins.
- plugin_restrict, used to filter down to a single plugin by name, is
  removed.  Instead, it is the caller's responsibility to pass a single
  plugin to `plugins` if it wants to restrict the search to a single
  plugin.

A side effect of moving the code is that a warning is now printed by
default when no input is found from non-option argument.  I think this
is desirable to have this warning printed, so I have opted to update the
test case to expect it.

Change-Id: Id4009976430126d926eac46ff044365a6b2bc006
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1825
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
12 files changed:
configure.ac
src/Makefile.am
src/autodisc/Makefile.am [new file with mode: 0644]
src/autodisc/autodisc.c [new file with mode: 0644]
src/autodisc/autodisc.h [new file with mode: 0644]
src/cli/Makefile.am
src/cli/babeltrace2-cfg-cli-args.c
src/cli/babeltrace2-cfg-src-auto-disc.c [deleted file]
src/cli/babeltrace2-cfg-src-auto-disc.h [deleted file]
src/cli/babeltrace2-plugins.c
src/cli/babeltrace2-plugins.h
tests/cli/convert/test_auto_source_discovery_grouping
This page took 0.026171 seconds and 4 git commands to generate.