Move autodisc to its own convenience library
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 5 Aug 2019 15:05:08 +0000 (11:05 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Sep 2019 15:58:21 +0000 (11:58 -0400)
commit77a5caaf683217775bd1401a62a4867b9dc00334
treea057a04d9da423a41f522bac6ebc67441ca8edf6
parent449944d5da080154ac035e4d32ccdaa4704825c3
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.02631 seconds and 4 git commands to generate.