bt2: make ComponentSpec take a component class object
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 12 Aug 2019 22:31:15 +0000 (18:31 -0400)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 27 Aug 2019 01:18:13 +0000 (21:18 -0400)
commitc87f23fa2be424d0e97c4ca677c738a847813acf
tree50ff2b6443bacbc74c0ac2c0770012a50b917c10
parent764d8fd9edb022ac415f831bec0d262052de0eb1
bt2: make ComponentSpec take a component class object

... rather than a plugin and component class name.  It can be a user
component class:

    class MySource(bt2._UserSourceComponent, ...):
        ...

    spec = bt2.ComponentSpec(MySource)

or a component class from a plugin:

    cc = bt2.find_plugin('my_plugin').source_component_classes['cerfeuil']
    spec = bt2.ComponentSpec(cc)

This is a bit more general compared to taking a plugin name and a
component class name, since it allows passing an component class that
does not come from a plugin.  It also allows the user to use component
classes from plugins in non-standard locations, by looking up plugins
manually with bt2.find_plugins_in_path.

For convenience, there is a new static method
bt2.ComponentSpec.from_named_plugin_and_component_class that creates a
ComponentSpec from a plugin and component class names.

Change-Id: I39e3fec6bbc7e7a9ba375065c9318b61b1791e35
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1890
CI-Build: Francis Deslauriers <francis.deslauriers@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/bindings/python/bt2/bt2/trace_collection_message_iterator.py
tests/bindings/python/bt2/test_trace_collection_message_iterator.py
This page took 0.02464 seconds and 4 git commands to generate.