Babeltrace 2 C API
2.0.0
Open-source trace manipulation framework
|
This example shows a basic Babeltrace 2 shared object plugin definition C file.
The shared object plugin's name is vestige
. Therefore the input
and output
component classes would be identified in the babeltrace2
command-line tool as source.vestige.input
and sink.vestige.output
.
Assume that vestige.c
contains the actual source and sink component classes's code, and that vestige.h
contains its declarations.
vestige-plugin.c
:
#include "vestige.h"
"Read a Vestige trace file.");
vestige_in_init);
vestige_in_finalize);
input, vestige_in_iter_init);
input, vestige_in_iter_fini);
"Write a Vestige trace file.");
vestige_out_init);
vestige_out_finalize);
vestige_out_graph_is_configured);
See Compile and link a Babeltrace 2 shared object plugin to learn how you could compile and link those files as a Babeltrace 2 shared object plugin.
#define BT_PLUGIN_LICENSE(_license)
Alias of BT_PLUGIN_LICENSE_WITH_ID() with the _id parameter set to auto.
Definition: plugin-dev.h:530
#define BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(_name, _method)
Alias of BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID() with the _plugin_id parameter set...
Definition: plugin-dev.h:2332
#define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(_name, _method)
Alias of BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID() with the _plugin_id parameter set t...
Definition: plugin-dev.h:2194
#define BT_PLUGIN_SOURCE_COMPONENT_CLASS(_name, _message_iterator_class_next_method)
Alias of BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID() with the _plugin_id parameter set to auto,...
Definition: plugin-dev.h:774
#define BT_PLUGIN_SINK_COMPONENT_CLASS(_name, _consume_method)
Alias of BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID() with the _plugin_id parameter set to auto,...
Definition: plugin-dev.h:904
#define BT_PLUGIN_MODULE()
Defines a plugin module.
Definition: plugin-dev.h:338
#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD(_name, _method)
Alias of BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD_WITH_ID() with the _...
Definition: plugin-dev.h:1377
#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(_name, _description)
Alias of BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID() with the _plugin_id parameter set to ...
Definition: plugin-dev.h:955
#define BT_PLUGIN_DESCRIPTION(_description)
Alias of BT_PLUGIN_DESCRIPTION_WITH_ID() with the _id parameter set to auto.
Definition: plugin-dev.h:465
#define BT_PLUGIN(_name)
Alias of BT_PLUGIN_WITH_ID() with the _id parameter set to auto.
Definition: plugin-dev.h:426
#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(_name, _method)
Alias of BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID() with the _plugin_id parameter set...
Definition: plugin-dev.h:1241
#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD(_name, _method)
Alias of BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_WITH_ID() with the...
Definition: plugin-dev.h:1423
#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD(_name, _method)
Alias of BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID() with the _plugin_id parameter s...
Definition: plugin-dev.h:1332
#define BT_PLUGIN_AUTHOR(_author)
Alias of BT_PLUGIN_AUTHOR_WITH_ID() with the _id parameter set to auto.
Definition: plugin-dev.h:498
#define BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(_name, _method)
Alias of BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD_WITH_ID() with the _plugin_id para...
Definition: plugin-dev.h:2287
#define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(_name, _description)
Alias of BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID() with the _plugin_id parameter set to au...
Definition: plugin-dev.h:1145