lib: add bt_plugin_find_all()
This patch adds the public bt_plugin_find_all() function to find all the
plugins found in directories with the standard search order.
The motivation of this patch is to use bt_plugin_find_all() in the CLI
instead of duplicating the search algorithm (see load_all_plugins() in
`babeltrace2-plugins.c`).
bt_plugin_find_all() returns a plugin set. It takes four boolean
parameters to indicate whether or not it must search in:
* The directories specified by the standard environment variable
(`BABELTRACE_PLUGIN_PATH`).
* The system's plugin directory.
* The user's plugin directory.
* The built-in/static plugins.
All the plugins within a plugin set have unique names. When a plugin is
found in bt_plugin_find_all() and the output plugin set already has a
plugin with this name, it is discarded.
bt_plugin_find() is changed to use bt_plugin_find_all(). It also gains
the four boolean parameters to exclude a specific step of the search
algorithm.
In the `bt2` Python package:
* bt2.find_plugins() is renamed to bt2.find_plugins_in_path().
* bt2.find_plugins() wraps bt_plugin_find_all().
* Optional boolean parameters are added to bt2.find_plugin() to fully
wrap bt_plugin_find().
In `tests/lib/plugin.c`, `BT_FALSE` is passed to all the directory
exclusion parameters except for `find_in_std_env_var` to isolate the
search within those specific directories, without the system's or user's
plugin directory having an influence on the test.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Icad1387d64d15a639da107ab1ba30e5a53136ced
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1729
Tested-by: jenkins <jenkins@lttng.org>
This page took 0.0283 seconds and 4 git commands to generate.