Babeltrace 2 C API 2.1.0
Open-source trace manipulation framework
Loading...
Searching...
No Matches
plugin-dev.h
1/*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
5 */
6
7#ifndef BABELTRACE2_PLUGIN_PLUGIN_DEV_H
8#define BABELTRACE2_PLUGIN_PLUGIN_DEV_H
9
10/* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
11
12#ifndef __BT_IN_BABELTRACE_H
13# error "Please include <babeltrace2/babeltrace.h> instead."
14#endif
15
16#include <stdint.h>
17
18#include <babeltrace2/graph/component-class-dev.h>
19#include <babeltrace2/graph/message-iterator-class.h>
20#include <babeltrace2/types.h>
21
22/*
23 * _BT_HIDDEN: set the hidden attribute for internal functions
24 * On Windows, symbols are local unless explicitly exported,
25 * see https://gcc.gnu.org/wiki/Visibility
26 */
27#if defined(_WIN32) || defined(__CYGWIN__)
28#define _BT_HIDDEN
29#else
30#define _BT_HIDDEN __attribute__((visibility("hidden")))
31#endif
32
33/*
34 * _BT_EXPORT: set the visibility for exported functions.
35 */
36#if defined(_WIN32) || defined(__CYGWIN__)
37#define _BT_EXPORT
38#else
39#define _BT_EXPORT __attribute__((visibility("default")))
40#endif
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
335#define BT_PLUGIN_MODULE() \
336 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_dummy __BT_PLUGIN_DESCRIPTOR_ATTRS = NULL; \
337 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA; \
338 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_END_EXTRA; \
339 \
340 static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_dummy __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = NULL; \
341 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \
342 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \
343 \
344 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_component_class_descriptor_dummy __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = NULL; \
345 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA; \
346 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA; \
347 \
348 static struct __bt_plugin_component_class_descriptor_attribute const * const __bt_plugin_component_class_descriptor_attribute_dummy __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS = NULL; \
349 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor_attribute const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \
350 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor_attribute const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \
351 \
352 _BT_EXPORT struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void) \
353 { \
354 return &__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL; \
355 } \
356 _BT_EXPORT struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void) \
357 { \
358 return &__BT_PLUGIN_DESCRIPTOR_END_SYMBOL; \
359 } \
360 _BT_EXPORT struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void) \
361 { \
362 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
363 } \
364 _BT_EXPORT struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void) \
365 { \
366 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
367 } \
368 _BT_EXPORT struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void) \
369 { \
370 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL; \
371 } \
372 _BT_EXPORT struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void) \
373 { \
374 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL; \
375 } \
376 _BT_EXPORT struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void) \
377 { \
378 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
379 } \
380 _BT_EXPORT struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void) \
381 { \
382 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
383 }
384
412#define BT_PLUGIN_WITH_ID(_id, _name) \
413 struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id = { \
414 .name = _name, \
415 }; \
416 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_##_id##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRS = &__bt_plugin_descriptor_##_id
417
423#define BT_PLUGIN(_name) static BT_PLUGIN_WITH_ID(auto, #_name)
424
454#define BT_PLUGIN_DESCRIPTION_WITH_ID(_id, _description) \
455 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _description)
456
462#define BT_PLUGIN_DESCRIPTION(_description) BT_PLUGIN_DESCRIPTION_WITH_ID(auto, _description)
463
486#define BT_PLUGIN_AUTHOR_WITH_ID(_id, _author) \
487 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(author, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR, _id, _author)
488
494#define BT_PLUGIN_AUTHOR(_author) BT_PLUGIN_AUTHOR_WITH_ID(auto, _author)
495
518#define BT_PLUGIN_LICENSE_WITH_ID(_id, _license) \
519 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(license, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE, _id, _license)
520
526#define BT_PLUGIN_LICENSE(_license) BT_PLUGIN_LICENSE_WITH_ID(auto, _license)
527
569#define BT_PLUGIN_VERSION_WITH_ID(_id, _major, _minor, _patch, _extra) \
570 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(version, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION, _id, __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra))
571
577#define BT_PLUGIN_VERSION(_major, _minor, _patch, _extra) BT_PLUGIN_VERSION_WITH_ID(auto, _major, _minor, _patch, _extra)
578
609
634 bt_self_plugin *self_plugin);
635
656#define BT_PLUGIN_INITIALIZE_FUNC_WITH_ID(_id, _func) \
657 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(init, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT, _id, _func)
658
664#define BT_PLUGIN_INITIALIZE_FUNC(_func) BT_PLUGIN_INITIALIZE_FUNC_WITH_ID(auto, _func)
665
670typedef void (*bt_plugin_finalize_func)(void);
671
692#define BT_PLUGIN_FINALIZE_FUNC_WITH_ID(_id, _func) \
693 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(exit, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT, _id, _func)
694
700#define BT_PLUGIN_FINALIZE_FUNC(_func) BT_PLUGIN_FINALIZE_FUNC_WITH_ID(auto, _func)
701
748#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(_plugin_id, _component_class_id, _name, _message_iterator_class_next_method) \
749 static struct __bt_plugin_component_class_descriptor __bt_plugin_source_component_class_descriptor_##_plugin_id##_##_component_class_id = { \
750 .plugin_descriptor = &__bt_plugin_descriptor_##_plugin_id, \
751 .name = _name, \
752 .type = BT_COMPONENT_CLASS_TYPE_SOURCE, \
753 .methods = { .source = { .msg_iter_next = _message_iterator_class_next_method } }, \
754 }; \
755 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_source_component_class_descriptor_##_plugin_id##_##_component_class_id##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = &__bt_plugin_source_component_class_descriptor_##_plugin_id##_##_component_class_id
756
773#define BT_PLUGIN_SOURCE_COMPONENT_CLASS(_name, _message_iterator_class_next_method) \
774 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _message_iterator_class_next_method)
775
814#define BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(_plugin_id, _component_class_id, _name, _message_iterator_class_next_method) \
815 static struct __bt_plugin_component_class_descriptor __bt_plugin_filter_component_class_descriptor_##_plugin_id##_##_component_class_id = { \
816 .plugin_descriptor = &__bt_plugin_descriptor_##_plugin_id, \
817 .name = _name, \
818 .type = BT_COMPONENT_CLASS_TYPE_FILTER, \
819 .methods = { .filter = { .msg_iter_next = _message_iterator_class_next_method } }, \
820 }; \
821 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_filter_component_class_descriptor_##_plugin_id##_##_component_class_id##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = &__bt_plugin_filter_component_class_descriptor_##_plugin_id##_##_component_class_id
822
839#define BT_PLUGIN_FILTER_COMPONENT_CLASS(_name, _message_iterator_class_next_method) \
840 BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _message_iterator_class_next_method)
841
880#define BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(_plugin_id, _component_class_id, _name, _consume_method) \
881 static struct __bt_plugin_component_class_descriptor __bt_plugin_sink_component_class_descriptor_##_plugin_id##_##_component_class_id = { \
882 .plugin_descriptor = &__bt_plugin_descriptor_##_plugin_id, \
883 .name = _name, \
884 .type = BT_COMPONENT_CLASS_TYPE_SINK, \
885 .methods = { .sink = { .consume = _consume_method } }, \
886 }; \
887 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_sink_component_class_descriptor_##_plugin_id##_##_component_class_id##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = &__bt_plugin_sink_component_class_descriptor_##_plugin_id##_##_component_class_id
888
905#define BT_PLUGIN_SINK_COMPONENT_CLASS(_name, _consume_method) \
906 BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _consume_method)
907
947#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_plugin_id, _component_class_id, _description) \
948 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _plugin_id, _component_class_id, source, _description)
949
956#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(_name, _description) \
957 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _description)
958
991#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(_plugin_id, _component_class_id, _help_text) \
992 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _plugin_id, _component_class_id, source, _help_text)
993
1000#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP(_name, _help_text) \
1001 BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _help_text)
1002
1042#define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_plugin_id, _component_class_id, _description) \
1043 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _plugin_id, _component_class_id, filter, _description)
1044
1051#define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(_name, _description) \
1052 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _description)
1053
1086#define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(_plugin_id, _component_class_id, _help_text) \
1087 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _plugin_id, _component_class_id, filter, _help_text)
1088
1095#define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP(_name, _help_text) \
1096 BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _help_text)
1097
1137#define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_plugin_id, _component_class_id, _description) \
1138 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _plugin_id, _component_class_id, sink, _description)
1139
1146#define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(_name, _description) \
1147 BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _description)
1148
1181#define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(_plugin_id, _component_class_id, _help_text) \
1182 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _plugin_id, _component_class_id, sink, _help_text)
1183
1190#define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(_name, _help_text) \
1191 BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _help_text)
1192
1232#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1233 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _plugin_id, _component_class_id, source, _method)
1234
1242#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(_name, _method) \
1243 BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _method)
1244
1278#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1279 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD, _plugin_id, _component_class_id, source, _method)
1280
1288#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _method) \
1289 BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _method)
1290
1323#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1324 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD, _plugin_id, _component_class_id, source, _method)
1325
1333#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD(_name, _method) \
1334 BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _method)
1335
1369#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1370 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD, _plugin_id, _component_class_id, source, _method)
1371
1379#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD(_name, _method) \
1380 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _method)
1381
1415#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1416 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD, _plugin_id, _component_class_id, source, _method)
1417
1425#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD(_name, _method) \
1426 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _method)
1427
1477#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS_WITH_ID(_plugin_id, _component_class_id, _seek_method, _can_seek_method) \
1478 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD, _plugin_id, _component_class_id, source, _seek_method); \
1479 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_can_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD, _plugin_id, _component_class_id, source, _can_seek_method)
1480
1488#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS(_name, _seek_method, _can_seek_method) \
1489 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
1490
1541#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(_plugin_id, _component_class_id, _seek_method, _can_seek_method) \
1542 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD, _plugin_id, _component_class_id, source, _seek_method); \
1543 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_can_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD, _plugin_id, _component_class_id, source, _can_seek_method)
1544
1552#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS(_name, _seek_method, _can_seek_method) \
1553 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
1554
1589#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1590 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_output_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD, _plugin_id, _component_class_id, source, _method)
1591
1599#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD(_name, _method) \
1600 BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _method)
1601
1634#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1635 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _plugin_id, _component_class_id, source, _method)
1636
1644#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD(_name, _method) \
1645 BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _method)
1646
1686#define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1687 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _plugin_id, _component_class_id, filter, _method)
1688
1696#define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(_name, _method) \
1697 BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _method)
1698
1732#define BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1733 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD, _plugin_id, _component_class_id, filter, _method)
1734
1742#define BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _method) \
1743 BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _method)
1744
1777#define BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1778 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD, _plugin_id, _component_class_id, filter, _method)
1779
1787#define BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD(_name, _method) \
1788 BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _method)
1789
1824#define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1825 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_input_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD, _plugin_id, _component_class_id, filter, _method)
1826
1834#define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD(_name, _method) \
1835 BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _method)
1836
1870#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1871 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD, _plugin_id, _component_class_id, filter, _method)
1872
1880#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD(_name, _method) \
1881 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _method)
1882
1916#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1917 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD, _plugin_id, _component_class_id, filter, _method)
1918
1926#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD(_name, _method) \
1927 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _method)
1928
1978#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS_WITH_ID(_plugin_id, _component_class_id, _seek_method, _can_seek_method) \
1979 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD, _plugin_id, _component_class_id, filter, _seek_method); \
1980 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_can_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD, _plugin_id, _component_class_id, filter, _can_seek_method);
1981
1989#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS(_name, _seek_method, _can_seek_method) \
1990 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
1991
2042#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(_plugin_id, _component_class_id, _seek_method, _can_seek_method) \
2043 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD, _plugin_id, _component_class_id, filter, _seek_method); \
2044 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_can_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD, _plugin_id, _component_class_id, filter, _can_seek_method)
2045
2053#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS(_name, _seek_method, _can_seek_method) \
2054 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
2055
2090#define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2091 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_output_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD, _plugin_id, _component_class_id, filter, _method)
2092
2100#define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD(_name, _method) \
2101 BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _method)
2102
2135#define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2136 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _plugin_id, _component_class_id, filter, _method)
2137
2145#define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(_name, _method) \
2146 BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _method)
2147
2187#define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2188 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _plugin_id, _component_class_id, sink, _method)
2189
2197#define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(_name, _method) \
2198 BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _method)
2199
2233#define BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2234 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD, _plugin_id, _component_class_id, sink, _method)
2235
2243#define BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _method) \
2244 BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _method)
2245
2280#define BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2281 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_graph_is_configured_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD, _plugin_id, _component_class_id, sink, _method)
2282
2290#define BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(_name, _method) \
2291 BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD_WITH_ID(auto, _name, _method)
2292
2325#define BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2326 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD, _plugin_id, _component_class_id, sink, _method)
2327
2335#define BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(_name, _method) \
2336 BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _method)
2337
2372#define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2373 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_input_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD, _plugin_id, _component_class_id, sink, _method)
2374
2382#define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD(_name, _method) \
2383 BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _method)
2384
2417#define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2418 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _plugin_id, _component_class_id, sink, _method)
2419
2427#define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD(_name, _method) \
2428 BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _method)
2429
2434/* Plugin descriptor: describes a single plugin (internal use) */
2435struct __bt_plugin_descriptor {
2436 /* Name of the plugin */
2437 const char *name;
2438} __attribute__((packed));
2439
2440/* Type of a plugin attribute (internal use) */
2441enum __bt_plugin_descriptor_attribute_type {
2442 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT = 0,
2443 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT = 1,
2444 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR = 2,
2445 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE = 3,
2446 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION = 4,
2447 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION = 5,
2448};
2449
2450/* Plugin (user) version */
2451struct __bt_plugin_descriptor_version {
2452 uint32_t major;
2453 uint32_t minor;
2454 uint32_t patch;
2455 const char *extra;
2456};
2457
2458/* Plugin attribute (internal use) */
2459struct __bt_plugin_descriptor_attribute {
2460 /* Plugin descriptor to which to associate this attribute */
2461 const struct __bt_plugin_descriptor *plugin_descriptor;
2462
2463 /* Name of the type of the attribute for debug purposes */
2464 const char *type_name;
2465
2466 /* Type of the attribute */
2467 enum __bt_plugin_descriptor_attribute_type type;
2468
2469 /* Value of the attribute (depends on the type of attribute) */
2470 union {
2471 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT */
2473
2474 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT */
2476
2477 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR */
2478 const char *author;
2479
2480 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE */
2481 const char *license;
2482
2483 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
2484 const char *description;
2485
2486 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION */
2487 struct __bt_plugin_descriptor_version version;
2488 } value;
2489} __attribute__((packed));
2490
2491/* Component class descriptor (internal use) */
2492struct __bt_plugin_component_class_descriptor {
2493 /*
2494 * Plugin descriptor to which to associate this component
2495 * class descriptor.
2496 */
2497 const struct __bt_plugin_descriptor *plugin_descriptor;
2498
2499 /* Component class name */
2500 const char *name;
2501
2502 /* Component class type */
2504
2505 /* Mandatory methods (depends on component class type) */
2506 union {
2507 /* BT_COMPONENT_CLASS_TYPE_SOURCE */
2508 struct {
2510 } source;
2511
2512 /* BT_COMPONENT_CLASS_TYPE_FILTER */
2513 struct {
2515 } filter;
2516
2517 /* BT_COMPONENT_CLASS_TYPE_SINK */
2518 struct {
2520 } sink;
2521 } methods;
2522} __attribute__((packed));
2523
2524/* Type of a component class attribute (internal use) */
2525enum __bt_plugin_component_class_descriptor_attribute_type {
2526 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION = 0,
2527 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP = 1,
2528 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD = 2,
2529 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD = 3,
2530 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD = 4,
2531 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD = 5,
2532 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD = 6,
2533 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD = 7,
2534 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD = 8,
2535 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD = 9,
2536 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD = 10,
2537 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD = 11,
2538 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD = 12,
2539 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD = 13,
2540 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD = 14,
2541};
2542
2543/* Component class attribute (internal use) */
2544struct __bt_plugin_component_class_descriptor_attribute {
2545 /*
2546 * Component class plugin attribute to which to associate this
2547 * component class attribute.
2548 */
2549 const struct __bt_plugin_component_class_descriptor *comp_class_descriptor;
2550
2551 /* Name of the type of the attribute for debug purposes */
2552 const char *type_name;
2553
2554 /* Type of the attribute */
2555 enum __bt_plugin_component_class_descriptor_attribute_type type;
2556
2557 /* Value of the attribute (depends on the type of attribute) */
2558 union {
2559 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
2560 const char *description;
2561
2562 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP */
2563 const char *help;
2564
2565 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD */
2566 bt_component_class_source_get_supported_mip_versions_method source_get_supported_mip_versions_method;
2567 bt_component_class_filter_get_supported_mip_versions_method filter_get_supported_mip_versions_method;
2568 bt_component_class_sink_get_supported_mip_versions_method sink_get_supported_mip_versions_method;
2569
2570 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD */
2571 bt_component_class_source_initialize_method source_initialize_method;
2572 bt_component_class_filter_initialize_method filter_initialize_method;
2573 bt_component_class_sink_initialize_method sink_initialize_method;
2574
2575 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD */
2576 bt_component_class_source_finalize_method source_finalize_method;
2577 bt_component_class_filter_finalize_method filter_finalize_method;
2578 bt_component_class_sink_finalize_method sink_finalize_method;
2579
2580 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD */
2581 bt_component_class_source_query_method source_query_method;
2582 bt_component_class_filter_query_method filter_query_method;
2583 bt_component_class_sink_query_method sink_query_method;
2584
2585 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD */
2586 bt_component_class_filter_input_port_connected_method filter_input_port_connected_method;
2587 bt_component_class_sink_input_port_connected_method sink_input_port_connected_method;
2588
2589 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD */
2590 bt_component_class_source_output_port_connected_method source_output_port_connected_method;
2591 bt_component_class_filter_output_port_connected_method filter_output_port_connected_method;
2592
2593 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD */
2594 bt_component_class_sink_graph_is_configured_method sink_graph_is_configured_method;
2595
2596 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD */
2597 bt_message_iterator_class_initialize_method msg_iter_initialize_method;
2598
2599 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD */
2600 bt_message_iterator_class_finalize_method msg_iter_finalize_method;
2601
2602 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD */
2603 bt_message_iterator_class_seek_ns_from_origin_method msg_iter_seek_ns_from_origin_method;
2604
2605 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD */
2606 bt_message_iterator_class_seek_beginning_method msg_iter_seek_beginning_method;
2607
2608 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD */
2609 bt_message_iterator_class_can_seek_ns_from_origin_method msg_iter_can_seek_ns_from_origin_method;
2610
2611 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD */
2612 bt_message_iterator_class_can_seek_beginning_method msg_iter_can_seek_beginning_method;
2613 } value;
2614} __attribute__((packed));
2615
2616struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void);
2617struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void);
2618struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void);
2619struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void);
2620struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void);
2621struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void);
2622struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void);
2623struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void);
2624
2625/*
2626 * Defines a plugin attribute (generic, internal use).
2627 *
2628 * _attr_name: Name of the attribute (C identifier).
2629 * _attr_type: Type of the attribute (enum __bt_plugin_descriptor_attribute_type).
2630 * _id: Plugin descriptor ID (C identifier).
2631 * _x: Value.
2632 */
2633#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _x) \
2634 static struct __bt_plugin_descriptor_attribute __bt_plugin_descriptor_attribute_##_id##_##_attr_name = { \
2635 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
2636 .type_name = #_attr_name, \
2637 .type = _attr_type, \
2638 .value = { ._attr_name = _x }, \
2639 }; \
2640 static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_##_id##_##_attr_name##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = &__bt_plugin_descriptor_attribute_##_id##_##_attr_name
2641
2642#define __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra) \
2643 {.major = _major, .minor = _minor, .patch = _patch, .extra = _extra,}
2644
2645/*
2646 * Defines a component class descriptor attribute (generic, internal
2647 * use).
2648 *
2649 * _id: Plugin descriptor ID (C identifier).
2650 * _component_class_id: Component class ID (C identifier).
2651 * _type: Component class type (`source`, `filter`, or `sink`).
2652 * _attr_name: Name of the attribute (C identifier).
2653 * _attr_type: Type of the attribute
2654 * (enum __bt_plugin_descriptor_attribute_type).
2655 * _x: Value.
2656 */
2657#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _component_class_id, _type, _x) \
2658 static struct __bt_plugin_component_class_descriptor_attribute __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_component_class_id##_##_attr_name = { \
2659 .comp_class_descriptor = &__bt_plugin_##_type##_component_class_descriptor_##_id##_##_component_class_id, \
2660 .type_name = #_attr_name, \
2661 .type = _attr_type, \
2662 .value = { ._attr_name = _x }, \
2663 }; \
2664 static struct __bt_plugin_component_class_descriptor_attribute const * const __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_component_class_id##_##_attr_name##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS = &__bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_component_class_id##_##_attr_name
2665
2666/*
2667 * Clang supports the no_sanitize variable attribute on global variables.
2668 * GCC only supports the no_sanitize_address function attribute, which is
2669 * not what we need. This is fine because, as far as we have seen, gcc
2670 * doesn't insert red zones around global variables.
2671 */
2672#if defined(__clang__)
2673# if __has_feature(address_sanitizer)
2674# define __bt_plugin_variable_attribute_no_sanitize_address \
2675 __attribute__((no_sanitize("address")))
2676# else
2677# define __bt_plugin_variable_attribute_no_sanitize_address
2678# endif
2679#else
2680# define __bt_plugin_variable_attribute_no_sanitize_address
2681#endif
2682
2683/*
2684 * Variable attributes for a plugin descriptor pointer to be added to
2685 * the plugin descriptor section (internal use).
2686 */
2687#ifdef __APPLE__
2688#define __BT_PLUGIN_DESCRIPTOR_ATTRS \
2689 __attribute__((section("__DATA,btp_desc"), used)) \
2690 __bt_plugin_variable_attribute_no_sanitize_address
2691
2692#define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
2693 __start___bt_plugin_descriptors
2694
2695#define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
2696 __stop___bt_plugin_descriptors
2697
2698#define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA \
2699 __asm("section$start$__DATA$btp_desc")
2700
2701#define __BT_PLUGIN_DESCRIPTOR_END_EXTRA \
2702 __asm("section$end$__DATA$btp_desc")
2703
2704#else
2705
2706#define __BT_PLUGIN_DESCRIPTOR_ATTRS \
2707 __attribute__((section("__bt_plugin_descriptors"), used)) \
2708 __bt_plugin_variable_attribute_no_sanitize_address
2709
2710#define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
2711 __start___bt_plugin_descriptors
2712
2713#define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
2714 __stop___bt_plugin_descriptors
2715
2716#define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA
2717
2718#define __BT_PLUGIN_DESCRIPTOR_END_EXTRA
2719#endif
2720
2721/*
2722 * Variable attributes for a plugin attribute pointer to be added to
2723 * the plugin attribute section (internal use).
2724 */
2725#ifdef __APPLE__
2726#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
2727 __attribute__((section("__DATA,btp_desc_att"), used)) \
2728 __bt_plugin_variable_attribute_no_sanitize_address
2729
2730#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2731 __start___bt_plugin_descriptor_attributes
2732
2733#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
2734 __stop___bt_plugin_descriptor_attributes
2735
2736#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
2737 __asm("section$start$__DATA$btp_desc_att")
2738
2739#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
2740 __asm("section$end$__DATA$btp_desc_att")
2741
2742#else
2743
2744#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
2745 __attribute__((section("__bt_plugin_descriptor_attributes"), used)) \
2746 __bt_plugin_variable_attribute_no_sanitize_address
2747
2748#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2749 __start___bt_plugin_descriptor_attributes
2750
2751#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
2752 __stop___bt_plugin_descriptor_attributes
2753
2754#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
2755
2756#define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA
2757#endif
2758
2759/*
2760 * Variable attributes for a component class descriptor pointer to be
2761 * added to the component class descriptor section (internal use).
2762 */
2763#ifdef __APPLE__
2764#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
2765 __attribute__((section("__DATA,btp_cc_desc"), used)) \
2766 __bt_plugin_variable_attribute_no_sanitize_address
2767
2768#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
2769 __start___bt_plugin_component_class_descriptors
2770
2771#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
2772 __stop___bt_plugin_component_class_descriptors
2773
2774#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA \
2775 __asm("section$start$__DATA$btp_cc_desc")
2776
2777#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA \
2778 __asm("section$end$__DATA$btp_cc_desc")
2779
2780#else
2781
2782#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
2783 __attribute__((section("__bt_plugin_component_class_descriptors"), used)) \
2784 __bt_plugin_variable_attribute_no_sanitize_address
2785
2786#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
2787 __start___bt_plugin_component_class_descriptors
2788
2789#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
2790 __stop___bt_plugin_component_class_descriptors
2791
2792#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA
2793
2794#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA
2795#endif
2796
2797/*
2798 * Variable attributes for a component class descriptor attribute
2799 * pointer to be added to the component class descriptor attribute
2800 * section (internal use).
2801 */
2802#ifdef __APPLE__
2803#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
2804 __attribute__((section("__DATA,btp_cc_desc_att"), used)) \
2805 __bt_plugin_variable_attribute_no_sanitize_address
2806
2807#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2808 __start___bt_plugin_component_class_descriptor_attributes
2809
2810#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
2811 __stop___bt_plugin_component_class_descriptor_attributes
2812
2813#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
2814 __asm("section$start$__DATA$btp_cc_desc_att")
2815
2816#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
2817 __asm("section$end$__DATA$btp_cc_desc_att")
2818
2819#else
2820
2821#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
2822 __attribute__((section("__bt_plugin_component_class_descriptor_attributes"), used)) \
2823 __bt_plugin_variable_attribute_no_sanitize_address
2824
2825#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2826 __start___bt_plugin_component_class_descriptor_attributes
2827
2828#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
2829 __stop___bt_plugin_component_class_descriptor_attributes
2830
2831#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
2832
2833#define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA
2834#endif
2835
2836#ifdef __cplusplus
2837}
2838#endif
2839
2840#endif /* BABELTRACE2_PLUGIN_PLUGIN_DEV_H */
bt_component_class_initialize_method_status(* bt_component_class_source_initialize_method)(bt_self_component_source *self_component, bt_self_component_source_configuration *configuration, const bt_value *params, void *initialize_method_data)
Source component initialization method.
Definition component-class-dev.h:953
void(* bt_component_class_filter_finalize_method)(bt_self_component_filter *self_component)
Filter component finalization method.
Definition component-class-dev.h:607
void(* bt_component_class_source_finalize_method)(bt_self_component_source *self_component)
Source component finalization method.
Definition component-class-dev.h:588
bt_component_class_initialize_method_status(* bt_component_class_filter_initialize_method)(bt_self_component_filter *self_component, bt_self_component_filter_configuration *configuration, const bt_value *params, void *initialize_method_data)
Filter component initialization method.
Definition component-class-dev.h:1000
bt_component_class_port_connected_method_status(* bt_component_class_filter_output_port_connected_method)(bt_self_component_filter *self_component, bt_self_component_port_output *self_port, const bt_port_input *other_port)
Filter component "output port connected" method.
Definition component-class-dev.h:1181
bt_component_class_get_supported_mip_versions_method_status(* bt_component_class_filter_get_supported_mip_versions_method)(bt_self_component_class_filter *self_component_class, const bt_value *params, void *initialize_method_data, bt_logging_level logging_level, bt_integer_range_set_unsigned *supported_versions)
Filter component class "get supported Message Interchange Protocol versions" method.
Definition component-class-dev.h:768
bt_component_class_initialize_method_status(* bt_component_class_sink_initialize_method)(bt_self_component_sink *self_component, bt_self_component_sink_configuration *configuration, const bt_value *params, void *initialize_method_data)
Sink component initialization method.
Definition component-class-dev.h:1048
bt_component_class_sink_graph_is_configured_method_status(* bt_component_class_sink_graph_is_configured_method)(bt_self_component_sink *self_component)
Sink component "graph is configured" method.
Definition component-class-dev.h:881
bt_component_class_port_connected_method_status(* bt_component_class_filter_input_port_connected_method)(bt_self_component_filter *self_component, bt_self_component_port_input *self_port, const bt_port_output *other_port)
Filter component "input port connected" method.
Definition component-class-dev.h:1146
bt_component_class_get_supported_mip_versions_method_status(* bt_component_class_source_get_supported_mip_versions_method)(bt_self_component_class_source *self_component_class, const bt_value *params, void *initialize_method_data, bt_logging_level logging_level, bt_integer_range_set_unsigned *supported_versions)
Source component class "get supported Message Interchange Protocol versions" method.
Definition component-class-dev.h:709
bt_component_class_query_method_status(* bt_component_class_filter_query_method)(bt_self_component_class_filter *self_component_class, bt_private_query_executor *query_executor, const char *object_name, const bt_value *params, void *method_data, const bt_value **result)
Filter component class query method.
Definition component-class-dev.h:1384
bt_component_class_query_method_status(* bt_component_class_sink_query_method)(bt_self_component_class_sink *self_component_class, bt_private_query_executor *query_executor, const char *object_name, const bt_value *params, void *method_data, const bt_value **result)
Sink component class query method.
Definition component-class-dev.h:1449
bt_component_class_get_supported_mip_versions_method_status(* bt_component_class_sink_get_supported_mip_versions_method)(bt_self_component_class_sink *self_component_class, const bt_value *params, void *initialize_method_data, bt_logging_level logging_level, bt_integer_range_set_unsigned *supported_versions)
Sink component class "get supported Message Interchange Protocol versions" method.
Definition component-class-dev.h:827
bt_component_class_port_connected_method_status(* bt_component_class_sink_input_port_connected_method)(bt_self_component_sink *self_component, bt_self_component_port_input *self_port, const bt_port_output *other_port)
Sink component "input port connected" method.
Definition component-class-dev.h:1216
void(* bt_component_class_sink_finalize_method)(bt_self_component_sink *self_component)
Sink component finalization method.
Definition component-class-dev.h:626
bt_component_class_port_connected_method_status(* bt_component_class_source_output_port_connected_method)(bt_self_component_source *self_component, bt_self_component_port_output *self_port, const bt_port_input *other_port)
Source component "output port connected" method.
Definition component-class-dev.h:1111
bt_component_class_sink_consume_method_status(* bt_component_class_sink_consume_method)(bt_self_component_sink *self_component)
Sink component consuming method.
Definition component-class-dev.h:569
bt_component_class_query_method_status(* bt_component_class_source_query_method)(bt_self_component_class_source *self_component_class, bt_private_query_executor *query_executor, const char *object_name, const bt_value *params, void *method_data, const bt_value **result)
Source component class query method.
Definition component-class-dev.h:1319
bt_component_class_type
Component class type enumerators.
Definition component-class.h:202
bt_message_iterator_class_initialize_method_status(* bt_message_iterator_class_initialize_method)(bt_self_message_iterator *self_message_iterator, bt_self_message_iterator_configuration *configuration, bt_self_component_port_output *port)
Message iterator initialization method.
Definition message-iterator-class.h:709
bt_message_iterator_class_can_seek_beginning_method_status(* bt_message_iterator_class_can_seek_beginning_method)(bt_self_message_iterator *self_message_iterator, bt_bool *can_seek_beginning)
Message iterator "can seek beginning?" method.
Definition message-iterator-class.h:562
bt_message_iterator_class_seek_beginning_method_status(* bt_message_iterator_class_seek_beginning_method)(bt_self_message_iterator *self_message_iterator)
Message iterator "seek beginning" method.
Definition message-iterator-class.h:889
bt_message_iterator_class_can_seek_ns_from_origin_method_status(* bt_message_iterator_class_can_seek_ns_from_origin_method)(bt_self_message_iterator *self_message_iterator, int64_t ns_from_origin, bt_bool *can_seek_ns_from_origin)
Message iterator "can seek ns from origin?" method.
Definition message-iterator-class.h:633
bt_message_iterator_class_seek_ns_from_origin_method_status(* bt_message_iterator_class_seek_ns_from_origin_method)(bt_self_message_iterator *self_message_iterator, int64_t ns_from_origin)
Message iterator "seek ns from origin" method.
Definition message-iterator-class.h:955
bt_message_iterator_class_next_method_status(* bt_message_iterator_class_next_method)(bt_self_message_iterator *self_message_iterator, bt_message_array_const messages, uint64_t capacity, uint64_t *count)
Message iterator "next" (get next messages) method.
Definition message-iterator-class.h:823
void(* bt_message_iterator_class_finalize_method)(bt_self_message_iterator *self_message_iterator)
Message iterator finalization method.
Definition message-iterator-class.h:654
void(* bt_plugin_finalize_func)(void)
User plugin finalization function.
Definition plugin-dev.h:670
struct bt_self_plugin bt_self_plugin
Self plugin.
Definition types.h:88
bt_plugin_initialize_func_status
Status codes for bt_plugin_initialize_func.
Definition plugin-dev.h:590
bt_plugin_initialize_func_status(* bt_plugin_initialize_func)(bt_self_plugin *self_plugin)
User plugin initialization function.
Definition plugin-dev.h:633
@ BT_PLUGIN_INITIALIZE_FUNC_STATUS_OK
Success.
Definition plugin-dev.h:595
@ BT_PLUGIN_INITIALIZE_FUNC_STATUS_MEMORY_ERROR
Out of memory.
Definition plugin-dev.h:601
@ BT_PLUGIN_INITIALIZE_FUNC_STATUS_ERROR
Error.
Definition plugin-dev.h:607