From 1353b066072e6c389ff35853bac83f65597e7a6a Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 4 Jul 2022 09:43:27 -0400 Subject: [PATCH] Visibility hidden by default Change the default visibility of functions to be hidden. Tag the functions we want exported as "BT_EXPORT", rather than tagging the ones we want hidden as "BT_HIDDEN". The benefits of this method are explained here: https://gcc.gnu.org/wiki/Visibility This is the only practical way to avoid some C++ symbols to be externally visible (for example, the bt_param_validation_map_value_entry_descr symbol below). Change configure.ac to add -fvisibility=hidden to CFLAGS and CXXFLAGS, and -fvisibility-inlines-hidden to CXXFLAGS. Remove all mentions of BT_HIDDEN and its definition. Add BT_EXPORT, and tag all functions meant to be exported with it. Using the abidiff tool, I confirmed that there is not change in exported symbols for these two libraries: - ./src/lib/.libs/libbabeltrace2.so - ./src/ctf-writer/.libs/libbabeltrace2-ctf-writer.so In the CTF plugin, some symbols that used to be exported are now hidden. There are some C++ symbols like: [D] 'method bt_param_validation_map_value_entry_descr::bt_param_validation_map_value_entry_descr()' {_ZN41bt_param_validation_map_value_entry_descrC2Ev, aliases _ZN41bt_param_validation_map_value_entry_descrC1Ev} And some bison/flex symbols like: [D] 'function void bt_yyset_out(FILE*, yyscan_t)' {_Z12bt_yyset_outP8_IO_FILEPv} I think this is OK, it is extremely unlikely that anybody is relying on this, and the plugins do not claim to offer a stable ABI anyway. In plugins "with id", the following symbol becomes not visible: [D] '__bt_plugin_descriptor __bt_plugin_descriptor_lttng_utils' {__bt_plugin_descriptor_lttng_utils} I think this is OK, this symbol is only referenced internally, its address is put in the plugin descriptors table. But its address is never looked up by an external party. The equivalent symbol for plugins without an explicit id (__bt_plugin_descriptor_auto) was already local, I'm not sure why. Change-Id: I2dcb41af9bf9ff6aec4f1f950da4bad52707ada9 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/8543 Tested-by: jenkins --- CONTRIBUTING.adoc | 2 - configure.ac | 4 +- include/babeltrace2/plugin/plugin-dev.h | 40 ++--- src/cli/babeltrace2-plugins.h | 14 +- src/cli/babeltrace2-query.c | 1 - src/cli/babeltrace2-query.h | 1 - src/common/assert.h | 1 - src/common/common.c | 51 ------ src/common/common.h | 49 +---- src/common/macros.h | 8 +- src/common/uuid.c | 5 - src/common/uuid.h | 10 +- src/compat/mman.c | 4 - src/ctf-writer/attributes.c | 8 - src/ctf-writer/attributes.h | 8 - src/ctf-writer/clock-class.c | 20 --- src/ctf-writer/clock-class.h | 20 --- src/ctf-writer/clock.c | 19 +- src/ctf-writer/clock.h | 2 - src/ctf-writer/event-class.c | 23 ++- src/ctf-writer/event-class.h | 5 - src/ctf-writer/event.c | 16 +- src/ctf-writer/event.h | 6 - src/ctf-writer/field-path.c | 3 - src/ctf-writer/field-path.h | 9 +- src/ctf-writer/field-types.c | 168 ++++++------------ src/ctf-writer/field-types.h | 117 ------------ src/ctf-writer/field-wrapper.c | 3 - src/ctf-writer/field-wrapper.h | 3 - src/ctf-writer/fields.c | 52 +++--- src/ctf-writer/fields.h | 30 ---- src/ctf-writer/functor.c | 1 - src/ctf-writer/functor.h | 1 - src/ctf-writer/object-pool.c | 2 + src/ctf-writer/object.c | 2 + src/ctf-writer/resolve.c | 1 - src/ctf-writer/resolve.h | 1 - src/ctf-writer/stream-class.c | 27 ++- src/ctf-writer/stream-class.h | 10 -- src/ctf-writer/stream.c | 15 +- src/ctf-writer/stream.h | 3 - src/ctf-writer/trace.c | 32 ++-- src/ctf-writer/trace.h | 23 --- src/ctf-writer/utils.c | 1 + src/ctf-writer/validation.c | 3 - src/ctf-writer/validation.h | 3 - src/ctf-writer/values.c | 50 +----- src/ctf-writer/values.h | 47 ----- src/ctf-writer/visitor.c | 3 +- src/ctf-writer/visitor.h | 1 - src/ctf-writer/writer.c | 13 +- src/ctf-writer/writer.h | 3 - src/ctfser/ctfser.c | 5 - src/ctfser/ctfser.h | 10 +- src/fd-cache/fd-cache.c | 4 - src/fd-cache/fd-cache.h | 4 - src/lib/assert-cond-base.h | 1 - src/lib/assert-cond.c | 1 - src/lib/babeltrace2.c | 11 ++ src/lib/current-thread.c | 7 + src/lib/error.c | 26 ++- src/lib/error.h | 10 +- src/lib/graph/component-class-sink-simple.c | 1 - src/lib/graph/component-class-sink-simple.h | 1 - src/lib/graph/component-class.c | 36 +++- src/lib/graph/component-class.h | 2 - src/lib/graph/component-descriptor-set.c | 5 + src/lib/graph/component-filter.c | 17 +- src/lib/graph/component-filter.h | 2 - src/lib/graph/component-sink.c | 12 +- src/lib/graph/component-sink.h | 2 - src/lib/graph/component-source.c | 11 +- src/lib/graph/component-source.h | 2 - src/lib/graph/component.c | 23 +-- src/lib/graph/component.h | 15 -- src/lib/graph/connection.c | 7 +- src/lib/graph/connection.h | 3 - src/lib/graph/graph.c | 24 ++- src/lib/graph/graph.h | 5 - src/lib/graph/interrupter.c | 8 +- src/lib/graph/iterator.c | 19 +- src/lib/graph/message-iterator-class.c | 8 +- src/lib/graph/message-iterator-class.h | 1 - src/lib/graph/message/discarded-items.c | 18 ++ src/lib/graph/message/event.c | 11 +- src/lib/graph/message/event.h | 3 - src/lib/graph/message/iterator.h | 2 - .../message/message-iterator-inactivity.c | 4 +- src/lib/graph/message/message.c | 5 +- src/lib/graph/message/message.h | 2 - src/lib/graph/message/packet.c | 17 +- src/lib/graph/message/packet.h | 5 - src/lib/graph/message/stream.c | 12 ++ src/lib/graph/mip.c | 2 + src/lib/graph/port.c | 15 +- src/lib/graph/port.h | 2 - src/lib/graph/query-executor.c | 10 ++ src/lib/integer-range-set.c | 22 ++- src/lib/integer-range-set.h | 3 - src/lib/lib-logging.c | 21 +++ src/lib/logging.c | 4 + src/lib/logging.h | 10 -- src/lib/object-pool.h | 2 - src/lib/plugin/plugin-so.c | 9 +- src/lib/plugin/plugin-so.h | 8 - src/lib/plugin/plugin.c | 26 +++ src/lib/prio-heap/prio-heap.h | 7 - src/lib/trace-ir/attributes.c | 8 - src/lib/trace-ir/attributes.h | 8 - src/lib/trace-ir/clock-class.c | 22 ++- src/lib/trace-ir/clock-class.h | 2 - src/lib/trace-ir/clock-snapshot.c | 7 +- src/lib/trace-ir/clock-snapshot.h | 4 - src/lib/trace-ir/event-class.c | 23 ++- src/lib/trace-ir/event-class.h | 1 - src/lib/trace-ir/event.c | 15 +- src/lib/trace-ir/event.h | 3 - src/lib/trace-ir/field-class.c | 87 ++++++++- src/lib/trace-ir/field-class.h | 3 - src/lib/trace-ir/field-path.c | 8 +- src/lib/trace-ir/field-path.h | 1 - src/lib/trace-ir/field-wrapper.c | 3 - src/lib/trace-ir/field-wrapper.h | 3 - src/lib/trace-ir/field.c | 44 ++++- src/lib/trace-ir/field.h | 3 - src/lib/trace-ir/packet.c | 11 +- src/lib/trace-ir/packet.h | 4 - src/lib/trace-ir/resolve-field-path.c | 1 - src/lib/trace-ir/resolve-field-path.h | 1 - src/lib/trace-ir/stream-class.c | 41 ++++- src/lib/trace-ir/stream-class.h | 1 - src/lib/trace-ir/stream.c | 15 +- src/lib/trace-ir/stream.h | 1 - src/lib/trace-ir/trace-class.c | 16 +- src/lib/trace-ir/trace-class.h | 1 - src/lib/trace-ir/trace.c | 27 ++- src/lib/trace-ir/trace.h | 3 - src/lib/util.c | 1 + src/lib/value.c | 56 +++++- src/lib/value.h | 1 - src/logging/log.c | 14 -- src/logging/log.h | 19 +- src/param-parse/param-parse.c | 1 - src/param-parse/param-parse.h | 1 - src/plugins/common/muxing/muxing.c | 1 - src/plugins/common/muxing/muxing.h | 2 +- .../param-validation/param-validation.h | 4 +- src/plugins/ctf/common/bfcr/bfcr.cpp | 5 - src/plugins/ctf/common/bfcr/bfcr.hpp | 5 - src/plugins/ctf/common/metadata/ast.hpp | 6 - .../metadata/ctf-meta-configure-ir-trace.cpp | 1 - .../metadata/ctf-meta-configure-ir-trace.hpp | 1 - .../ctf/common/metadata/ctf-meta-resolve.cpp | 1 - .../common/metadata/ctf-meta-translate.cpp | 1 - .../metadata/ctf-meta-update-alignments.cpp | 1 - .../ctf-meta-update-default-clock-classes.cpp | 1 - .../common/metadata/ctf-meta-update-in-ir.cpp | 1 - .../metadata/ctf-meta-update-meanings.cpp | 1 - .../ctf-meta-update-stream-class-config.cpp | 1 - .../ctf-meta-update-text-array-sequence.cpp | 1 - .../ctf-meta-update-value-storing-indexes.cpp | 1 - .../ctf/common/metadata/ctf-meta-validate.cpp | 1 - .../ctf/common/metadata/ctf-meta-visitors.hpp | 11 -- ...tf-meta-warn-meaningless-header-fields.cpp | 1 - .../decoder-packetized-file-stream-to-buf.cpp | 1 - .../decoder-packetized-file-stream-to-buf.hpp | 1 - src/plugins/ctf/common/metadata/decoder.cpp | 10 -- src/plugins/ctf/common/metadata/decoder.hpp | 10 -- src/plugins/ctf/common/metadata/objstack.cpp | 3 - src/plugins/ctf/common/metadata/objstack.hpp | 3 - src/plugins/ctf/common/metadata/parser.ypp | 10 -- src/plugins/ctf/common/metadata/scanner.hpp | 4 - .../common/metadata/visitor-generate-ir.cpp | 5 - src/plugins/ctf/common/msg-iter/msg-iter.cpp | 8 - src/plugins/ctf/common/msg-iter/msg-iter.hpp | 10 -- src/plugins/ctf/fs-sink/fs-sink-stream.cpp | 5 - src/plugins/ctf/fs-sink/fs-sink-stream.hpp | 5 - src/plugins/ctf/fs-sink/fs-sink-trace.cpp | 2 - src/plugins/ctf/fs-sink/fs-sink-trace.hpp | 2 - src/plugins/ctf/fs-sink/fs-sink.cpp | 4 - src/plugins/ctf/fs-sink/fs-sink.hpp | 4 - .../ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp | 1 - .../ctf/fs-sink/translate-ctf-ir-to-tsdl.hpp | 1 - .../fs-sink/translate-trace-ir-to-ctf-ir.cpp | 3 - .../fs-sink/translate-trace-ir-to-ctf-ir.hpp | 3 - src/plugins/ctf/fs-src/data-stream-file.cpp | 7 - src/plugins/ctf/fs-src/data-stream-file.hpp | 9 - src/plugins/ctf/fs-src/file.cpp | 3 - src/plugins/ctf/fs-src/file.hpp | 3 - src/plugins/ctf/fs-src/fs.cpp | 7 - src/plugins/ctf/fs-src/fs.hpp | 13 -- src/plugins/ctf/fs-src/metadata.cpp | 4 - src/plugins/ctf/fs-src/metadata.hpp | 5 - src/plugins/ctf/fs-src/query.cpp | 3 - src/plugins/ctf/fs-src/query.hpp | 3 - src/plugins/ctf/lttng-live/data-stream.cpp | 3 - src/plugins/ctf/lttng-live/lttng-live.cpp | 9 - src/plugins/ctf/lttng-live/lttng-live.hpp | 1 - src/plugins/ctf/lttng-live/metadata.cpp | 3 - .../ctf/lttng-live/viewer-connection.cpp | 10 -- src/plugins/lttng-utils/debug-info/bin-info.c | 9 - src/plugins/lttng-utils/debug-info/bin-info.h | 9 - src/plugins/lttng-utils/debug-info/crc32.h | 1 - .../lttng-utils/debug-info/debug-info.c | 7 - .../lttng-utils/debug-info/debug-info.h | 7 - src/plugins/lttng-utils/debug-info/dwarf.c | 13 -- src/plugins/lttng-utils/debug-info/dwarf.h | 13 -- .../debug-info/trace-ir-data-copy.c | 5 - .../debug-info/trace-ir-data-copy.h | 5 - .../lttng-utils/debug-info/trace-ir-mapping.c | 14 -- .../lttng-utils/debug-info/trace-ir-mapping.h | 17 -- .../debug-info/trace-ir-metadata-copy.c | 6 - .../debug-info/trace-ir-metadata-copy.h | 6 - .../trace-ir-metadata-field-class-copy.c | 2 - .../trace-ir-metadata-field-class-copy.h | 2 - src/plugins/lttng-utils/debug-info/utils.c | 2 - src/plugins/lttng-utils/debug-info/utils.h | 2 - src/plugins/text/details/details.c | 6 - src/plugins/text/details/details.h | 6 - src/plugins/text/details/obj-lifetime-mgmt.c | 5 - src/plugins/text/details/obj-lifetime-mgmt.h | 5 - src/plugins/text/details/write.c | 1 - src/plugins/text/details/write.h | 1 - src/plugins/text/dmesg/dmesg.c | 7 - src/plugins/text/dmesg/dmesg.h | 7 - src/plugins/text/pretty/pretty.c | 4 - src/plugins/text/pretty/pretty.h | 7 - src/plugins/text/pretty/print.c | 3 - src/plugins/utils/counter/counter.c | 4 - src/plugins/utils/counter/counter.h | 4 - src/plugins/utils/dummy/dummy.c | 4 - src/plugins/utils/dummy/dummy.h | 4 - src/plugins/utils/muxer/muxer.c | 8 - src/plugins/utils/muxer/muxer.h | 8 - src/plugins/utils/trimmer/trimmer.c | 4 - src/plugins/utils/trimmer/trimmer.h | 5 - src/py-common/py-common.c | 3 - src/py-common/py-common.h | 3 - src/string-format/format-error.h | 2 - .../format-plugin-comp-cls-name.h | 1 - 240 files changed, 920 insertions(+), 1434 deletions(-) diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index 9af7a419..069e08aa 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -439,7 +439,6 @@ level, for example: + [source,c] ---- -BT_HIDDEN char *bt_common_get_home_plugin_path(int log_level); ---- + @@ -1148,7 +1147,6 @@ struct my_comp { /* ... */ }; -BT_HIDDEN bt_self_component_status my_comp_init( bt_self_component_source *self_comp_src, bt_value *params, void *init_method_data) diff --git a/configure.ac b/configure.ac index b78e457e..1a406832 100644 --- a/configure.ac +++ b/configure.ac @@ -659,8 +659,8 @@ AE_IF_FEATURE_ENABLED([asan], [ # CFLAGS from libraries (the glib ones are needed for the following sizeof # test). -AM_CFLAGS="${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CFLAGS}" -AM_CXXFLAGS="${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CXXFLAGS}" +AM_CFLAGS="-fvisibility=hidden ${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CFLAGS}" +AM_CXXFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden ${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CXXFLAGS}" AM_LDFLAGS="${ASAN_LDFLAGS}" # Check that the current size_t matches the size that glib thinks it should diff --git a/include/babeltrace2/plugin/plugin-dev.h b/include/babeltrace2/plugin/plugin-dev.h index 1c8d0154..7a862c05 100644 --- a/include/babeltrace2/plugin/plugin-dev.h +++ b/include/babeltrace2/plugin/plugin-dev.h @@ -18,14 +18,12 @@ #include /* - * _BT_HIDDEN: set the hidden attribute for internal functions - * On Windows, symbols are local unless explicitly exported, - * see https://gcc.gnu.org/wiki/Visibility + * _BT_EXPORT: set the visibility for exported functions. */ #if defined(_WIN32) || defined(__CYGWIN__) -#define _BT_HIDDEN +#define _BT_EXPORT #else -#define _BT_HIDDEN __attribute__((visibility("hidden"))) +#define _BT_EXPORT __attribute__((visibility("default"))) #endif #ifdef __cplusplus @@ -321,50 +319,50 @@ other BT_PLUGIN*() macro. */ #define BT_PLUGIN_MODULE() \ static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_dummy __BT_PLUGIN_DESCRIPTOR_ATTRS = NULL; \ - _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA; \ - _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_END_EXTRA; \ + extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA; \ + extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_END_EXTRA; \ \ static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_dummy __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = NULL; \ - _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \ - _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \ + extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \ + extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \ \ static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_component_class_descriptor_dummy __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = NULL; \ - _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA; \ - _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA; \ + extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA; \ + extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA; \ \ 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; \ - _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; \ - _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; \ + 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; \ + 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; \ \ - struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void) \ + _BT_EXPORT struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void) \ { \ return &__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL; \ } \ - struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void) \ + _BT_EXPORT struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void) \ { \ return &__BT_PLUGIN_DESCRIPTOR_END_SYMBOL; \ } \ - struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void) \ + _BT_EXPORT struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void) \ { \ return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \ } \ - struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void) \ + _BT_EXPORT struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void) \ { \ return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \ } \ - struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void) \ + _BT_EXPORT struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void) \ { \ return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL; \ } \ - struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void) \ + _BT_EXPORT struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void) \ { \ return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL; \ } \ - struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void) \ + _BT_EXPORT struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void) \ { \ return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \ } \ - struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void) \ + _BT_EXPORT struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void) \ { \ return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \ } diff --git a/src/cli/babeltrace2-plugins.h b/src/cli/babeltrace2-plugins.h index c3f59b6c..c95eda90 100644 --- a/src/cli/babeltrace2-plugins.h +++ b/src/cli/babeltrace2-plugins.h @@ -12,15 +12,15 @@ #include #include "common/macros.h" -BT_HIDDEN void init_loaded_plugins(void); -BT_HIDDEN void fini_loaded_plugins(void); +void init_loaded_plugins(void); +void fini_loaded_plugins(void); -BT_HIDDEN int require_loaded_plugins(const bt_value *plugin_paths); +int require_loaded_plugins(const bt_value *plugin_paths); -BT_HIDDEN size_t get_loaded_plugins_count(void); -BT_HIDDEN const bt_plugin **borrow_loaded_plugins(void); -BT_HIDDEN const bt_plugin *borrow_loaded_plugin_by_index(size_t index); -BT_HIDDEN const bt_plugin *borrow_loaded_plugin_by_name(const char *name); +size_t get_loaded_plugins_count(void); +const bt_plugin **borrow_loaded_plugins(void); +const bt_plugin *borrow_loaded_plugin_by_index(size_t index); +const bt_plugin *borrow_loaded_plugin_by_name(const char *name); #endif /* CLI_BABELTRACE_PLUGINS_H */ diff --git a/src/cli/babeltrace2-query.c b/src/cli/babeltrace2-query.c index 38f42b58..4493b21a 100644 --- a/src/cli/babeltrace2-query.c +++ b/src/cli/babeltrace2-query.c @@ -21,7 +21,6 @@ void set_fail_reason(const char **fail_reason, const char *reason) } } -BT_HIDDEN bt_query_executor_query_status cli_query(const bt_component_class *comp_cls, const char *obj, const bt_value *params, bt_logging_level log_level, const bt_interrupter *interrupter, diff --git a/src/cli/babeltrace2-query.h b/src/cli/babeltrace2-query.h index 2b4f55f4..c128bb6c 100644 --- a/src/cli/babeltrace2-query.h +++ b/src/cli/babeltrace2-query.h @@ -10,7 +10,6 @@ #include #include "common/macros.h" -BT_HIDDEN bt_query_executor_query_status cli_query(const bt_component_class *comp_cls, const char *obj, const bt_value *params, bt_logging_level log_level, const bt_interrupter *interrupter, diff --git a/src/common/assert.h b/src/common/assert.h index dd9b9127..52349e64 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -17,7 +17,6 @@ extern "C" { #endif -BT_HIDDEN extern void bt_common_assert_failed(const char *file, int line, const char *func, const char *assertion) __attribute__((noreturn)); diff --git a/src/common/common.c b/src/common/common.c index aca73e5f..0cdc1739 100644 --- a/src/common/common.c +++ b/src/common/common.c @@ -221,20 +221,17 @@ void __attribute__((constructor)) bt_common_color_ctor(void) color_codes.bg_light_gray = BT_COMMON_COLOR_BG_LIGHT_GRAY; } -BT_HIDDEN const char *bt_common_get_system_plugin_path(void) { return SYSTEM_PLUGIN_PATH; } #ifdef __MINGW32__ -BT_HIDDEN bool bt_common_is_setuid_setgid(void) { return false; } #else /* __MINGW32__ */ -BT_HIDDEN bool bt_common_is_setuid_setgid(void) { return (geteuid() != getuid() || getegid() != getgid()); @@ -280,7 +277,6 @@ end: } #endif /* __MINGW32__ */ -BT_HIDDEN char *bt_common_get_home_plugin_path(int log_level) { char *path = NULL; @@ -312,7 +308,6 @@ end: return path; } -BT_HIDDEN int bt_common_append_plugin_path_dirs(const char *paths, GPtrArray *dirs) { int ret = 0; @@ -396,7 +391,6 @@ end: return istty; } -BT_HIDDEN bool bt_common_colors_supported(void) { static bool supports_colors = false; @@ -452,157 +446,131 @@ end: return supports_colors; } -BT_HIDDEN const char *bt_common_color_reset(void) { return bt_common_color_code_reset; } -BT_HIDDEN const char *bt_common_color_bold(void) { return bt_common_color_code_bold; } -BT_HIDDEN const char *bt_common_color_fg_default(void) { return bt_common_color_code_fg_default; } -BT_HIDDEN const char *bt_common_color_fg_red(void) { return bt_common_color_code_fg_red; } -BT_HIDDEN const char *bt_common_color_fg_green(void) { return bt_common_color_code_fg_green; } -BT_HIDDEN const char *bt_common_color_fg_yellow(void) { return bt_common_color_code_fg_yellow; } -BT_HIDDEN const char *bt_common_color_fg_blue(void) { return bt_common_color_code_fg_blue; } -BT_HIDDEN const char *bt_common_color_fg_magenta(void) { return bt_common_color_code_fg_magenta; } -BT_HIDDEN const char *bt_common_color_fg_cyan(void) { return bt_common_color_code_fg_cyan; } -BT_HIDDEN const char *bt_common_color_fg_light_gray(void) { return bt_common_color_code_fg_light_gray; } -BT_HIDDEN const char *bt_common_color_fg_bright_red(void) { return bt_common_color_code_fg_bright_red; } -BT_HIDDEN const char *bt_common_color_fg_bright_green(void) { return bt_common_color_code_fg_bright_green; } -BT_HIDDEN const char *bt_common_color_fg_bright_yellow(void) { return bt_common_color_code_fg_bright_yellow; } -BT_HIDDEN const char *bt_common_color_fg_bright_blue(void) { return bt_common_color_code_fg_bright_blue; } -BT_HIDDEN const char *bt_common_color_fg_bright_magenta(void) { return bt_common_color_code_fg_bright_magenta; } -BT_HIDDEN const char *bt_common_color_fg_bright_cyan(void) { return bt_common_color_code_fg_bright_cyan; } -BT_HIDDEN const char *bt_common_color_fg_bright_light_gray(void) { return bt_common_color_code_fg_bright_light_gray; } -BT_HIDDEN const char *bt_common_color_bg_default(void) { return bt_common_color_code_bg_default; } -BT_HIDDEN const char *bt_common_color_bg_red(void) { return bt_common_color_code_bg_red; } -BT_HIDDEN const char *bt_common_color_bg_green(void) { return bt_common_color_code_bg_green; } -BT_HIDDEN const char *bt_common_color_bg_yellow(void) { return bt_common_color_code_bg_yellow; } -BT_HIDDEN const char *bt_common_color_bg_blue(void) { return bt_common_color_code_bg_blue; } -BT_HIDDEN const char *bt_common_color_bg_magenta(void) { return bt_common_color_code_bg_magenta; } -BT_HIDDEN const char *bt_common_color_bg_cyan(void) { return bt_common_color_code_bg_cyan; } -BT_HIDDEN const char *bt_common_color_bg_light_gray(void) { return bt_common_color_code_bg_light_gray; } -BT_HIDDEN void bt_common_color_get_codes(struct bt_common_color_codes *codes, enum bt_common_color_when use_colors) { @@ -621,7 +589,6 @@ void bt_common_color_get_codes(struct bt_common_color_codes *codes, } } -BT_HIDDEN GString *bt_common_string_until(const char *input, const char *escapable_chars, const char *end_chars, size_t *end_pos) { @@ -704,7 +671,6 @@ end: return output; } -BT_HIDDEN GString *bt_common_shell_quote(const char *input, bool with_single_quotes) { GString *output = g_string_new(NULL); @@ -760,7 +726,6 @@ end: return output; } -BT_HIDDEN bool bt_common_string_is_printable(const char *input) { const char *ch; @@ -779,7 +744,6 @@ end: return printable; } -BT_HIDDEN void bt_common_destroy_lttng_live_url_parts( struct bt_common_lttng_live_url_parts *parts) { @@ -811,7 +775,6 @@ end: return; } -BT_HIDDEN struct bt_common_lttng_live_url_parts bt_common_parse_lttng_live_url( const char *url, char *error_buf, size_t error_buf_size) { @@ -990,7 +953,6 @@ end: return parts; } -BT_HIDDEN void bt_common_normalize_star_glob_pattern(char *pattern) { const char *p; @@ -1050,7 +1012,6 @@ bool at_end_of_pattern(const char *p, const char *pattern, size_t pattern_len) * string length of `pattern` or `candidate` if the string is * null-terminated. */ -BT_HIDDEN bool bt_common_star_glob_match(const char *pattern, size_t pattern_len, const char *candidate, size_t candidate_len) { const char *retry_c = candidate, *retry_p = pattern, *c, *p; @@ -1285,7 +1246,6 @@ end_of_pattern: } #ifdef __MINGW32__ -BT_HIDDEN GString *bt_common_normalize_path(const char *path, const char *wd) { char *tmp; @@ -1347,7 +1307,6 @@ void destroy_gstring(void *gstring) (void) g_string_free(gstring, TRUE); } -BT_HIDDEN GString *bt_common_normalize_path(const char *path, const char *wd) { size_t i; @@ -1432,7 +1391,6 @@ end: } #endif -BT_HIDDEN size_t bt_common_get_page_size(int log_level) { int page_size; @@ -1707,7 +1665,6 @@ update_rw_fmt: *out_fmt_ch = fmt_ch; } -BT_HIDDEN void bt_common_custom_vsnprintf(char *buf, size_t buf_size, char intro, bt_common_handle_custom_specifier_func handle_specifier, @@ -1751,7 +1708,6 @@ void bt_common_custom_vsnprintf(char *buf, size_t buf_size, *buf_ch = '\0'; } -BT_HIDDEN void bt_common_custom_snprintf(char *buf, size_t buf_size, char intro, bt_common_handle_custom_specifier_func handle_specifier, @@ -1764,7 +1720,6 @@ void bt_common_custom_snprintf(char *buf, size_t buf_size, va_end(args); } -BT_HIDDEN void bt_common_sep_digits(char *str, unsigned int digits_per_group, char sep) { const char *rd; @@ -1867,7 +1822,6 @@ void bt_common_sep_digits(char *str, unsigned int digits_per_group, char sep) } } -BT_HIDDEN GString *bt_common_fold(const char *str, unsigned int total_length, unsigned int indent) { @@ -1986,14 +1940,12 @@ end: } #ifdef __MINGW32__ -BT_HIDDEN int bt_common_get_term_size(unsigned int *width, unsigned int *height) { /* Not supported on Windows yet */ return -1; } #else /* __MINGW32__ */ -BT_HIDDEN int bt_common_get_term_size(unsigned int *width, unsigned int *height) { int ret = 0; @@ -2017,7 +1969,6 @@ end: } #endif /* __MINGW32__ */ -BT_HIDDEN int bt_common_g_string_append_printf(GString *str, const char *fmt, ...) { va_list ap; @@ -2049,7 +2000,6 @@ int bt_common_g_string_append_printf(GString *str, const char *fmt, ...) return print_len; } -BT_HIDDEN int bt_common_append_file_content_to_g_string(GString *str, FILE *fp) { const size_t chunk_size = 4096; @@ -2090,7 +2040,6 @@ end: return ret; } -BT_HIDDEN void bt_common_abort(void) { static const char * const exec_on_abort_env_name = diff --git a/src/common/common.h b/src/common/common.h index 2c9ef382..b447ec88 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -113,14 +113,12 @@ struct bt_common_lttng_live_url_parts { * Checks if the current process has setuid or setgid access rights. * Returns `true` if so. */ -BT_HIDDEN bool bt_common_is_setuid_setgid(void); /* * Returns the system-wide plugin path, e.g. * `/usr/lib/babeltrace2/plugins`. Do not free the return value. */ -BT_HIDDEN const char *bt_common_get_system_plugin_path(void); /* @@ -128,7 +126,6 @@ const char *bt_common_get_system_plugin_path(void); * `/home/user/.local/lib/babeltrace2/plugins`. You need to free the * return value. */ -BT_HIDDEN char *bt_common_get_home_plugin_path(int log_level); /* @@ -136,92 +133,64 @@ char *bt_common_get_home_plugin_path(int log_level); * `paths` is a list of directories separated by `:`. Returns 0 on * success. */ -BT_HIDDEN int bt_common_append_plugin_path_dirs(const char *paths, GPtrArray *dirs); /* * Returns `true` if terminal color codes are supported for this * process. */ -BT_HIDDEN bool bt_common_colors_supported(void); -BT_HIDDEN const char *bt_common_color_reset(void); -BT_HIDDEN const char *bt_common_color_bold(void); -BT_HIDDEN const char *bt_common_color_fg_default(void); -BT_HIDDEN const char *bt_common_color_fg_red(void); -BT_HIDDEN const char *bt_common_color_fg_green(void); -BT_HIDDEN const char *bt_common_color_fg_yellow(void); -BT_HIDDEN const char *bt_common_color_fg_blue(void); -BT_HIDDEN const char *bt_common_color_fg_magenta(void); -BT_HIDDEN const char *bt_common_color_fg_cyan(void); -BT_HIDDEN const char *bt_common_color_fg_light_gray(void); -BT_HIDDEN const char *bt_common_color_fg_bright_red(void); -BT_HIDDEN const char *bt_common_color_fg_bright_green(void); -BT_HIDDEN const char *bt_common_color_fg_bright_yellow(void); -BT_HIDDEN const char *bt_common_color_fg_bright_blue(void); -BT_HIDDEN const char *bt_common_color_fg_bright_magenta(void); -BT_HIDDEN const char *bt_common_color_fg_bright_cyan(void); -BT_HIDDEN const char *bt_common_color_fg_bright_light_gray(void); -BT_HIDDEN const char *bt_common_color_bg_default(void); -BT_HIDDEN const char *bt_common_color_bg_red(void); -BT_HIDDEN const char *bt_common_color_bg_green(void); -BT_HIDDEN const char *bt_common_color_bg_yellow(void); -BT_HIDDEN const char *bt_common_color_bg_blue(void); -BT_HIDDEN const char *bt_common_color_bg_magenta(void); -BT_HIDDEN const char *bt_common_color_bg_cyan(void); -BT_HIDDEN const char *bt_common_color_bg_light_gray(void); -BT_HIDDEN void bt_common_color_get_codes(struct bt_common_color_codes *codes, enum bt_common_color_when use_colors); @@ -231,7 +200,6 @@ void bt_common_color_get_codes(struct bt_common_color_codes *codes, * found in `escapable_chars`, and sets `*end_pos` to the position of * the end (from `input`). The caller owns the returned GString. */ -BT_HIDDEN GString *bt_common_string_until(const char *input, const char *escapable_chars, const char *end_chars, size_t *end_pos); @@ -242,21 +210,18 @@ GString *bt_common_string_until(const char *input, const char *escapable_chars, * prepend and append them manually, although they are not always * required. The caller owns the returned GString. */ -BT_HIDDEN GString *bt_common_shell_quote(const char *input, bool with_single_quotes); /* * Returns `true` if `input` is a string made only of printable * characters. */ -BT_HIDDEN bool bt_common_string_is_printable(const char *input); /* * Destroys the parts of an LTTng live URL as returned by * bt_common_parse_lttng_live_url(). */ -BT_HIDDEN void bt_common_destroy_lttng_live_url_parts( struct bt_common_lttng_live_url_parts *parts); @@ -266,7 +231,6 @@ void bt_common_destroy_lttng_live_url_parts( * up to `error_buf_size` bytes. You must destroy the returned value * with bt_common_destroy_lttng_live_url_parts(). */ -BT_HIDDEN struct bt_common_lttng_live_url_parts bt_common_parse_lttng_live_url( const char *url, char *error_buf, size_t error_buf_size); @@ -274,14 +238,12 @@ struct bt_common_lttng_live_url_parts bt_common_parse_lttng_live_url( * Normalizes (in place) a star globbing pattern to be used with * bt_common_star_glob_match(). This function always succeeds. */ -BT_HIDDEN void bt_common_normalize_star_glob_pattern(char *pattern); /* * Returns `true` if `candidate` (of size `candidate_len`) matches * the star globbing pattern `pattern` (of size `pattern_len`). */ -BT_HIDDEN bool bt_common_star_glob_match(const char *pattern, size_t pattern_len, const char *candidate, size_t candidate_len); @@ -297,7 +259,6 @@ bool bt_common_star_glob_match(const char *pattern, size_t pattern_len, * * The caller owns the returned GString. */ -BT_HIDDEN GString *bt_common_normalize_path(const char *path, const char *wd); typedef void (* bt_common_handle_custom_specifier_func)(void *priv_data, @@ -352,7 +313,6 @@ typedef void (* bt_common_handle_custom_specifier_func)(void *priv_data, * do not return error codes: they abort when there's any error (bad * format string, for example). */ -BT_HIDDEN void bt_common_custom_vsnprintf(char *buf, size_t buf_size, char intro, bt_common_handle_custom_specifier_func handle_specifier, @@ -361,7 +321,6 @@ void bt_common_custom_vsnprintf(char *buf, size_t buf_size, /* * Variadic form of bt_common_custom_vsnprintf(). */ -BT_HIDDEN void bt_common_custom_snprintf(char *buf, size_t buf_size, char intro, bt_common_handle_custom_specifier_func handle_specifier, @@ -370,7 +329,6 @@ void bt_common_custom_snprintf(char *buf, size_t buf_size, /* * Returns the system page size. */ -BT_HIDDEN size_t bt_common_get_page_size(int log_level); /* @@ -386,7 +344,6 @@ size_t bt_common_get_page_size(int log_level); * `strlen(str)` must not be 0. `digits_per_group` must not be 0. `sep` * must not be `\0`. */ -BT_HIDDEN void bt_common_sep_digits(char *str, unsigned int digits_per_group, char sep); /* @@ -402,7 +359,6 @@ void bt_common_sep_digits(char *str, unsigned int digits_per_group, char sep); * * The returned string, on success, is owned by the caller. */ -BT_HIDDEN GString *bt_common_fold(const char *str, unsigned int total_length, unsigned int indent); @@ -410,7 +366,6 @@ GString *bt_common_fold(const char *str, unsigned int total_length, * Writes the terminal's width to `*width`, its height to `*height`, * and returns 0 on success, or returns -1 on error. */ -BT_HIDDEN int bt_common_get_term_size(unsigned int *width, unsigned int *height); /* @@ -419,10 +374,8 @@ int bt_common_get_term_size(unsigned int *width, unsigned int *height); * * This function does NOT rewind `fp` once it's done or on error. */ -BT_HIDDEN int bt_common_append_file_content_to_g_string(GString *str, FILE *fp); -BT_HIDDEN void bt_common_abort(void) __attribute__((noreturn)); /* @@ -839,7 +792,7 @@ end: * bt_g_string_append_printf cannot be inlined because it expects a * variadic argument list. */ -BT_HIDDEN __BT_ATTR_FORMAT_PRINTF(2, 3) +__BT_ATTR_FORMAT_PRINTF(2, 3) int bt_common_g_string_append_printf(GString *str, const char *fmt, ...); static inline diff --git a/src/common/macros.h b/src/common/macros.h index 6a3e061d..533cb9fb 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -21,14 +21,12 @@ extern "C" { ((type) (a) > (type) (b) ? (type) (a) : (type) (b)) /* - * BT_HIDDEN: set the hidden attribute for internal functions - * On Windows, symbols are local unless explicitly exported, - * see https://gcc.gnu.org/wiki/Visibility + * BT_EXPORT: set the visibility for exported functions. */ #if defined(_WIN32) || defined(__CYGWIN__) -#define BT_HIDDEN +#define BT_EXPORT #else -#define BT_HIDDEN __attribute__((visibility("hidden"))) +#define BT_EXPORT __attribute__((visibility("default"))) #endif /* diff --git a/src/common/uuid.c b/src/common/uuid.c index b2457602..5c709f73 100644 --- a/src/common/uuid.c +++ b/src/common/uuid.c @@ -16,7 +16,6 @@ /* * Generate a random UUID according to RFC4122, section 4.4. */ -BT_HIDDEN void bt_uuid_generate(bt_uuid_t uuid_out) { int i; @@ -51,7 +50,6 @@ void bt_uuid_generate(bt_uuid_t uuid_out) g_rand_free(rand); } -BT_HIDDEN void bt_uuid_to_str(const bt_uuid_t uuid_in, char *str_out) { BT_ASSERT_DBG(uuid_in); @@ -60,7 +58,6 @@ void bt_uuid_to_str(const bt_uuid_t uuid_in, char *str_out) snprintf(str_out, BT_UUID_STR_LEN + 1, BT_UUID_FMT, BT_UUID_FMT_VALUES(uuid_in)); } -BT_HIDDEN int bt_uuid_from_str(const char *str_in, bt_uuid_t uuid_out) { int ret = 0; @@ -84,13 +81,11 @@ end: return ret; } -BT_HIDDEN int bt_uuid_compare(const bt_uuid_t uuid_a, const bt_uuid_t uuid_b) { return memcmp(uuid_a, uuid_b, BT_UUID_LEN); } -BT_HIDDEN void bt_uuid_copy(bt_uuid_t uuid_dest, const bt_uuid_t uuid_src) { BT_ASSERT(uuid_dest); diff --git a/src/common/uuid.h b/src/common/uuid.h index 73ae1d8a..dfe3a7ee 100644 --- a/src/common/uuid.h +++ b/src/common/uuid.h @@ -36,11 +36,11 @@ extern "C" { typedef uint8_t bt_uuid_t[BT_UUID_LEN]; -BT_HIDDEN void bt_uuid_generate(bt_uuid_t uuid_out); -BT_HIDDEN void bt_uuid_to_str(const bt_uuid_t uuid_in, char *str_out); -BT_HIDDEN int bt_uuid_from_str(const char *str_in, bt_uuid_t uuid_out); -BT_HIDDEN int bt_uuid_compare(const bt_uuid_t uuid_a, const bt_uuid_t uuid_b); -BT_HIDDEN void bt_uuid_copy(bt_uuid_t uuid_dest, const bt_uuid_t uuid_src); +void bt_uuid_generate(bt_uuid_t uuid_out); +void bt_uuid_to_str(const bt_uuid_t uuid_in, char *str_out); +int bt_uuid_from_str(const char *str_in, bt_uuid_t uuid_out); +int bt_uuid_compare(const bt_uuid_t uuid_a, const bt_uuid_t uuid_b); +void bt_uuid_copy(bt_uuid_t uuid_dest, const bt_uuid_t uuid_src); #ifdef __cplusplus } diff --git a/src/compat/mman.c b/src/compat/mman.c index 7cd7a6fd..e8eea876 100644 --- a/src/compat/mman.c +++ b/src/compat/mman.c @@ -20,7 +20,6 @@ * On macOS, we need a dummy symbol so that the linker won't * complain of an empty table of contents. */ -BT_HIDDEN int bt_mman_dummy_symbol; #endif /* __APPLE__ */ @@ -153,7 +152,6 @@ DWORD map_prot_flags(int prot, DWORD *dwDesiredAccess) return 0; } -BT_HIDDEN void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset, int log_level) { @@ -254,7 +252,6 @@ error: return MAP_FAILED; } -BT_HIDDEN int bt_munmap(void *addr, size_t length) { int ret = 0; @@ -283,7 +280,6 @@ end: return ret; } -BT_HIDDEN size_t bt_mmap_get_offset_align_size(int log_level) { SYSTEM_INFO sysinfo; diff --git a/src/ctf-writer/attributes.c b/src/ctf-writer/attributes.c index 3196be35..27b689e2 100644 --- a/src/ctf-writer/attributes.c +++ b/src/ctf-writer/attributes.c @@ -23,7 +23,6 @@ #define BT_CTF_ATTR_NAME_INDEX 0 #define BT_CTF_ATTR_VALUE_INDEX 1 -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_attributes_create(void) { struct bt_ctf_private_value *attr_obj; @@ -54,20 +53,17 @@ struct bt_ctf_private_value *bt_ctf_attributes_create(void) return attr_obj; } -BT_HIDDEN void bt_ctf_attributes_destroy(struct bt_ctf_private_value *attr_obj) { BT_LOGD("Destroying attributes object: addr=%p", attr_obj); bt_ctf_object_put_ref(attr_obj); } -BT_HIDDEN int64_t bt_ctf_attributes_get_count(struct bt_ctf_private_value *attr_obj) { return bt_ctf_value_array_get_length(bt_ctf_private_value_as_value(attr_obj)); } -BT_HIDDEN const char *bt_ctf_attributes_get_field_name(struct bt_ctf_private_value *attr_obj, uint64_t index) { @@ -112,7 +108,6 @@ end: return ret; } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_attributes_borrow_field_value(struct bt_ctf_private_value *attr_obj, uint64_t index) { @@ -203,7 +198,6 @@ error: return value_obj; } -BT_HIDDEN int bt_ctf_attributes_set_field_value(struct bt_ctf_private_value *attr_obj, const char *name, struct bt_ctf_private_value *value_obj) { @@ -256,7 +250,6 @@ end: return ret; } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_attributes_borrow_field_value_by_name( struct bt_ctf_private_value *attr_obj, const char *name) { @@ -288,7 +281,6 @@ end: return value_obj; } -BT_HIDDEN int bt_ctf_attributes_freeze(struct bt_ctf_private_value *attr_obj) { uint64_t i; diff --git a/src/ctf-writer/attributes.h b/src/ctf-writer/attributes.h index 6072fde7..c139af34 100644 --- a/src/ctf-writer/attributes.h +++ b/src/ctf-writer/attributes.h @@ -17,32 +17,24 @@ extern "C" { #include "values.h" -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_attributes_create(void); -BT_HIDDEN void bt_ctf_attributes_destroy(struct bt_ctf_private_value *attr_obj); -BT_HIDDEN int64_t bt_ctf_attributes_get_count(struct bt_ctf_private_value *attr_obj); -BT_HIDDEN const char *bt_ctf_attributes_get_field_name(struct bt_ctf_private_value *attr_obj, uint64_t index); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_attributes_borrow_field_value(struct bt_ctf_private_value *attr_obj, uint64_t index); -BT_HIDDEN int bt_ctf_attributes_set_field_value(struct bt_ctf_private_value *attr_obj, const char *name, struct bt_ctf_private_value *value_obj); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_attributes_borrow_field_value_by_name( struct bt_ctf_private_value *attr_obj, const char *name); -BT_HIDDEN int bt_ctf_attributes_freeze(struct bt_ctf_private_value *attr_obj); #ifdef __cplusplus diff --git a/src/ctf-writer/clock-class.c b/src/ctf-writer/clock-class.c index 8f185cfa..4c056b86 100644 --- a/src/ctf-writer/clock-class.c +++ b/src/ctf-writer/clock-class.c @@ -26,13 +26,11 @@ static void bt_ctf_clock_class_destroy(struct bt_ctf_object *obj); -BT_HIDDEN bt_ctf_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class) { return clock_class && clock_class->name; } -BT_HIDDEN int bt_ctf_clock_class_set_name(struct bt_ctf_clock_class *clock_class, const char *name) { @@ -95,7 +93,6 @@ end: return is_valid; } -BT_HIDDEN struct bt_ctf_clock_class *bt_ctf_clock_class_create(const char *name, uint64_t freq) { @@ -136,7 +133,6 @@ error: return clock_class; } -BT_HIDDEN const char *bt_ctf_clock_class_get_name(struct bt_ctf_clock_class *clock_class) { const char *ret = NULL; @@ -154,7 +150,6 @@ end: return ret; } -BT_HIDDEN const char *bt_ctf_clock_class_get_description( struct bt_ctf_clock_class *clock_class) { @@ -172,7 +167,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_clock_class_set_description(struct bt_ctf_clock_class *clock_class, const char *desc) { @@ -203,7 +197,6 @@ end: return ret; } -BT_HIDDEN uint64_t bt_ctf_clock_class_get_frequency( struct bt_ctf_clock_class *clock_class) { @@ -219,7 +212,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_clock_class_set_frequency(struct bt_ctf_clock_class *clock_class, uint64_t freq) { @@ -253,7 +245,6 @@ end: return ret; } -BT_HIDDEN uint64_t bt_ctf_clock_class_get_precision(struct bt_ctf_clock_class *clock_class) { uint64_t ret = -1ULL; @@ -268,7 +259,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_clock_class_set_precision(struct bt_ctf_clock_class *clock_class, uint64_t precision) { @@ -298,7 +288,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_clock_class_get_offset_s(struct bt_ctf_clock_class *clock_class, int64_t *offset_s) { @@ -318,7 +307,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_clock_class_set_offset_s(struct bt_ctf_clock_class *clock_class, int64_t offset_s) { @@ -346,7 +334,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_clock_class_get_offset_cycles(struct bt_ctf_clock_class *clock_class, int64_t *offset) { @@ -366,7 +353,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_clock_class_set_offset_cycles(struct bt_ctf_clock_class *clock_class, int64_t offset) { @@ -392,7 +378,6 @@ end: return ret; } -BT_HIDDEN bt_ctf_bool bt_ctf_clock_class_is_absolute(struct bt_ctf_clock_class *clock_class) { int ret = -1; @@ -407,7 +392,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_clock_class_set_is_absolute(struct bt_ctf_clock_class *clock_class, bt_ctf_bool is_absolute) { @@ -434,7 +418,6 @@ end: return ret; } -BT_HIDDEN const uint8_t *bt_ctf_clock_class_get_uuid( struct bt_ctf_clock_class *clock_class) { @@ -458,7 +441,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_clock_class_set_uuid(struct bt_ctf_clock_class *clock_class, const uint8_t *uuid) { @@ -489,7 +471,6 @@ end: return ret; } -BT_HIDDEN void bt_ctf_clock_class_freeze(struct bt_ctf_clock_class *clock_class) { if (!clock_class || clock_class->frozen) { @@ -521,7 +502,6 @@ void bt_ctf_clock_class_destroy(struct bt_ctf_object *obj) g_free(clock_class); } -BT_HIDDEN int bt_ctf_clock_class_compare(struct bt_ctf_clock_class *clock_class_a, struct bt_ctf_clock_class *clock_class_b) { diff --git a/src/ctf-writer/clock-class.h b/src/ctf-writer/clock-class.h index 6948ed35..adbba43a 100644 --- a/src/ctf-writer/clock-class.h +++ b/src/ctf-writer/clock-class.h @@ -35,66 +35,46 @@ struct bt_ctf_clock_class { int frozen; }; -BT_HIDDEN void bt_ctf_clock_class_freeze(struct bt_ctf_clock_class *clock_class); -BT_HIDDEN bt_ctf_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class); -BT_HIDDEN int bt_ctf_clock_class_compare(struct bt_ctf_clock_class *clock_class_a, struct bt_ctf_clock_class *clock_class_b); -BT_HIDDEN struct bt_ctf_clock_class *bt_ctf_clock_class_create(const char *name, uint64_t freq); -BT_HIDDEN const char *bt_ctf_clock_class_get_name( struct bt_ctf_clock_class *clock_class); -BT_HIDDEN int bt_ctf_clock_class_set_name(struct bt_ctf_clock_class *clock_class, const char *name); -BT_HIDDEN const char *bt_ctf_clock_class_get_description( struct bt_ctf_clock_class *clock_class); -BT_HIDDEN int bt_ctf_clock_class_set_description( struct bt_ctf_clock_class *clock_class, const char *desc); -BT_HIDDEN uint64_t bt_ctf_clock_class_get_frequency( struct bt_ctf_clock_class *clock_class); -BT_HIDDEN int bt_ctf_clock_class_set_frequency( struct bt_ctf_clock_class *clock_class, uint64_t freq); -BT_HIDDEN uint64_t bt_ctf_clock_class_get_precision( struct bt_ctf_clock_class *clock_class); -BT_HIDDEN int bt_ctf_clock_class_set_precision( struct bt_ctf_clock_class *clock_class, uint64_t precision); -BT_HIDDEN int bt_ctf_clock_class_get_offset_s( struct bt_ctf_clock_class *clock_class, int64_t *seconds); -BT_HIDDEN int bt_ctf_clock_class_set_offset_s( struct bt_ctf_clock_class *clock_class, int64_t seconds); -BT_HIDDEN int bt_ctf_clock_class_get_offset_cycles( struct bt_ctf_clock_class *clock_class, int64_t *cycles); -BT_HIDDEN int bt_ctf_clock_class_set_offset_cycles( struct bt_ctf_clock_class *clock_class, int64_t cycles); -BT_HIDDEN bt_ctf_bool bt_ctf_clock_class_is_absolute( struct bt_ctf_clock_class *clock_class); -BT_HIDDEN int bt_ctf_clock_class_set_is_absolute( struct bt_ctf_clock_class *clock_class, bt_ctf_bool is_absolute); -BT_HIDDEN const uint8_t *bt_ctf_clock_class_get_uuid( struct bt_ctf_clock_class *clock_class); -BT_HIDDEN int bt_ctf_clock_class_set_uuid(struct bt_ctf_clock_class *clock_class, const uint8_t *uuid); diff --git a/src/ctf-writer/clock.c b/src/ctf-writer/clock.c index 463fcbd0..5d721192 100644 --- a/src/ctf-writer/clock.c +++ b/src/ctf-writer/clock.c @@ -25,6 +25,7 @@ static void bt_ctf_clock_destroy(struct bt_ctf_object *obj); +BT_EXPORT struct bt_ctf_clock *bt_ctf_clock_create(const char *name) { int ret; @@ -58,18 +59,21 @@ error: return clock; } +BT_EXPORT const char *bt_ctf_clock_get_name(struct bt_ctf_clock *clock) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); return bt_ctf_clock_class_get_name(clock->clock_class); } +BT_EXPORT const char *bt_ctf_clock_get_description(struct bt_ctf_clock *clock) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); return bt_ctf_clock_class_get_description(clock->clock_class); } +BT_EXPORT int bt_ctf_clock_set_description(struct bt_ctf_clock *clock, const char *desc) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); @@ -77,12 +81,14 @@ int bt_ctf_clock_set_description(struct bt_ctf_clock *clock, const char *desc) desc); } +BT_EXPORT uint64_t bt_ctf_clock_get_frequency(struct bt_ctf_clock *clock) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); return bt_ctf_clock_class_get_frequency(clock->clock_class); } +BT_EXPORT int bt_ctf_clock_set_frequency(struct bt_ctf_clock *clock, uint64_t freq) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); @@ -90,12 +96,14 @@ int bt_ctf_clock_set_frequency(struct bt_ctf_clock *clock, uint64_t freq) freq); } +BT_EXPORT uint64_t bt_ctf_clock_get_precision(struct bt_ctf_clock *clock) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); return bt_ctf_clock_class_get_precision(clock->clock_class); } +BT_EXPORT int bt_ctf_clock_set_precision(struct bt_ctf_clock *clock, uint64_t precision) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); @@ -103,6 +111,7 @@ int bt_ctf_clock_set_precision(struct bt_ctf_clock *clock, uint64_t precision) precision); } +BT_EXPORT int bt_ctf_clock_get_offset_s(struct bt_ctf_clock *clock, int64_t *offset_s) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); @@ -110,6 +119,7 @@ int bt_ctf_clock_get_offset_s(struct bt_ctf_clock *clock, int64_t *offset_s) offset_s); } +BT_EXPORT int bt_ctf_clock_set_offset_s(struct bt_ctf_clock *clock, int64_t offset_s) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); @@ -117,6 +127,7 @@ int bt_ctf_clock_set_offset_s(struct bt_ctf_clock *clock, int64_t offset_s) offset_s); } +BT_EXPORT int bt_ctf_clock_get_offset(struct bt_ctf_clock *clock, int64_t *offset) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); @@ -124,6 +135,7 @@ int bt_ctf_clock_get_offset(struct bt_ctf_clock *clock, int64_t *offset) offset); } +BT_EXPORT int bt_ctf_clock_set_offset(struct bt_ctf_clock *clock, int64_t offset) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); @@ -131,12 +143,14 @@ int bt_ctf_clock_set_offset(struct bt_ctf_clock *clock, int64_t offset) offset); } +BT_EXPORT int bt_ctf_clock_get_is_absolute(struct bt_ctf_clock *clock) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); return bt_ctf_clock_class_is_absolute(clock->clock_class); } +BT_EXPORT int bt_ctf_clock_set_is_absolute(struct bt_ctf_clock *clock, int is_absolute) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); @@ -144,18 +158,21 @@ int bt_ctf_clock_set_is_absolute(struct bt_ctf_clock *clock, int is_absolute) is_absolute); } +BT_EXPORT const uint8_t *bt_ctf_clock_get_uuid(struct bt_ctf_clock *clock) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); return bt_ctf_clock_class_get_uuid(clock->clock_class); } +BT_EXPORT int bt_ctf_clock_set_uuid(struct bt_ctf_clock *clock, const uint8_t *uuid) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); return bt_ctf_clock_class_set_uuid(clock->clock_class, uuid); } +BT_EXPORT int bt_ctf_clock_set_time(struct bt_ctf_clock *clock, int64_t time) { int64_t value; @@ -180,7 +197,6 @@ int bt_ctf_clock_set_time(struct bt_ctf_clock *clock, int64_t time) return 0; } -BT_HIDDEN int bt_ctf_clock_get_value(struct bt_ctf_clock *clock, uint64_t *value) { BT_CTF_ASSERT_PRE_NON_NULL(clock, "CTF writer clock"); @@ -199,7 +215,6 @@ void bt_ctf_clock_destroy(struct bt_ctf_object *obj) g_free(clock); } -BT_HIDDEN void bt_ctf_clock_class_serialize(struct bt_ctf_clock_class *clock_class, struct metadata_context *context) { diff --git a/src/ctf-writer/clock.h b/src/ctf-writer/clock.h index 68e464f2..cad188e7 100644 --- a/src/ctf-writer/clock.h +++ b/src/ctf-writer/clock.h @@ -23,10 +23,8 @@ struct bt_ctf_clock { struct metadata_context; -BT_HIDDEN int bt_ctf_clock_get_value(struct bt_ctf_clock *clock, uint64_t *value); -BT_HIDDEN void bt_ctf_clock_class_serialize(struct bt_ctf_clock_class *clock_class, struct metadata_context *context); diff --git a/src/ctf-writer/event-class.c b/src/ctf-writer/event-class.c index 1f49549f..939d9fa7 100644 --- a/src/ctf-writer/event-class.c +++ b/src/ctf-writer/event-class.c @@ -36,7 +36,6 @@ #include "values.h" #include "writer.h" -BT_HIDDEN void bt_ctf_event_class_common_finalize(struct bt_ctf_object *obj) { struct bt_ctf_event_class_common *event_class; @@ -60,7 +59,6 @@ void bt_ctf_event_class_common_finalize(struct bt_ctf_object *obj) bt_ctf_object_put_ref(event_class->payload_field_type); } -BT_HIDDEN int bt_ctf_event_class_common_initialize(struct bt_ctf_event_class_common *event_class, const char *name, bt_ctf_object_release_func release_func, bt_ctf_field_type_structure_create_func ft_struct_create_func) @@ -99,7 +97,6 @@ error: return ret; } -BT_HIDDEN void bt_ctf_event_class_common_freeze(struct bt_ctf_event_class_common *event_class) { BT_ASSERT_DBG(event_class); @@ -118,7 +115,6 @@ void bt_ctf_event_class_common_freeze(struct bt_ctf_event_class_common *event_cl bt_ctf_field_type_common_freeze(event_class->payload_field_type); } -BT_HIDDEN int bt_ctf_event_class_common_validate_single_clock_class( struct bt_ctf_event_class_common *event_class, struct bt_ctf_clock_class **expected_clock_class) @@ -174,6 +170,7 @@ void bt_ctf_event_class_destroy(struct bt_ctf_object *obj) g_free(obj); } +BT_EXPORT struct bt_ctf_event_class *bt_ctf_event_class_create(const char *name) { struct bt_ctf_event_class *ctf_event_class = NULL; @@ -209,28 +206,33 @@ end: return ctf_event_class; } +BT_EXPORT const char *bt_ctf_event_class_get_name(struct bt_ctf_event_class *event_class) { return bt_ctf_event_class_common_get_name(BT_CTF_TO_COMMON(event_class)); } +BT_EXPORT int64_t bt_ctf_event_class_get_id(struct bt_ctf_event_class *event_class) { return bt_ctf_event_class_common_get_id(BT_CTF_TO_COMMON(event_class)); } +BT_EXPORT int bt_ctf_event_class_set_id(struct bt_ctf_event_class *event_class, uint64_t id) { return bt_ctf_event_class_common_set_id(BT_CTF_TO_COMMON(event_class), id); } +BT_EXPORT enum bt_ctf_event_class_log_level bt_ctf_event_class_get_log_level( struct bt_ctf_event_class *event_class) { return bt_ctf_event_class_common_get_log_level(BT_CTF_TO_COMMON(event_class)); } +BT_EXPORT int bt_ctf_event_class_set_log_level(struct bt_ctf_event_class *event_class, enum bt_ctf_event_class_log_level log_level) { @@ -238,12 +240,14 @@ int bt_ctf_event_class_set_log_level(struct bt_ctf_event_class *event_class, log_level); } +BT_EXPORT const char *bt_ctf_event_class_get_emf_uri( struct bt_ctf_event_class *event_class) { return bt_ctf_event_class_common_get_emf_uri(BT_CTF_TO_COMMON(event_class)); } +BT_EXPORT int bt_ctf_event_class_set_emf_uri(struct bt_ctf_event_class *event_class, const char *emf_uri) { @@ -251,6 +255,7 @@ int bt_ctf_event_class_set_emf_uri(struct bt_ctf_event_class *event_class, emf_uri); } +BT_EXPORT struct bt_ctf_stream_class *bt_ctf_event_class_get_stream_class( struct bt_ctf_event_class *event_class) { @@ -259,6 +264,7 @@ struct bt_ctf_stream_class *bt_ctf_event_class_get_stream_class( BT_CTF_TO_COMMON(event_class))); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_event_class_get_payload_field_type( struct bt_ctf_event_class *event_class) { @@ -266,6 +272,7 @@ struct bt_ctf_field_type *bt_ctf_event_class_get_payload_field_type( BT_CTF_TO_COMMON(event_class))); } +BT_EXPORT int bt_ctf_event_class_set_payload_field_type( struct bt_ctf_event_class *event_class, struct bt_ctf_field_type *field_type) @@ -274,6 +281,7 @@ int bt_ctf_event_class_set_payload_field_type( BT_CTF_TO_COMMON(event_class), (void *) field_type); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_event_class_get_context_field_type( struct bt_ctf_event_class *event_class) { @@ -281,6 +289,7 @@ struct bt_ctf_field_type *bt_ctf_event_class_get_context_field_type( BT_CTF_TO_COMMON(event_class))); } +BT_EXPORT int bt_ctf_event_class_set_context_field_type( struct bt_ctf_event_class *event_class, struct bt_ctf_field_type *field_type) @@ -289,6 +298,7 @@ int bt_ctf_event_class_set_context_field_type( BT_CTF_TO_COMMON(event_class), (void *) field_type); } +BT_EXPORT int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class, struct bt_ctf_field_type *type, const char *name) @@ -346,6 +356,7 @@ end: return ret; } +BT_EXPORT int64_t bt_ctf_event_class_get_payload_type_field_count( struct bt_ctf_event_class *event_class) { @@ -375,6 +386,7 @@ end: return ret; } +BT_EXPORT int bt_ctf_event_class_get_payload_type_field_by_index( struct bt_ctf_event_class *event_class, const char **field_name, struct bt_ctf_field_type **field_type, @@ -408,6 +420,7 @@ end: return ret; } +BT_EXPORT struct bt_ctf_field_type * bt_ctf_event_class_get_payload_type_field_type_by_name( struct bt_ctf_event_class *event_class, const char *name) @@ -451,7 +464,6 @@ end: return field_type; } -BT_HIDDEN int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class, struct metadata_context *context) { @@ -529,6 +541,7 @@ end: return ret; } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_event_class_get_field_by_name( struct bt_ctf_event_class *event_class, const char *name) { diff --git a/src/ctf-writer/event-class.h b/src/ctf-writer/event-class.h index cc2ec9ee..429888a7 100644 --- a/src/ctf-writer/event-class.h +++ b/src/ctf-writer/event-class.h @@ -41,10 +41,8 @@ struct bt_ctf_event_class_common { GString *emf_uri; }; -BT_HIDDEN void bt_ctf_event_class_common_freeze(struct bt_ctf_event_class_common *event_class); -BT_HIDDEN void bt_ctf_event_class_common_set_native_byte_order( struct bt_ctf_event_class_common *event_class, int byte_order); @@ -59,15 +57,12 @@ struct bt_ctf_stream_class_common *bt_ctf_event_class_common_borrow_stream_class typedef struct bt_ctf_field_type_common * (*bt_ctf_field_type_structure_create_func)(void); -BT_HIDDEN int bt_ctf_event_class_common_initialize(struct bt_ctf_event_class_common *event_class, const char *name, bt_ctf_object_release_func release_func, bt_ctf_field_type_structure_create_func ft_struct_create_func); -BT_HIDDEN void bt_ctf_event_class_common_finalize(struct bt_ctf_object *obj); -BT_HIDDEN int bt_ctf_event_class_common_validate_single_clock_class( struct bt_ctf_event_class_common *event_class, struct bt_ctf_clock_class **expected_clock_class); diff --git a/src/ctf-writer/event.c b/src/ctf-writer/event.c index 0cd79c58..a1486aba 100644 --- a/src/ctf-writer/event.c +++ b/src/ctf-writer/event.c @@ -198,7 +198,6 @@ end: return ret; } -BT_HIDDEN int _bt_ctf_event_common_validate(struct bt_ctf_event_common *event) { int ret = 0; @@ -257,7 +256,6 @@ end: return ret; } -BT_HIDDEN void _bt_ctf_event_common_set_is_frozen(struct bt_ctf_event_common *event, bool is_frozen) { @@ -294,7 +292,6 @@ void _bt_ctf_event_common_set_is_frozen(struct bt_ctf_event_common *event, event->frozen = is_frozen; } -BT_HIDDEN int bt_ctf_event_common_initialize(struct bt_ctf_event_common *event, struct bt_ctf_event_class_common *event_class, struct bt_ctf_clock_class *init_expected_clock_class, @@ -579,6 +576,7 @@ void bt_ctf_event_destroy(struct bt_ctf_object *obj) g_free(obj); } +BT_EXPORT struct bt_ctf_event *bt_ctf_event_create(struct bt_ctf_event_class *event_class) { int ret; @@ -625,6 +623,7 @@ end: return event; } +BT_EXPORT struct bt_ctf_event_class *bt_ctf_event_get_class(struct bt_ctf_event *event) { BT_CTF_ASSERT_PRE_NON_NULL(event, "Event"); @@ -639,12 +638,14 @@ struct bt_ctf_stream *bt_ctf_event_borrow_stream(struct bt_ctf_event *event) bt_ctf_object_borrow_parent(&BT_CTF_TO_COMMON(event)->base); } +BT_EXPORT struct bt_ctf_stream *bt_ctf_event_get_stream(struct bt_ctf_event *event) { BT_CTF_ASSERT_PRE_NON_NULL(event, "Event"); return bt_ctf_object_get_ref(bt_ctf_event_borrow_stream(event)); } +BT_EXPORT int bt_ctf_event_set_payload(struct bt_ctf_event *event, const char *name, struct bt_ctf_field *field) { @@ -655,6 +656,7 @@ int bt_ctf_event_set_payload(struct bt_ctf_event *event, const char *name, (void *) event->common.payload_field, name, field); } +BT_EXPORT struct bt_ctf_field *bt_ctf_event_get_payload(struct bt_ctf_event *event, const char *name) { @@ -673,22 +675,26 @@ struct bt_ctf_field *bt_ctf_event_get_payload(struct bt_ctf_event *event, return field; } +BT_EXPORT struct bt_ctf_field *bt_ctf_event_get_payload_field( struct bt_ctf_event *event) { return bt_ctf_object_get_ref(bt_ctf_event_common_borrow_payload(BT_CTF_TO_COMMON(event))); } +BT_EXPORT struct bt_ctf_field *bt_ctf_event_get_header(struct bt_ctf_event *event) { return bt_ctf_object_get_ref(bt_ctf_event_common_borrow_header(BT_CTF_TO_COMMON(event))); } +BT_EXPORT struct bt_ctf_field *bt_ctf_event_get_context(struct bt_ctf_event *event) { return bt_ctf_object_get_ref(bt_ctf_event_common_borrow_context(BT_CTF_TO_COMMON(event))); } +BT_EXPORT struct bt_ctf_field *bt_ctf_event_get_stream_event_context( struct bt_ctf_event *event) { @@ -696,7 +702,6 @@ struct bt_ctf_field *bt_ctf_event_get_stream_event_context( BT_CTF_TO_COMMON(event))); } -BT_HIDDEN int bt_ctf_event_serialize(struct bt_ctf_event *event, struct bt_ctfser *ctfser, enum bt_ctf_byte_order native_byte_order) @@ -742,6 +747,7 @@ end: return ret; } +BT_EXPORT int bt_ctf_event_set_header(struct bt_ctf_event *event, struct bt_ctf_field *header) { @@ -814,6 +820,7 @@ int bt_ctf_event_common_set_payload(struct bt_ctf_event *event, return 0; } +BT_EXPORT int bt_ctf_event_set_context(struct bt_ctf_event *event, struct bt_ctf_field *context) { @@ -847,6 +854,7 @@ int bt_ctf_event_set_context(struct bt_ctf_event *event, return 0; } +BT_EXPORT int bt_ctf_event_set_stream_event_context(struct bt_ctf_event *event, struct bt_ctf_field *stream_event_context) { diff --git a/src/ctf-writer/event.h b/src/ctf-writer/event.h index dc1187cd..52e4c520 100644 --- a/src/ctf-writer/event.h +++ b/src/ctf-writer/event.h @@ -44,10 +44,8 @@ struct bt_ctf_event_common { int frozen; }; -BT_HIDDEN int _bt_ctf_event_common_validate(struct bt_ctf_event_common *event); -BT_HIDDEN void _bt_ctf_event_common_set_is_frozen(struct bt_ctf_event_common *event, bool is_frozen); @@ -75,7 +73,6 @@ typedef void (*release_field_func_type)(void *); typedef void *(*create_header_field_func_type)(void *, void *); typedef void (*release_header_field_func_type)(void *, void *); -BT_HIDDEN int bt_ctf_event_common_initialize(struct bt_ctf_event_common *event, struct bt_ctf_event_class_common *event_class, struct bt_ctf_clock_class *init_expected_clock_class, @@ -90,7 +87,6 @@ int bt_ctf_event_common_initialize(struct bt_ctf_event_common *event, create_header_field_func_type create_header_field_func, release_header_field_func_type release_header_field_func); -BT_HIDDEN int bt_ctf_event_common_set_payload(struct bt_ctf_event *event, struct bt_ctf_field *payload); @@ -238,11 +234,9 @@ struct bt_ctf_event_class { struct bt_ctf_event_class_common common; }; -BT_HIDDEN int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class, struct metadata_context *context); -BT_HIDDEN int bt_ctf_event_serialize(struct bt_ctf_event *event, struct bt_ctfser *pos, enum bt_ctf_byte_order native_byte_order); diff --git a/src/ctf-writer/field-path.c b/src/ctf-writer/field-path.c index 6372959a..2d71d79f 100644 --- a/src/ctf-writer/field-path.c +++ b/src/ctf-writer/field-path.c @@ -39,7 +39,6 @@ void field_path_destroy(struct bt_ctf_object *obj) g_free(field_path); } -BT_HIDDEN struct bt_ctf_field_path *bt_ctf_field_path_create(void) { struct bt_ctf_field_path *field_path = NULL; @@ -68,7 +67,6 @@ error: return NULL; } -BT_HIDDEN void bt_ctf_field_path_clear(struct bt_ctf_field_path *field_path) { if (field_path->indexes->len > 0) { @@ -77,7 +75,6 @@ void bt_ctf_field_path_clear(struct bt_ctf_field_path *field_path) } } -BT_HIDDEN struct bt_ctf_field_path *bt_ctf_field_path_copy( struct bt_ctf_field_path *path) { diff --git a/src/ctf-writer/field-path.h b/src/ctf-writer/field-path.h index a346dc2b..c823f009 100644 --- a/src/ctf-writer/field-path.h +++ b/src/ctf-writer/field-path.h @@ -31,23 +31,20 @@ struct bt_ctf_field_path { GArray *indexes; }; -BT_HIDDEN struct bt_ctf_field_path *bt_ctf_field_path_create(void); -BT_HIDDEN void bt_ctf_field_path_clear(struct bt_ctf_field_path *field_path); -BT_HIDDEN struct bt_ctf_field_path *bt_ctf_field_path_copy( struct bt_ctf_field_path *path); -BT_HIDDEN enum bt_ctf_scope bt_ctf_field_path_get_root_scope( +enum bt_ctf_scope bt_ctf_field_path_get_root_scope( const struct bt_ctf_field_path *field_path); -BT_HIDDEN int64_t bt_ctf_field_path_get_index_count( +int64_t bt_ctf_field_path_get_index_count( const struct bt_ctf_field_path *field_path); -BT_HIDDEN int bt_ctf_field_path_get_index( +int bt_ctf_field_path_get_index( const struct bt_ctf_field_path *field_path, uint64_t index); #endif /* BABELTRACE_CTF_WRITER_FIELD_PATH_INTERNAL */ diff --git a/src/ctf-writer/field-types.c b/src/ctf-writer/field-types.c index b97a0ab7..50f943c3 100644 --- a/src/ctf-writer/field-types.c +++ b/src/ctf-writer/field-types.c @@ -36,7 +36,6 @@ void destroy_enumeration_mapping(struct bt_ctf_enumeration_mapping *mapping) g_free(mapping); } -BT_HIDDEN void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common *ft, bool init_bo, bt_ctf_object_release_func release_func, struct bt_ctf_field_type_common_methods *methods) @@ -60,7 +59,6 @@ void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common *ft, ft->alignment = 1; } -BT_HIDDEN void bt_ctf_field_type_common_integer_initialize( struct bt_ctf_field_type_common *ft, unsigned int size, bt_ctf_object_release_func release_func, @@ -80,7 +78,6 @@ void bt_ctf_field_type_common_integer_initialize( ft, size); } -BT_HIDDEN void bt_ctf_field_type_common_floating_point_initialize( struct bt_ctf_field_type_common *ft, bt_ctf_object_release_func release_func, @@ -98,7 +95,6 @@ void bt_ctf_field_type_common_floating_point_initialize( flt_ft->mant_dig); } -BT_HIDDEN void bt_ctf_field_type_common_enumeration_initialize( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *container_ft, @@ -120,7 +116,6 @@ void bt_ctf_field_type_common_enumeration_initialize( bt_ctf_field_type_common_integer_get_size(container_ft)); } -BT_HIDDEN void bt_ctf_field_type_common_string_initialize( struct bt_ctf_field_type_common *ft, bt_ctf_object_release_func release_func, @@ -136,7 +131,6 @@ void bt_ctf_field_type_common_string_initialize( BT_LOGD("Initialized common string field type object: addr=%p", ft); } -BT_HIDDEN void bt_ctf_field_type_common_structure_initialize( struct bt_ctf_field_type_common *ft, bt_ctf_object_release_func release_func, @@ -153,7 +147,6 @@ void bt_ctf_field_type_common_structure_initialize( BT_LOGD("Initialized common structure field type object: addr=%p", ft); } -BT_HIDDEN void bt_ctf_field_type_common_array_initialize( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *element_ft, @@ -173,7 +166,6 @@ void bt_ctf_field_type_common_array_initialize( "element-ft-addr=%p, length=%u", ft, element_ft, length); } -BT_HIDDEN void bt_ctf_field_type_common_sequence_initialize( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *element_ft, @@ -197,7 +189,6 @@ void bt_ctf_field_type_common_sequence_initialize( ft, element_ft, length_field_name); } -BT_HIDDEN void bt_ctf_field_type_common_variant_initialize( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *tag_ft, @@ -229,7 +220,6 @@ void bt_ctf_field_type_common_variant_initialize( ft, tag_ft, tag_name); } -BT_HIDDEN void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object *obj) { struct bt_ctf_field_type_common_integer *ft = (void *) obj; @@ -244,7 +234,6 @@ void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object *obj) g_free(ft); } -BT_HIDDEN void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object *obj) { struct bt_ctf_field_type_common_floating_point *ft = (void *) obj; @@ -257,7 +246,6 @@ void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object *obj) g_free(ft); } -BT_HIDDEN void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object *obj) { struct bt_ctf_field_type_common_enumeration *ft = (void *) obj; @@ -273,7 +261,6 @@ void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object g_free(ft); } -BT_HIDDEN void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object *obj) { struct bt_ctf_field_type_common_string *ft = (void *) obj; @@ -301,7 +288,6 @@ void bt_ctf_field_type_common_structure_field_finalize( bt_ctf_object_put_ref(field->type); } -BT_HIDDEN void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object *obj) { struct bt_ctf_field_type_common_structure *ft = (void *) obj; @@ -330,7 +316,6 @@ void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object * g_free(ft); } -BT_HIDDEN void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object *obj) { struct bt_ctf_field_type_common_array *ft = (void *) obj; @@ -345,7 +330,6 @@ void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object *obj) g_free(ft); } -BT_HIDDEN void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object *obj) { struct bt_ctf_field_type_common_sequence *ft = (void *) obj; @@ -382,7 +366,6 @@ void bt_ctf_field_type_common_variant_choice_finalize( } } -BT_HIDDEN void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object *obj) { struct bt_ctf_field_type_common_variant *ft = (void *) obj; @@ -565,7 +548,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common *ft) { int ret = 0; @@ -625,7 +607,6 @@ end: return iter; } -BT_HIDDEN struct bt_ctf_field_type_enumeration_mapping_iterator * bt_ctf_field_type_common_enumeration_find_mappings_by_name( struct bt_ctf_field_type_common *ft, const char *name) @@ -676,7 +657,6 @@ end: return mapping; } -BT_HIDDEN int bt_ctf_field_type_enumeration_mapping_iterator_next( struct bt_ctf_field_type_enumeration_mapping_iterator *iter) { @@ -732,7 +712,6 @@ end: return ret; } -BT_HIDDEN struct bt_ctf_field_type_enumeration_mapping_iterator * bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value( struct bt_ctf_field_type_common *ft, int64_t value) @@ -763,7 +742,6 @@ error: return NULL; } -BT_HIDDEN struct bt_ctf_field_type_enumeration_mapping_iterator * bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value( struct bt_ctf_field_type_common *ft, uint64_t value) @@ -794,7 +772,6 @@ error: return NULL; } -BT_HIDDEN int bt_ctf_field_type_enumeration_mapping_iterator_signed_get( struct bt_ctf_field_type_enumeration_mapping_iterator *iter, const char **mapping_name, int64_t *range_begin, @@ -809,7 +786,6 @@ int bt_ctf_field_type_enumeration_mapping_iterator_signed_get( mapping_name, range_begin, range_end); } -BT_HIDDEN int bt_ctf_field_type_enumeration_mapping_iterator_unsigned_get( struct bt_ctf_field_type_enumeration_mapping_iterator *iter, const char **mapping_name, uint64_t *range_begin, @@ -877,7 +853,6 @@ end: } } -BT_HIDDEN int bt_ctf_field_type_common_enumeration_validate_recursive( struct bt_ctf_field_type_common *ft) { @@ -905,7 +880,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_sequence_validate_recursive( struct bt_ctf_field_type_common *ft) { @@ -931,7 +905,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_array_validate_recursive( struct bt_ctf_field_type_common *ft) { @@ -948,7 +921,6 @@ int bt_ctf_field_type_common_array_validate_recursive( return ret; } -BT_HIDDEN int bt_ctf_field_type_common_structure_validate_recursive( struct bt_ctf_field_type_common *ft) { @@ -992,7 +964,6 @@ bt_ctf_bool bt_ctf_field_type_common_enumeration_has_overlapping_ranges( return enum_ft->has_overlapping_ranges; } -BT_HIDDEN int bt_ctf_field_type_common_variant_validate_recursive( struct bt_ctf_field_type_common *ft) { @@ -1078,7 +1049,6 @@ end: * of the given field type and the properties of its children if * applicable. */ -BT_HIDDEN int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common *ft) { int ret = 0; @@ -1104,7 +1074,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *ft) { struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft); @@ -1115,7 +1084,6 @@ int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *f return (int) int_ft->size; } -BT_HIDDEN bt_ctf_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft) { struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft); @@ -1126,7 +1094,6 @@ bt_ctf_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_ return int_ft->is_signed; } -BT_HIDDEN int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common *ft, bt_ctf_bool is_signed) { @@ -1162,7 +1129,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common *ft, unsigned int size) { @@ -1205,7 +1171,6 @@ end: return ret; } -BT_HIDDEN enum bt_ctf_integer_base bt_ctf_field_type_common_integer_get_base( struct bt_ctf_field_type_common *ft) { @@ -1217,7 +1182,6 @@ enum bt_ctf_integer_base bt_ctf_field_type_common_integer_get_base( return int_ft->base; } -BT_HIDDEN int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common *ft, enum bt_ctf_integer_base base) { @@ -1268,7 +1232,6 @@ end: return ret; } -BT_HIDDEN enum bt_ctf_string_encoding bt_ctf_field_type_common_integer_get_encoding( struct bt_ctf_field_type_common *ft) { @@ -1280,7 +1243,6 @@ enum bt_ctf_string_encoding bt_ctf_field_type_common_integer_get_encoding( return int_ft->encoding; } -BT_HIDDEN int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common *ft, enum bt_ctf_string_encoding encoding) { @@ -1325,7 +1287,6 @@ end: return ret; } -BT_HIDDEN struct bt_ctf_clock_class *bt_ctf_field_type_common_integer_borrow_mapped_clock_class( struct bt_ctf_field_type_common *ft) { @@ -1337,7 +1298,6 @@ struct bt_ctf_clock_class *bt_ctf_field_type_common_integer_borrow_mapped_clock_ return int_ft->mapped_clock_class; } -BT_HIDDEN int bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen( struct bt_ctf_field_type_common *ft, struct bt_ctf_clock_class *clock_class) @@ -1377,7 +1337,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_integer_set_mapped_clock_class( struct bt_ctf_field_type_common *ft, struct bt_ctf_clock_class *clock_class) @@ -1404,7 +1363,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index( struct bt_ctf_field_type_common *ft, uint64_t index, const char **mapping_name, int64_t *range_begin, @@ -1441,7 +1399,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index( struct bt_ctf_field_type_common *ft, uint64_t index, const char **mapping_name, uint64_t *range_begin, @@ -1477,7 +1434,6 @@ end: return ret; } -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_enumeration_borrow_container_field_type( struct bt_ctf_field_type_common *ft) @@ -1489,7 +1445,6 @@ bt_ctf_field_type_common_enumeration_borrow_container_field_type( return BT_CTF_TO_COMMON(enum_ft->container_ft); } -BT_HIDDEN int bt_ctf_field_type_common_enumeration_signed_add_mapping( struct bt_ctf_field_type_common *ft, const char *string, int64_t range_start, int64_t range_end) @@ -1579,7 +1534,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_enumeration_unsigned_add_mapping( struct bt_ctf_field_type_common *ft, const char *string, uint64_t range_start, uint64_t range_end) @@ -1669,7 +1623,6 @@ end: return ret; } -BT_HIDDEN int64_t bt_ctf_field_type_common_enumeration_get_mapping_count( struct bt_ctf_field_type_common *ft) { @@ -1680,7 +1633,6 @@ int64_t bt_ctf_field_type_common_enumeration_get_mapping_count( return (int64_t) enum_ft->entries->len; } -BT_HIDDEN int bt_ctf_field_type_common_floating_point_get_exponent_digits( struct bt_ctf_field_type_common *ft) { @@ -1692,7 +1644,6 @@ int bt_ctf_field_type_common_floating_point_get_exponent_digits( return (int) flt_ft->exp_dig; } -BT_HIDDEN int bt_ctf_field_type_common_floating_point_set_exponent_digits( struct bt_ctf_field_type_common *ft, unsigned int exponent_digits) @@ -1739,7 +1690,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_floating_point_get_mantissa_digits( struct bt_ctf_field_type_common *ft) { @@ -1751,7 +1701,6 @@ int bt_ctf_field_type_common_floating_point_get_mantissa_digits( return (int) flt_ft->mant_dig; } -BT_HIDDEN int bt_ctf_field_type_common_floating_point_set_mantissa_digits( struct bt_ctf_field_type_common *ft, unsigned int mantissa_digits) { @@ -1796,7 +1745,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_structure_replace_field( struct bt_ctf_field_type_common *ft, const char *field_name, @@ -1826,7 +1774,6 @@ int bt_ctf_field_type_common_structure_replace_field( return ret; } -BT_HIDDEN int bt_ctf_field_type_common_structure_add_field(struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *field_type, const char *field_name) @@ -1890,7 +1837,6 @@ end: return ret; } -BT_HIDDEN int64_t bt_ctf_field_type_common_structure_get_field_count( struct bt_ctf_field_type_common *ft) { @@ -1902,7 +1848,6 @@ int64_t bt_ctf_field_type_common_structure_get_field_count( return (int64_t) struct_ft->fields->len; } -BT_HIDDEN int bt_ctf_field_type_common_structure_borrow_field_by_index( struct bt_ctf_field_type_common *ft, const char **field_name, @@ -1932,7 +1877,6 @@ int bt_ctf_field_type_common_structure_borrow_field_by_index( return 0; } -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_structure_borrow_field_type_by_name( struct bt_ctf_field_type_common *ft, const char *name) @@ -1970,7 +1914,6 @@ end: return field_type; } -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_variant_borrow_tag_field_type( struct bt_ctf_field_type_common *ft) @@ -1994,7 +1937,6 @@ end: return tag_ft; } -BT_HIDDEN const char *bt_ctf_field_type_common_variant_get_tag_name( struct bt_ctf_field_type_common *ft) { @@ -2017,7 +1959,6 @@ end: return tag_name; } -BT_HIDDEN int bt_ctf_field_type_common_variant_set_tag_name( struct bt_ctf_field_type_common *ft, const char *name) { @@ -2060,7 +2001,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_variant_add_field(struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *field_type, const char *field_name) @@ -2148,7 +2088,6 @@ end: return ret; } -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_variant_borrow_field_type_by_name( struct bt_ctf_field_type_common *ft, @@ -2187,7 +2126,6 @@ end: return field_type; } -BT_HIDDEN int64_t bt_ctf_field_type_common_variant_get_field_count( struct bt_ctf_field_type_common *ft) { @@ -2199,7 +2137,6 @@ int64_t bt_ctf_field_type_common_variant_get_field_count( return (int64_t) var_ft->choices->len; } -BT_HIDDEN int bt_ctf_field_type_common_variant_borrow_field_by_index( struct bt_ctf_field_type_common *ft, const char **field_name, @@ -2229,7 +2166,6 @@ int bt_ctf_field_type_common_variant_borrow_field_by_index( return 0; } -BT_HIDDEN int64_t bt_ctf_field_type_common_variant_find_choice_index( struct bt_ctf_field_type_common *ft, uint64_t uval, bool is_signed) @@ -2286,7 +2222,6 @@ end: return ret; } -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_array_borrow_element_field_type( struct bt_ctf_field_type_common *ft) @@ -2300,7 +2235,6 @@ bt_ctf_field_type_common_array_borrow_element_field_type( return array_ft->element_ft; } -BT_HIDDEN int bt_ctf_field_type_common_array_set_element_field_type( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *element_ft) @@ -2340,7 +2274,6 @@ end: return ret; } -BT_HIDDEN int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common *ft) { struct bt_ctf_field_type_common_array *array_ft = BT_CTF_FROM_COMMON(ft); @@ -2351,7 +2284,6 @@ int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_commo return (int64_t) array_ft->length; } -BT_HIDDEN struct bt_ctf_field_type_common *bt_ctf_field_type_common_sequence_borrow_element_field_type( struct bt_ctf_field_type_common *ft) { @@ -2363,7 +2295,6 @@ struct bt_ctf_field_type_common *bt_ctf_field_type_common_sequence_borrow_elemen return seq_ft->element_ft; } -BT_HIDDEN int bt_ctf_field_type_common_sequence_set_element_field_type( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *element_ft) @@ -2404,7 +2335,6 @@ end: return ret; } -BT_HIDDEN const char *bt_ctf_field_type_common_sequence_get_length_field_name( struct bt_ctf_field_type_common *ft) { @@ -2417,7 +2347,6 @@ const char *bt_ctf_field_type_common_sequence_get_length_field_name( seq_ft->length_field_name->str : NULL; } -BT_HIDDEN enum bt_ctf_string_encoding bt_ctf_field_type_common_string_get_encoding( struct bt_ctf_field_type_common *ft) { @@ -2429,7 +2358,6 @@ enum bt_ctf_string_encoding bt_ctf_field_type_common_string_get_encoding( return string_ft->encoding; } -BT_HIDDEN int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common *ft, enum bt_ctf_string_encoding encoding) { @@ -2466,7 +2394,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common *ft) { int ret; @@ -2547,7 +2474,6 @@ int is_power_of_two(unsigned int value) return ((value & (value - 1)) == 0) && value > 0; } -BT_HIDDEN int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common *ft, unsigned int alignment) { @@ -2610,7 +2536,6 @@ end: return ret; } -BT_HIDDEN enum bt_ctf_byte_order bt_ctf_field_type_common_get_byte_order( struct bt_ctf_field_type_common *ft) { @@ -2659,7 +2584,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order) { @@ -2700,7 +2624,6 @@ end: return ret; } -BT_HIDDEN enum bt_ctf_field_type_id bt_ctf_field_type_common_get_type_id( struct bt_ctf_field_type_common *ft) { @@ -2708,7 +2631,6 @@ enum bt_ctf_field_type_id bt_ctf_field_type_common_get_type_id( return ft->id; } -BT_HIDDEN void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common *ft) { if (!ft || ft->frozen) { @@ -2719,7 +2641,6 @@ void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common *ft) ft->methods->freeze(ft); } -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_variant_borrow_field_type_signed( struct bt_ctf_field_type_common_variant *var_ft, @@ -2756,7 +2677,6 @@ end: return field_type; } -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_variant_borrow_field_type_unsigned( struct bt_ctf_field_type_common_variant *var_ft, @@ -2793,7 +2713,6 @@ end: return field_type; } -BT_HIDDEN struct bt_ctf_field_type_common *bt_ctf_field_type_common_copy( struct bt_ctf_field_type_common *ft) { @@ -2813,7 +2732,6 @@ end: return ft_copy; } -BT_HIDDEN int bt_ctf_field_type_common_structure_get_field_name_index( struct bt_ctf_field_type_common *ft, const char *name) { @@ -2852,7 +2770,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_variant_get_field_name_index( struct bt_ctf_field_type_common *ft, const char *name) { @@ -2890,7 +2807,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_sequence_set_length_field_path( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_path *path) { @@ -2920,7 +2836,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_variant_set_tag_field_path( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_path *path) @@ -2951,7 +2866,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_variant_set_tag_field_type( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *tag_ft) @@ -2988,13 +2902,11 @@ end: return ret; } -BT_HIDDEN void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common *ft) { ft->frozen = 1; } -BT_HIDDEN void bt_ctf_field_type_common_enumeration_freeze_recursive( struct bt_ctf_field_type_common *ft) { @@ -3008,7 +2920,6 @@ void bt_ctf_field_type_common_enumeration_freeze_recursive( bt_ctf_field_type_common_freeze(BT_CTF_TO_COMMON(enum_ft->container_ft)); } -BT_HIDDEN void bt_ctf_field_type_common_structure_freeze_recursive( struct bt_ctf_field_type_common *ft) { @@ -3031,7 +2942,6 @@ void bt_ctf_field_type_common_structure_freeze_recursive( } } -BT_HIDDEN int bt_ctf_field_type_common_variant_update_choices(struct bt_ctf_field_type_common *ft) { struct bt_ctf_field_type_common_variant *var_ft = BT_CTF_FROM_COMMON(ft); @@ -3088,7 +2998,6 @@ end: return ret; } -BT_HIDDEN void bt_ctf_field_type_common_variant_freeze_recursive( struct bt_ctf_field_type_common *ft) { @@ -3109,7 +3018,6 @@ void bt_ctf_field_type_common_variant_freeze_recursive( } } -BT_HIDDEN void bt_ctf_field_type_common_array_freeze_recursive( struct bt_ctf_field_type_common *ft) { @@ -3124,7 +3032,6 @@ void bt_ctf_field_type_common_array_freeze_recursive( bt_ctf_field_type_common_freeze(array_ft->element_ft); } -BT_HIDDEN void bt_ctf_field_type_common_sequence_freeze_recursive( struct bt_ctf_field_type_common *ft) { @@ -3139,7 +3046,6 @@ void bt_ctf_field_type_common_sequence_freeze_recursive( bt_ctf_field_type_common_freeze(seq_ft->element_ft); } -BT_HIDDEN void bt_ctf_field_type_common_integer_set_byte_order( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order) { @@ -3148,7 +3054,6 @@ void bt_ctf_field_type_common_integer_set_byte_order( int_ft->user_byte_order = byte_order; } -BT_HIDDEN void bt_ctf_field_type_common_enumeration_set_byte_order_recursive( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order) { @@ -3158,7 +3063,6 @@ void bt_ctf_field_type_common_enumeration_set_byte_order_recursive( byte_order); } -BT_HIDDEN void bt_ctf_field_type_common_floating_point_set_byte_order( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order) { @@ -3167,7 +3071,6 @@ void bt_ctf_field_type_common_floating_point_set_byte_order( flt_ft->user_byte_order = byte_order; } -BT_HIDDEN void bt_ctf_field_type_common_structure_set_byte_order_recursive( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order) @@ -3185,7 +3088,6 @@ void bt_ctf_field_type_common_structure_set_byte_order_recursive( } } -BT_HIDDEN void bt_ctf_field_type_common_variant_set_byte_order_recursive( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order) @@ -3203,7 +3105,6 @@ void bt_ctf_field_type_common_variant_set_byte_order_recursive( } } -BT_HIDDEN void bt_ctf_field_type_common_array_set_byte_order_recursive( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order) @@ -3213,7 +3114,6 @@ void bt_ctf_field_type_common_array_set_byte_order_recursive( bt_ctf_field_type_common_set_byte_order(array_ft->element_ft, byte_order); } -BT_HIDDEN void bt_ctf_field_type_common_sequence_set_byte_order_recursive( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order) @@ -3224,7 +3124,6 @@ void bt_ctf_field_type_common_sequence_set_byte_order_recursive( } -BT_HIDDEN int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b) { @@ -3305,7 +3204,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_floating_point_compare( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b) @@ -3392,7 +3290,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_enumeration_compare_recursive( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b) @@ -3446,7 +3343,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_string_compare(struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b) { @@ -3500,7 +3396,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_structure_compare_recursive( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b) @@ -3554,7 +3449,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_variant_compare_recursive( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b) @@ -3616,7 +3510,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_array_compare_recursive( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b) @@ -3646,7 +3539,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_sequence_compare_recursive( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b) @@ -3679,7 +3571,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b) { @@ -3734,7 +3625,6 @@ end: return ret; } -BT_HIDDEN int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common *ft) { int64_t field_count = -1; @@ -3763,7 +3653,6 @@ int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common return field_count; } -BT_HIDDEN struct bt_ctf_field_type_common *bt_ctf_field_type_common_borrow_field_at_index( struct bt_ctf_field_type_common *ft, int index) { @@ -3806,7 +3695,6 @@ end: return field_type; } -BT_HIDDEN int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common *ft, const char *name) { @@ -3828,7 +3716,6 @@ int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common *ft return field_index; } -BT_HIDDEN struct bt_ctf_field_path *bt_ctf_field_type_common_variant_borrow_tag_field_path( struct bt_ctf_field_type_common *ft) { @@ -3840,7 +3727,6 @@ struct bt_ctf_field_path *bt_ctf_field_type_common_variant_borrow_tag_field_path return var_ft->tag_field_path; } -BT_HIDDEN struct bt_ctf_field_path *bt_ctf_field_type_common_sequence_borrow_length_field_path( struct bt_ctf_field_type_common *ft) { @@ -3852,7 +3738,6 @@ struct bt_ctf_field_path *bt_ctf_field_type_common_sequence_borrow_length_field_ return seq_ft->length_field_path; } -BT_HIDDEN int bt_ctf_field_type_common_validate_single_clock_class( struct bt_ctf_field_type_common *ft, struct bt_ctf_clock_class **expected_clock_class) @@ -4098,7 +3983,6 @@ static struct bt_ctf_field_type_common_methods bt_ctf_field_type_variant_methods typedef int (*bt_ctf_field_type_serialize_func)(struct bt_ctf_field_type_common *, struct metadata_context *); -BT_HIDDEN int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type *type, struct metadata_context *context) { @@ -4541,6 +4425,7 @@ int bt_ctf_field_type_string_serialize(struct bt_ctf_field_type_common *type, return 0; } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_integer_create(unsigned int size) { struct bt_ctf_field_type_common_integer *integer = NULL; @@ -4575,16 +4460,19 @@ end: return (void *) integer; } +BT_EXPORT int bt_ctf_field_type_integer_get_size(struct bt_ctf_field_type *ft) { return bt_ctf_field_type_common_integer_get_size((void *) ft); } +BT_EXPORT bt_ctf_bool bt_ctf_field_type_integer_is_signed(struct bt_ctf_field_type *ft) { return bt_ctf_field_type_common_integer_is_signed((void *) ft); } +BT_EXPORT int bt_ctf_field_type_integer_set_is_signed(struct bt_ctf_field_type *ft, bt_ctf_bool is_signed) { @@ -4592,18 +4480,21 @@ int bt_ctf_field_type_integer_set_is_signed(struct bt_ctf_field_type *ft, is_signed); } +BT_EXPORT int bt_ctf_field_type_integer_set_size(struct bt_ctf_field_type *ft, unsigned int size) { return bt_ctf_field_type_common_integer_set_size((void *) ft, size); } +BT_EXPORT enum bt_ctf_integer_base bt_ctf_field_type_integer_get_base( struct bt_ctf_field_type *ft) { return (int) bt_ctf_field_type_common_integer_get_base((void *) ft); } +BT_EXPORT int bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *ft, enum bt_ctf_integer_base base) { @@ -4611,12 +4502,14 @@ int bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *ft, (int) base); } +BT_EXPORT enum bt_ctf_string_encoding bt_ctf_field_type_integer_get_encoding( struct bt_ctf_field_type *ft) { return (int) bt_ctf_field_type_common_integer_get_encoding((void *) ft); } +BT_EXPORT int bt_ctf_field_type_integer_set_encoding(struct bt_ctf_field_type *ft, enum bt_ctf_string_encoding encoding) { @@ -4624,6 +4517,7 @@ int bt_ctf_field_type_integer_set_encoding(struct bt_ctf_field_type *ft, (int) encoding); } +BT_EXPORT struct bt_ctf_clock_class *bt_ctf_field_type_integer_get_mapped_clock_class( struct bt_ctf_field_type *ft) { @@ -4631,6 +4525,7 @@ struct bt_ctf_clock_class *bt_ctf_field_type_integer_get_mapped_clock_class( (void *) ft)); } +BT_EXPORT int bt_ctf_field_type_integer_set_mapped_clock_class( struct bt_ctf_field_type *ft, struct bt_ctf_clock_class *clock_class) @@ -4639,6 +4534,7 @@ int bt_ctf_field_type_integer_set_mapped_clock_class( clock_class); } +BT_EXPORT int bt_ctf_field_type_enumeration_signed_get_mapping_by_index( struct bt_ctf_field_type *ft, uint64_t index, const char **mapping_name, int64_t *range_begin, @@ -4648,6 +4544,7 @@ int bt_ctf_field_type_enumeration_signed_get_mapping_by_index( (void *) ft, index, mapping_name, range_begin, range_end); } +BT_EXPORT int bt_ctf_field_type_enumeration_unsigned_get_mapping_by_index( struct bt_ctf_field_type *ft, uint64_t index, const char **mapping_name, uint64_t *range_begin, @@ -4657,6 +4554,7 @@ int bt_ctf_field_type_enumeration_unsigned_get_mapping_by_index( (void *) ft, index, mapping_name, range_begin, range_end); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_enumeration_create( struct bt_ctf_field_type *container_ft) { @@ -4702,6 +4600,7 @@ end: return (void *) enumeration; } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_field_type( struct bt_ctf_field_type *ft) { @@ -4710,6 +4609,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_field_type (void *) ft)); } +BT_EXPORT int bt_ctf_field_type_enumeration_signed_add_mapping( struct bt_ctf_field_type *ft, const char *string, int64_t range_start, int64_t range_end) @@ -4718,6 +4618,7 @@ int bt_ctf_field_type_enumeration_signed_add_mapping( (void *) ft, string, range_start, range_end); } +BT_EXPORT int bt_ctf_field_type_enumeration_unsigned_add_mapping( struct bt_ctf_field_type *ft, const char *string, uint64_t range_start, uint64_t range_end) @@ -4726,12 +4627,14 @@ int bt_ctf_field_type_enumeration_unsigned_add_mapping( (void *) ft, string, range_start, range_end); } +BT_EXPORT int64_t bt_ctf_field_type_enumeration_get_mapping_count( struct bt_ctf_field_type *ft) { return bt_ctf_field_type_common_enumeration_get_mapping_count((void *) ft); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_floating_point_create(void) { struct bt_ctf_field_type_common_floating_point *floating_point = @@ -4758,6 +4661,7 @@ end: return (void *) floating_point; } +BT_EXPORT int bt_ctf_field_type_floating_point_get_exponent_digits( struct bt_ctf_field_type *ft) { @@ -4765,6 +4669,7 @@ int bt_ctf_field_type_floating_point_get_exponent_digits( (void *) ft); } +BT_EXPORT int bt_ctf_field_type_floating_point_set_exponent_digits( struct bt_ctf_field_type *ft, unsigned int exponent_digits) { @@ -4772,6 +4677,7 @@ int bt_ctf_field_type_floating_point_set_exponent_digits( (void *) ft, exponent_digits); } +BT_EXPORT int bt_ctf_field_type_floating_point_get_mantissa_digits( struct bt_ctf_field_type *ft) { @@ -4779,6 +4685,7 @@ int bt_ctf_field_type_floating_point_get_mantissa_digits( (void *) ft); } +BT_EXPORT int bt_ctf_field_type_floating_point_set_mantissa_digits( struct bt_ctf_field_type *ft, unsigned int mantissa_digits) { @@ -4786,6 +4693,7 @@ int bt_ctf_field_type_floating_point_set_mantissa_digits( (void *) ft, mantissa_digits); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_structure_create(void) { struct bt_ctf_field_type_common_structure *structure = @@ -4814,6 +4722,7 @@ end: return (void *) structure; } +BT_EXPORT int bt_ctf_field_type_structure_add_field(struct bt_ctf_field_type *ft, struct bt_ctf_field_type *field_type, const char *field_name) @@ -4822,11 +4731,13 @@ int bt_ctf_field_type_structure_add_field(struct bt_ctf_field_type *ft, (void *) field_type, field_name); } +BT_EXPORT int64_t bt_ctf_field_type_structure_get_field_count(struct bt_ctf_field_type *ft) { return bt_ctf_field_type_common_structure_get_field_count((void *) ft); } +BT_EXPORT int bt_ctf_field_type_structure_get_field_by_index( struct bt_ctf_field_type *ft, const char **field_name, @@ -4842,6 +4753,7 @@ int bt_ctf_field_type_structure_get_field_by_index( return ret; } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_structure_get_field_type_by_name( struct bt_ctf_field_type *ft, const char *name) { @@ -4849,6 +4761,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_structure_get_field_type_by_name( (void *) ft, name)); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_variant_create( struct bt_ctf_field_type *tag_ft, const char *tag_name) { @@ -4889,6 +4802,7 @@ end: return (void *) var_ft; } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_variant_get_tag_field_type( struct bt_ctf_field_type *ft) { @@ -4896,17 +4810,20 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_tag_field_type( (void *) ft)); } +BT_EXPORT const char *bt_ctf_field_type_variant_get_tag_name(struct bt_ctf_field_type *ft) { return bt_ctf_field_type_common_variant_get_tag_name((void *) ft); } +BT_EXPORT int bt_ctf_field_type_variant_set_tag_name( struct bt_ctf_field_type *ft, const char *name) { return bt_ctf_field_type_common_variant_set_tag_name((void *) ft, name); } +BT_EXPORT int bt_ctf_field_type_variant_add_field(struct bt_ctf_field_type *ft, struct bt_ctf_field_type *field_type, const char *field_name) @@ -4915,6 +4832,7 @@ int bt_ctf_field_type_variant_add_field(struct bt_ctf_field_type *ft, (void *) field_type, field_name); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_by_name( struct bt_ctf_field_type *ft, const char *field_name) @@ -4923,6 +4841,7 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_by_name( (void *) ft, field_name)); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag( struct bt_ctf_field_type *ft, struct bt_ctf_field *tag_field) @@ -4978,11 +4897,13 @@ end: return ret_ft; } +BT_EXPORT int64_t bt_ctf_field_type_variant_get_field_count(struct bt_ctf_field_type *ft) { return bt_ctf_field_type_common_variant_get_field_count((void *) ft); } +BT_EXPORT int bt_ctf_field_type_variant_get_field_by_index(struct bt_ctf_field_type *ft, const char **field_name, struct bt_ctf_field_type **field_type, uint64_t index) @@ -4997,6 +4918,7 @@ int bt_ctf_field_type_variant_get_field_by_index(struct bt_ctf_field_type *ft, return ret; } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_array_create( struct bt_ctf_field_type *element_ft, unsigned int length) { @@ -5039,6 +4961,7 @@ end: return (void *) array; } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_array_get_element_field_type( struct bt_ctf_field_type *ft) { @@ -5046,11 +4969,13 @@ struct bt_ctf_field_type *bt_ctf_field_type_array_get_element_field_type( (void *) ft)); } +BT_EXPORT int64_t bt_ctf_field_type_array_get_length(struct bt_ctf_field_type *ft) { return bt_ctf_field_type_common_array_get_length((void *) ft); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_sequence_create( struct bt_ctf_field_type *element_ft, const char *length_field_name) @@ -5095,6 +5020,7 @@ end: return (void *) sequence; } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_sequence_get_element_field_type( struct bt_ctf_field_type *ft) { @@ -5102,12 +5028,14 @@ struct bt_ctf_field_type *bt_ctf_field_type_sequence_get_element_field_type( (void *) ft)); } +BT_EXPORT const char *bt_ctf_field_type_sequence_get_length_field_name( struct bt_ctf_field_type *ft) { return bt_ctf_field_type_common_sequence_get_length_field_name((void *) ft); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_type_string_create(void) { struct bt_ctf_field_type_common_string *string = @@ -5129,12 +5057,14 @@ struct bt_ctf_field_type *bt_ctf_field_type_string_create(void) return (void *) string; } +BT_EXPORT enum bt_ctf_string_encoding bt_ctf_field_type_string_get_encoding( struct bt_ctf_field_type *ft) { return (int) bt_ctf_field_type_common_string_get_encoding((void *) ft); } +BT_EXPORT int bt_ctf_field_type_string_set_encoding(struct bt_ctf_field_type *ft, enum bt_ctf_string_encoding encoding) { @@ -5142,23 +5072,27 @@ int bt_ctf_field_type_string_set_encoding(struct bt_ctf_field_type *ft, (int) encoding); } +BT_EXPORT int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *ft) { return bt_ctf_field_type_common_get_alignment((void *) ft); } +BT_EXPORT int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *ft, unsigned int alignment) { return bt_ctf_field_type_common_set_alignment((void *) ft, alignment); } +BT_EXPORT enum bt_ctf_byte_order bt_ctf_field_type_get_byte_order( struct bt_ctf_field_type *ft) { return (int) bt_ctf_field_type_common_get_byte_order((void *) ft); } +BT_EXPORT int bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *ft, enum bt_ctf_byte_order byte_order) { @@ -5166,13 +5100,13 @@ int bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *ft, (int) byte_order); } +BT_EXPORT enum bt_ctf_field_type_id bt_ctf_field_type_get_type_id( struct bt_ctf_field_type *ft) { return (int) bt_ctf_field_type_common_get_type_id((void *) ft); } -BT_HIDDEN struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *ft) { return (void *) bt_ctf_field_type_common_copy((void *) ft); diff --git a/src/ctf-writer/field-types.h b/src/ctf-writer/field-types.h index a891b068..fa6b96a4 100644 --- a/src/ctf-writer/field-types.h +++ b/src/ctf-writer/field-types.h @@ -264,50 +264,42 @@ struct bt_ctf_field_type_common_string { typedef struct bt_ctf_field_common *(* bt_ctf_field_common_create_func)( struct bt_ctf_field_type_common *); -BT_HIDDEN void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common *ft, bool init_bo, bt_ctf_object_release_func release_func, struct bt_ctf_field_type_common_methods *methods); -BT_HIDDEN void bt_ctf_field_type_common_integer_initialize( struct bt_ctf_field_type_common *ft, unsigned int size, bt_ctf_object_release_func release_func, struct bt_ctf_field_type_common_methods *methods); -BT_HIDDEN void bt_ctf_field_type_common_floating_point_initialize( struct bt_ctf_field_type_common *ft, bt_ctf_object_release_func release_func, struct bt_ctf_field_type_common_methods *methods); -BT_HIDDEN void bt_ctf_field_type_common_enumeration_initialize( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *container_ft, bt_ctf_object_release_func release_func, struct bt_ctf_field_type_common_methods *methods); -BT_HIDDEN void bt_ctf_field_type_common_string_initialize( struct bt_ctf_field_type_common *ft, bt_ctf_object_release_func release_func, struct bt_ctf_field_type_common_methods *methods); -BT_HIDDEN void bt_ctf_field_type_common_structure_initialize( struct bt_ctf_field_type_common *ft, bt_ctf_object_release_func release_func, struct bt_ctf_field_type_common_methods *methods); -BT_HIDDEN void bt_ctf_field_type_common_array_initialize( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *element_ft, unsigned int length, bt_ctf_object_release_func release_func, struct bt_ctf_field_type_common_methods *methods); -BT_HIDDEN void bt_ctf_field_type_common_sequence_initialize( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *element_ft, @@ -315,7 +307,6 @@ void bt_ctf_field_type_common_sequence_initialize( bt_ctf_object_release_func release_func, struct bt_ctf_field_type_common_methods *methods); -BT_HIDDEN void bt_ctf_field_type_common_variant_initialize( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *tag_ft, @@ -323,469 +314,361 @@ void bt_ctf_field_type_common_variant_initialize( bt_ctf_object_release_func release_func, struct bt_ctf_field_type_common_methods *methods); -BT_HIDDEN void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object *obj); -BT_HIDDEN void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object *obj); -BT_HIDDEN void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object *obj); -BT_HIDDEN void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object *obj); -BT_HIDDEN void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object *obj); -BT_HIDDEN void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object *obj); -BT_HIDDEN void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object *obj); -BT_HIDDEN void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object *obj); -BT_HIDDEN int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_enumeration_validate_recursive( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_sequence_validate_recursive( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_array_validate_recursive( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_structure_validate_recursive( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_variant_validate_recursive( struct bt_ctf_field_type_common *type); -BT_HIDDEN int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *ft); -BT_HIDDEN bt_ctf_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common *ft, bt_ctf_bool is_signed); -BT_HIDDEN int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common *ft, unsigned int size); -BT_HIDDEN enum bt_ctf_integer_base bt_ctf_field_type_common_integer_get_base( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common *ft, enum bt_ctf_integer_base base); -BT_HIDDEN enum bt_ctf_string_encoding bt_ctf_field_type_common_integer_get_encoding( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common *ft, enum bt_ctf_string_encoding encoding); -BT_HIDDEN struct bt_ctf_clock_class *bt_ctf_field_type_common_integer_borrow_mapped_clock_class( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen( struct bt_ctf_field_type_common *ft, struct bt_ctf_clock_class *clock_class); -BT_HIDDEN int bt_ctf_field_type_common_integer_set_mapped_clock_class( struct bt_ctf_field_type_common *ft, struct bt_ctf_clock_class *clock_class); -BT_HIDDEN struct bt_ctf_field_type_enumeration_mapping_iterator * bt_ctf_field_type_common_enumeration_find_mappings_by_name( struct bt_ctf_field_type_common *ft, const char *name); -BT_HIDDEN struct bt_ctf_field_type_enumeration_mapping_iterator * bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value( struct bt_ctf_field_type_common *ft, int64_t value); -BT_HIDDEN struct bt_ctf_field_type_enumeration_mapping_iterator * bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value( struct bt_ctf_field_type_common *ft, uint64_t value); -BT_HIDDEN int bt_ctf_field_type_enumeration_mapping_iterator_next( struct bt_ctf_field_type_enumeration_mapping_iterator *iter); -BT_HIDDEN int bt_ctf_field_type_enumeration_mapping_iterator_signed_get( struct bt_ctf_field_type_enumeration_mapping_iterator *iter, const char **mapping_name, int64_t *range_begin, int64_t *range_end); -BT_HIDDEN int bt_ctf_field_type_enumeration_mapping_iterator_unsigned_get( struct bt_ctf_field_type_enumeration_mapping_iterator *iter, const char **mapping_name, uint64_t *range_begin, uint64_t *range_end); -BT_HIDDEN int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index( struct bt_ctf_field_type_common *ft, uint64_t index, const char **mapping_name, int64_t *range_begin, int64_t *range_end); -BT_HIDDEN int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index( struct bt_ctf_field_type_common *ft, uint64_t index, const char **mapping_name, uint64_t *range_begin, uint64_t *range_end); -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_enumeration_borrow_container_field_type( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_enumeration_signed_add_mapping( struct bt_ctf_field_type_common *ft, const char *string, int64_t range_start, int64_t range_end); -BT_HIDDEN int bt_ctf_field_type_common_enumeration_unsigned_add_mapping( struct bt_ctf_field_type_common *ft, const char *string, uint64_t range_start, uint64_t range_end); -BT_HIDDEN int64_t bt_ctf_field_type_common_enumeration_get_mapping_count( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_floating_point_get_exponent_digits( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_floating_point_set_exponent_digits( struct bt_ctf_field_type_common *ft, unsigned int exponent_digits); -BT_HIDDEN int bt_ctf_field_type_common_floating_point_get_mantissa_digits( struct bt_ctf_field_type_common *type); -BT_HIDDEN int bt_ctf_field_type_common_floating_point_set_mantissa_digits( struct bt_ctf_field_type_common *ft, unsigned int mantissa_digits); -BT_HIDDEN int bt_ctf_field_type_common_structure_replace_field( struct bt_ctf_field_type_common *ft, const char *field_name, struct bt_ctf_field_type_common *field_type); -BT_HIDDEN int bt_ctf_field_type_common_structure_add_field(struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *field_type, const char *field_name); -BT_HIDDEN int64_t bt_ctf_field_type_common_structure_get_field_count( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_structure_borrow_field_by_index( struct bt_ctf_field_type_common *ft, const char **field_name, struct bt_ctf_field_type_common **field_type, uint64_t index); -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_structure_borrow_field_type_by_name( struct bt_ctf_field_type_common *ft, const char *name); -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_variant_borrow_tag_field_type( struct bt_ctf_field_type_common *ft); -BT_HIDDEN const char *bt_ctf_field_type_common_variant_get_tag_name( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_variant_set_tag_name( struct bt_ctf_field_type_common *ft, const char *name); -BT_HIDDEN int bt_ctf_field_type_common_variant_add_field(struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *field_type, const char *field_name); -BT_HIDDEN int bt_ctf_field_type_common_variant_update_choices( struct bt_ctf_field_type_common *ft); -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_variant_borrow_field_type_by_name( struct bt_ctf_field_type_common *ft, const char *field_name); -BT_HIDDEN int64_t bt_ctf_field_type_common_variant_get_field_count( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_variant_borrow_field_by_index( struct bt_ctf_field_type_common *ft, const char **field_name, struct bt_ctf_field_type_common **field_type, uint64_t index); -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_array_borrow_element_field_type( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_array_set_element_field_type( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *element_ft); -BT_HIDDEN int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common *ft); -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_sequence_borrow_element_field_type( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_sequence_set_element_field_type( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *element_ft); -BT_HIDDEN const char *bt_ctf_field_type_common_sequence_get_length_field_name( struct bt_ctf_field_type_common *ft); -BT_HIDDEN enum bt_ctf_string_encoding bt_ctf_field_type_common_string_get_encoding( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common *ft, enum bt_ctf_string_encoding encoding); -BT_HIDDEN int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common *type); -BT_HIDDEN int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common *ft, unsigned int alignment); -BT_HIDDEN enum bt_ctf_byte_order bt_ctf_field_type_common_get_byte_order( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order); -BT_HIDDEN enum bt_ctf_field_type_id bt_ctf_field_type_common_get_type_id( struct bt_ctf_field_type_common *ft); -BT_HIDDEN void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common *ft); -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_variant_borrow_field_type_signed( struct bt_ctf_field_type_common_variant *var_ft, int64_t tag_value); -BT_HIDDEN struct bt_ctf_field_type_common * bt_ctf_field_type_common_variant_borrow_field_type_unsigned( struct bt_ctf_field_type_common_variant *var_ft, uint64_t tag_value); -BT_HIDDEN struct bt_ctf_field_type_common *bt_ctf_field_type_common_copy( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_structure_get_field_name_index( struct bt_ctf_field_type_common *ft, const char *name); -BT_HIDDEN int bt_ctf_field_type_common_variant_get_field_name_index( struct bt_ctf_field_type_common *ft, const char *name); -BT_HIDDEN int bt_ctf_field_type_common_sequence_set_length_field_path( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_path *path); -BT_HIDDEN int bt_ctf_field_type_common_variant_set_tag_field_path( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_path *path); -BT_HIDDEN int bt_ctf_field_type_common_variant_set_tag_field_type( struct bt_ctf_field_type_common *ft, struct bt_ctf_field_type_common *tag_ft); -BT_HIDDEN void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common *ft); -BT_HIDDEN void bt_ctf_field_type_common_enumeration_freeze_recursive( struct bt_ctf_field_type_common *ft); -BT_HIDDEN void bt_ctf_field_type_common_structure_freeze_recursive( struct bt_ctf_field_type_common *ft); -BT_HIDDEN void bt_ctf_field_type_common_variant_freeze_recursive( struct bt_ctf_field_type_common *ft); -BT_HIDDEN void bt_ctf_field_type_common_array_freeze_recursive( struct bt_ctf_field_type_common *ft); -BT_HIDDEN void bt_ctf_field_type_common_sequence_freeze_recursive( struct bt_ctf_field_type_common *type); -BT_HIDDEN void bt_ctf_field_type_common_integer_set_byte_order( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order); -BT_HIDDEN void bt_ctf_field_type_common_enumeration_set_byte_order_recursive( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order); -BT_HIDDEN void bt_ctf_field_type_common_floating_point_set_byte_order( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order); -BT_HIDDEN void bt_ctf_field_type_common_structure_set_byte_order_recursive( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order); -BT_HIDDEN void bt_ctf_field_type_common_variant_set_byte_order_recursive( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order); -BT_HIDDEN void bt_ctf_field_type_common_array_set_byte_order_recursive( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order); -BT_HIDDEN void bt_ctf_field_type_common_sequence_set_byte_order_recursive( struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order); -BT_HIDDEN int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b); -BT_HIDDEN int bt_ctf_field_type_common_floating_point_compare( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b); -BT_HIDDEN int bt_ctf_field_type_common_enumeration_compare_recursive( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b); -BT_HIDDEN int bt_ctf_field_type_common_string_compare(struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b); -BT_HIDDEN int bt_ctf_field_type_common_structure_compare_recursive( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b); -BT_HIDDEN int bt_ctf_field_type_common_variant_compare_recursive( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b); -BT_HIDDEN int bt_ctf_field_type_common_array_compare_recursive( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b); -BT_HIDDEN int bt_ctf_field_type_common_sequence_compare_recursive( struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b); -BT_HIDDEN int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common *ft_a, struct bt_ctf_field_type_common *ft_b); -BT_HIDDEN int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common *ft); -BT_HIDDEN struct bt_ctf_field_type_common *bt_ctf_field_type_common_borrow_field_at_index( struct bt_ctf_field_type_common *ft, int index); -BT_HIDDEN int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common *ft, const char *name); -BT_HIDDEN struct bt_ctf_field_path *bt_ctf_field_type_common_variant_borrow_tag_field_path( struct bt_ctf_field_type_common *ft); -BT_HIDDEN struct bt_ctf_field_path *bt_ctf_field_type_common_sequence_borrow_length_field_path( struct bt_ctf_field_type_common *ft); -BT_HIDDEN int bt_ctf_field_type_common_validate_single_clock_class( struct bt_ctf_field_type_common *ft, struct bt_ctf_clock_class **expected_clock_class); -BT_HIDDEN int64_t bt_ctf_field_type_common_variant_find_choice_index( struct bt_ctf_field_type_common *ft, uint64_t uval, bool is_signed); -BT_HIDDEN int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type *type, struct metadata_context *context); -BT_HIDDEN struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *ft); #endif /* BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H */ diff --git a/src/ctf-writer/field-wrapper.c b/src/ctf-writer/field-wrapper.c index 9c840512..0adc54e9 100644 --- a/src/ctf-writer/field-wrapper.c +++ b/src/ctf-writer/field-wrapper.c @@ -13,7 +13,6 @@ #include "field-wrapper.h" #include "object.h" -BT_HIDDEN struct bt_ctf_field_wrapper *bt_ctf_field_wrapper_new(void *data) { struct bt_ctf_field_wrapper *field_wrapper = @@ -34,7 +33,6 @@ end: return field_wrapper; } -BT_HIDDEN void bt_ctf_field_wrapper_destroy(struct bt_ctf_field_wrapper *field_wrapper) { BT_LOGD("Destroying field wrapper: addr=%p", field_wrapper); @@ -43,7 +41,6 @@ void bt_ctf_field_wrapper_destroy(struct bt_ctf_field_wrapper *field_wrapper) g_free(field_wrapper); } -BT_HIDDEN struct bt_ctf_field_wrapper *bt_ctf_field_wrapper_create( struct bt_ctf_object_pool *pool, struct bt_ctf_field_type *ft) { diff --git a/src/ctf-writer/field-wrapper.h b/src/ctf-writer/field-wrapper.h index e2c1227f..2b3286d2 100644 --- a/src/ctf-writer/field-wrapper.h +++ b/src/ctf-writer/field-wrapper.h @@ -20,13 +20,10 @@ struct bt_ctf_field_wrapper { struct bt_ctf_field_common *field; }; -BT_HIDDEN struct bt_ctf_field_wrapper *bt_ctf_field_wrapper_new(void *data); -BT_HIDDEN void bt_ctf_field_wrapper_destroy(struct bt_ctf_field_wrapper *field); -BT_HIDDEN struct bt_ctf_field_wrapper *bt_ctf_field_wrapper_create( struct bt_ctf_object_pool *pool, struct bt_ctf_field_type *ft); diff --git a/src/ctf-writer/fields.c b/src/ctf-writer/fields.c index 587ed14f..5334dddd 100644 --- a/src/ctf-writer/fields.c +++ b/src/ctf-writer/fields.c @@ -32,7 +32,6 @@ _name " is not an integer or an enumeration field: " \ "field-addr=%p", (_field)) -BT_HIDDEN struct bt_ctf_field_common *bt_ctf_field_common_copy(struct bt_ctf_field_common *field) { struct bt_ctf_field_common *copy = NULL; @@ -52,7 +51,6 @@ end: return copy; } -BT_HIDDEN int bt_ctf_field_common_structure_initialize(struct bt_ctf_field_common *field, struct bt_ctf_field_type_common *type, bool is_shared, bt_ctf_object_release_func release_func, @@ -96,7 +94,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_common_variant_initialize(struct bt_ctf_field_common *field, struct bt_ctf_field_type_common *type, bool is_shared, bt_ctf_object_release_func release_func, @@ -148,7 +145,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_common_string_initialize(struct bt_ctf_field_common *field, struct bt_ctf_field_type_common *type, bool is_shared, bt_ctf_object_release_func release_func, @@ -174,7 +170,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_common_array_initialize(struct bt_ctf_field_common *field, struct bt_ctf_field_type_common *type, bool is_shared, bt_ctf_object_release_func release_func, @@ -218,7 +213,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_common_sequence_initialize(struct bt_ctf_field_common *field, struct bt_ctf_field_type_common *type, bool is_shared, bt_ctf_object_release_func release_func, @@ -246,13 +240,11 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_common_generic_validate(struct bt_ctf_field_common *field) { return (field && field->payload_set) ? 0 : -1; } -BT_HIDDEN int bt_ctf_field_common_structure_validate_recursive(struct bt_ctf_field_common *field) { int64_t i; @@ -284,7 +276,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_common_variant_validate_recursive(struct bt_ctf_field_common *field) { int ret = 0; @@ -303,7 +294,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_common_array_validate_recursive(struct bt_ctf_field_common *field) { int64_t i; @@ -327,7 +317,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_common_sequence_validate_recursive(struct bt_ctf_field_common *field) { int64_t i; @@ -351,14 +340,12 @@ end: return ret; } -BT_HIDDEN void bt_ctf_field_common_generic_reset(struct bt_ctf_field_common *field) { BT_ASSERT_DBG(field); field->payload_set = false; } -BT_HIDDEN void bt_ctf_field_common_structure_reset_recursive(struct bt_ctf_field_common *field) { int64_t i; @@ -382,7 +369,6 @@ void bt_ctf_field_common_structure_reset_recursive(struct bt_ctf_field_common *f } } -BT_HIDDEN void bt_ctf_field_common_variant_reset_recursive(struct bt_ctf_field_common *field) { struct bt_ctf_field_common_variant *variant = BT_CTF_FROM_COMMON(field); @@ -391,7 +377,6 @@ void bt_ctf_field_common_variant_reset_recursive(struct bt_ctf_field_common *fie variant->current_field = NULL; } -BT_HIDDEN void bt_ctf_field_common_array_reset_recursive(struct bt_ctf_field_common *field) { size_t i; @@ -414,7 +399,6 @@ void bt_ctf_field_common_array_reset_recursive(struct bt_ctf_field_common *field } } -BT_HIDDEN void bt_ctf_field_common_sequence_reset_recursive(struct bt_ctf_field_common *field) { struct bt_ctf_field_common_sequence *sequence = BT_CTF_FROM_COMMON(field); @@ -432,14 +416,12 @@ void bt_ctf_field_common_sequence_reset_recursive(struct bt_ctf_field_common *fi sequence->length = 0; } -BT_HIDDEN void bt_ctf_field_common_generic_set_is_frozen(struct bt_ctf_field_common *field, bool is_frozen) { field->frozen = is_frozen; } -BT_HIDDEN void bt_ctf_field_common_structure_set_is_frozen_recursive( struct bt_ctf_field_common *field, bool is_frozen) { @@ -462,7 +444,6 @@ void bt_ctf_field_common_structure_set_is_frozen_recursive( bt_ctf_field_common_generic_set_is_frozen(field, is_frozen); } -BT_HIDDEN void bt_ctf_field_common_variant_set_is_frozen_recursive( struct bt_ctf_field_common *field, bool is_frozen) { @@ -483,7 +464,6 @@ void bt_ctf_field_common_variant_set_is_frozen_recursive( bt_ctf_field_common_generic_set_is_frozen(field, is_frozen); } -BT_HIDDEN void bt_ctf_field_common_array_set_is_frozen_recursive( struct bt_ctf_field_common *field, bool is_frozen) { @@ -505,7 +485,6 @@ void bt_ctf_field_common_array_set_is_frozen_recursive( bt_ctf_field_common_generic_set_is_frozen(field, is_frozen); } -BT_HIDDEN void bt_ctf_field_common_sequence_set_is_frozen_recursive( struct bt_ctf_field_common *field, bool is_frozen) { @@ -528,7 +507,6 @@ void bt_ctf_field_common_sequence_set_is_frozen_recursive( bt_ctf_field_common_generic_set_is_frozen(field, is_frozen); } -BT_HIDDEN void _bt_ctf_field_common_set_is_frozen_recursive(struct bt_ctf_field_common *field, bool is_frozen) { @@ -546,13 +524,11 @@ end: return; } -BT_HIDDEN bt_ctf_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field) { return field && field->payload_set; } -BT_HIDDEN bt_ctf_bool bt_ctf_field_common_structure_is_set_recursive( struct bt_ctf_field_common *field) { @@ -574,7 +550,6 @@ end: return is_set; } -BT_HIDDEN bt_ctf_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field) { struct bt_ctf_field_common_variant *variant = BT_CTF_FROM_COMMON(field); @@ -590,7 +565,6 @@ bt_ctf_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_com return is_set; } -BT_HIDDEN bt_ctf_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field) { size_t i; @@ -610,7 +584,6 @@ end: return is_set; } -BT_HIDDEN bt_ctf_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field) { size_t i; @@ -840,7 +813,6 @@ void bt_ctf_field_string_destroy(struct bt_ctf_field *field) g_free(field); } -BT_HIDDEN int bt_ctf_field_serialize_recursive(struct bt_ctf_field *field, struct bt_ctfser *ctfser, enum bt_ctf_byte_order native_byte_order) @@ -1121,6 +1093,7 @@ end: return ret; } +BT_EXPORT struct bt_ctf_field *bt_ctf_field_create(struct bt_ctf_field_type *type) { struct bt_ctf_field *field = NULL; @@ -1142,11 +1115,13 @@ end: return field; } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_field_get_type(struct bt_ctf_field *field) { return bt_ctf_object_get_ref(bt_ctf_field_common_borrow_type((void *) field)); } +BT_EXPORT enum bt_ctf_field_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field) { struct bt_ctf_field_common *field_common = (void *) field; @@ -1155,6 +1130,7 @@ enum bt_ctf_field_type_id bt_ctf_field_get_type_id(struct bt_ctf_field *field) return (int) field_common->type->id; } +BT_EXPORT int bt_ctf_field_sequence_set_length(struct bt_ctf_field *field, struct bt_ctf_field *length_field) { @@ -1182,6 +1158,7 @@ int bt_ctf_field_sequence_set_length(struct bt_ctf_field *field, length, (bt_ctf_field_common_create_func) bt_ctf_field_create); } +BT_EXPORT struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index( struct bt_ctf_field *field, uint64_t index) { @@ -1189,6 +1166,7 @@ struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index( (void *) field, index)); } +BT_EXPORT struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name( struct bt_ctf_field *field, const char *name) { @@ -1196,6 +1174,7 @@ struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name( (void *) field, name)); } +BT_EXPORT struct bt_ctf_field *bt_ctf_field_array_get_field( struct bt_ctf_field *field, uint64_t index) { @@ -1203,6 +1182,7 @@ struct bt_ctf_field *bt_ctf_field_array_get_field( bt_ctf_field_common_array_borrow_field((void *) field, index)); } +BT_EXPORT struct bt_ctf_field *bt_ctf_field_sequence_get_field( struct bt_ctf_field *field, uint64_t index) { @@ -1210,6 +1190,7 @@ struct bt_ctf_field *bt_ctf_field_sequence_get_field( bt_ctf_field_common_sequence_borrow_field((void *) field, index)); } +BT_EXPORT struct bt_ctf_field *bt_ctf_field_variant_get_field(struct bt_ctf_field *field, struct bt_ctf_field *tag_field) { @@ -1270,6 +1251,7 @@ end: return current_field; } +BT_EXPORT struct bt_ctf_field *bt_ctf_field_variant_get_current_field( struct bt_ctf_field *variant_field) { @@ -1277,7 +1259,6 @@ struct bt_ctf_field *bt_ctf_field_variant_get_current_field( (void *) variant_field)); } -BT_HIDDEN struct bt_ctf_field *bt_ctf_field_enumeration_borrow_container( struct bt_ctf_field *field) { @@ -1290,12 +1271,14 @@ struct bt_ctf_field *bt_ctf_field_enumeration_borrow_container( return (void *) enumeration->container; } +BT_EXPORT struct bt_ctf_field *bt_ctf_field_enumeration_get_container( struct bt_ctf_field *field) { return bt_ctf_object_get_ref(bt_ctf_field_enumeration_borrow_container(field)); } +BT_EXPORT int bt_ctf_field_integer_signed_get_value(struct bt_ctf_field *field, int64_t *value) { @@ -1313,6 +1296,7 @@ int bt_ctf_field_integer_signed_get_value(struct bt_ctf_field *field, return 0; } +BT_EXPORT int bt_ctf_field_integer_signed_set_value(struct bt_ctf_field *field, int64_t value) { @@ -1336,6 +1320,7 @@ int bt_ctf_field_integer_signed_set_value(struct bt_ctf_field *field, return ret; } +BT_EXPORT int bt_ctf_field_integer_unsigned_get_value(struct bt_ctf_field *field, uint64_t *value) { @@ -1353,6 +1338,7 @@ int bt_ctf_field_integer_unsigned_get_value(struct bt_ctf_field *field, return 0; } +BT_EXPORT int bt_ctf_field_integer_unsigned_set_value(struct bt_ctf_field *field, uint64_t value) { @@ -1375,39 +1361,46 @@ int bt_ctf_field_integer_unsigned_set_value(struct bt_ctf_field *field, return 0; } +BT_EXPORT int bt_ctf_field_floating_point_get_value(struct bt_ctf_field *field, double *value) { return bt_ctf_field_common_floating_point_get_value((void *) field, value); } +BT_EXPORT int bt_ctf_field_floating_point_set_value(struct bt_ctf_field *field, double value) { return bt_ctf_field_common_floating_point_set_value((void *) field, value); } +BT_EXPORT const char *bt_ctf_field_string_get_value(struct bt_ctf_field *field) { return bt_ctf_field_common_string_get_value((void *) field); } +BT_EXPORT int bt_ctf_field_string_set_value(struct bt_ctf_field *field, const char *value) { return bt_ctf_field_common_string_set_value((void *) field, value); } +BT_EXPORT int bt_ctf_field_string_append(struct bt_ctf_field *field, const char *value) { return bt_ctf_field_common_string_append((void *) field, value); } +BT_EXPORT int bt_ctf_field_string_append_len(struct bt_ctf_field *field, const char *value, unsigned int length) { return bt_ctf_field_common_string_append_len((void *) field, value, length); } +BT_EXPORT struct bt_ctf_field *bt_ctf_field_copy(struct bt_ctf_field *field) { return (void *) bt_ctf_field_common_copy((void *) field); @@ -1802,7 +1795,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_field_structure_set_field_by_name(struct bt_ctf_field *field, const char *name, struct bt_ctf_field *value) { diff --git a/src/ctf-writer/fields.h b/src/ctf-writer/fields.h index 2d6013ab..3893f911 100644 --- a/src/ctf-writer/fields.h +++ b/src/ctf-writer/fields.h @@ -142,10 +142,8 @@ struct bt_ctf_field_common_string { size_t size; }; -BT_HIDDEN struct bt_ctf_field_common *bt_ctf_field_common_copy(struct bt_ctf_field_common *field); -BT_HIDDEN int bt_ctf_field_common_structure_initialize(struct bt_ctf_field_common *field, struct bt_ctf_field_type_common *type, bool is_shared, bt_ctf_object_release_func release_func, @@ -153,7 +151,6 @@ int bt_ctf_field_common_structure_initialize(struct bt_ctf_field_common *field, bt_ctf_field_common_create_func field_create_func, GDestroyNotify field_release_func); -BT_HIDDEN int bt_ctf_field_common_array_initialize(struct bt_ctf_field_common *field, struct bt_ctf_field_type_common *type, bool is_shared, bt_ctf_object_release_func release_func, @@ -161,14 +158,12 @@ int bt_ctf_field_common_array_initialize(struct bt_ctf_field_common *field, bt_ctf_field_common_create_func field_create_func, GDestroyNotify field_destroy_func); -BT_HIDDEN int bt_ctf_field_common_sequence_initialize(struct bt_ctf_field_common *field, struct bt_ctf_field_type_common *type, bool is_shared, bt_ctf_object_release_func release_func, struct bt_ctf_field_common_methods *methods, GDestroyNotify field_destroy_func); -BT_HIDDEN int bt_ctf_field_common_variant_initialize(struct bt_ctf_field_common *field, struct bt_ctf_field_type_common *type, bool is_shared, bt_ctf_object_release_func release_func, @@ -176,80 +171,58 @@ int bt_ctf_field_common_variant_initialize(struct bt_ctf_field_common *field, bt_ctf_field_common_create_func field_create_func, GDestroyNotify field_release_func); -BT_HIDDEN int bt_ctf_field_common_string_initialize(struct bt_ctf_field_common *field, struct bt_ctf_field_type_common *type, bool is_shared, bt_ctf_object_release_func release_func, struct bt_ctf_field_common_methods *methods); -BT_HIDDEN int bt_ctf_field_common_generic_validate(struct bt_ctf_field_common *field); -BT_HIDDEN int bt_ctf_field_common_structure_validate_recursive(struct bt_ctf_field_common *field); -BT_HIDDEN int bt_ctf_field_common_variant_validate_recursive(struct bt_ctf_field_common *field); -BT_HIDDEN int bt_ctf_field_common_array_validate_recursive(struct bt_ctf_field_common *field); -BT_HIDDEN int bt_ctf_field_common_sequence_validate_recursive(struct bt_ctf_field_common *field); -BT_HIDDEN void bt_ctf_field_common_generic_reset(struct bt_ctf_field_common *field); -BT_HIDDEN void bt_ctf_field_common_structure_reset_recursive(struct bt_ctf_field_common *field); -BT_HIDDEN void bt_ctf_field_common_variant_reset_recursive(struct bt_ctf_field_common *field); -BT_HIDDEN void bt_ctf_field_common_array_reset_recursive(struct bt_ctf_field_common *field); -BT_HIDDEN void bt_ctf_field_common_sequence_reset_recursive(struct bt_ctf_field_common *field); -BT_HIDDEN void bt_ctf_field_common_generic_set_is_frozen(struct bt_ctf_field_common *field, bool is_frozen); -BT_HIDDEN void bt_ctf_field_common_structure_set_is_frozen_recursive( struct bt_ctf_field_common *field, bool is_frozen); -BT_HIDDEN void bt_ctf_field_common_variant_set_is_frozen_recursive( struct bt_ctf_field_common *field, bool is_frozen); -BT_HIDDEN void bt_ctf_field_common_array_set_is_frozen_recursive( struct bt_ctf_field_common *field, bool is_frozen); -BT_HIDDEN void bt_ctf_field_common_sequence_set_is_frozen_recursive( struct bt_ctf_field_common *field, bool is_frozen); -BT_HIDDEN void _bt_ctf_field_common_set_is_frozen_recursive(struct bt_ctf_field_common *field, bool is_frozen); -BT_HIDDEN bt_ctf_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field); -BT_HIDDEN bt_ctf_bool bt_ctf_field_common_structure_is_set_recursive( struct bt_ctf_field_common *field); -BT_HIDDEN bt_ctf_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field); -BT_HIDDEN bt_ctf_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field); -BT_HIDDEN bt_ctf_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field); #ifdef BT_DEV_MODE @@ -812,16 +785,13 @@ struct bt_ctf_field_variant { struct bt_ctf_field_enumeration *tag; }; -BT_HIDDEN int bt_ctf_field_serialize_recursive(struct bt_ctf_field *field, struct bt_ctfser *ctfser, enum bt_ctf_byte_order native_byte_order); -BT_HIDDEN int bt_ctf_field_structure_set_field_by_name(struct bt_ctf_field *field, const char *name, struct bt_ctf_field *value); -BT_HIDDEN struct bt_ctf_field *bt_ctf_field_enumeration_borrow_container( struct bt_ctf_field *field); diff --git a/src/ctf-writer/functor.c b/src/ctf-writer/functor.c index 0dc6dca7..d9cbd495 100644 --- a/src/ctf-writer/functor.c +++ b/src/ctf-writer/functor.c @@ -11,7 +11,6 @@ #include "functor.h" #include "utils.h" -BT_HIDDEN void value_exists(gpointer element, gpointer search_query) { if (element == ((struct bt_ctf_search_query *)search_query)->value) { diff --git a/src/ctf-writer/functor.h b/src/ctf-writer/functor.h index 056caee9..0b13d47e 100644 --- a/src/ctf-writer/functor.h +++ b/src/ctf-writer/functor.h @@ -10,7 +10,6 @@ #include #include "common/macros.h" -BT_HIDDEN void value_exists(gpointer element, gpointer search_query); #endif /* BABELTRACE_CTF_WRITER_FUNCTOR_INTERNAL_H */ diff --git a/src/ctf-writer/object-pool.c b/src/ctf-writer/object-pool.c index 9631801a..bfd937c2 100644 --- a/src/ctf-writer/object-pool.c +++ b/src/ctf-writer/object-pool.c @@ -14,6 +14,7 @@ #include "object-pool.h" +BT_EXPORT int bt_ctf_object_pool_initialize(struct bt_ctf_object_pool *pool, bt_ctf_object_pool_new_object_func new_object_func, bt_ctf_object_pool_destroy_object_func destroy_object_func, @@ -49,6 +50,7 @@ end: return ret; } +BT_EXPORT void bt_ctf_object_pool_finalize(struct bt_ctf_object_pool *pool) { uint64_t i; diff --git a/src/ctf-writer/object.c b/src/ctf-writer/object.c index ff71e79c..cf4e3f08 100644 --- a/src/ctf-writer/object.c +++ b/src/ctf-writer/object.c @@ -7,6 +7,7 @@ #include "object.h" #include +BT_EXPORT void *bt_ctf_object_get_ref(void *obj) { if (G_UNLIKELY(!obj)) { @@ -19,6 +20,7 @@ end: return obj; } +BT_EXPORT void bt_ctf_object_put_ref(void *obj) { if (G_UNLIKELY(!obj)) { diff --git a/src/ctf-writer/resolve.c b/src/ctf-writer/resolve.c index 6db0fb4a..33896051 100644 --- a/src/ctf-writer/resolve.c +++ b/src/ctf-writer/resolve.c @@ -1197,7 +1197,6 @@ int resolve_root_type(enum bt_ctf_scope root_scope, struct resolve_context *ctx) return ret; } -BT_HIDDEN int bt_ctf_resolve_types( struct bt_ctf_private_value *environment, struct bt_ctf_field_type_common *packet_header_type, diff --git a/src/ctf-writer/resolve.h b/src/ctf-writer/resolve.h index 51f3e693..7d72e934 100644 --- a/src/ctf-writer/resolve.h +++ b/src/ctf-writer/resolve.h @@ -39,7 +39,6 @@ enum bt_ctf_resolve_flag { * * All parameters are owned by the caller. */ -BT_HIDDEN int bt_ctf_resolve_types(struct bt_ctf_private_value *environment, struct bt_ctf_field_type_common *packet_header_type, struct bt_ctf_field_type_common *packet_context_type, diff --git a/src/ctf-writer/stream-class.c b/src/ctf-writer/stream-class.c index fa3b54fb..f18bbef5 100644 --- a/src/ctf-writer/stream-class.c +++ b/src/ctf-writer/stream-class.c @@ -34,7 +34,6 @@ #include "visitor.h" #include "writer.h" -BT_HIDDEN int bt_ctf_stream_class_common_initialize(struct bt_ctf_stream_class_common *stream_class, const char *name, bt_ctf_object_release_func release_func) { @@ -64,7 +63,6 @@ error: return -1; } -BT_HIDDEN void bt_ctf_stream_class_common_finalize(struct bt_ctf_stream_class_common *stream_class) { BT_LOGD("Finalizing common stream class: addr=%p, name=\"%s\", id=%" PRId64, @@ -129,7 +127,6 @@ end: return; } -BT_HIDDEN int bt_ctf_stream_class_common_add_event_class( struct bt_ctf_stream_class_common *stream_class, struct bt_ctf_event_class_common *event_class, @@ -401,7 +398,6 @@ int visit_event_class(void *object, bt_ctf_visitor visitor,void *data) return visitor(&obj, data); } -BT_HIDDEN int bt_ctf_stream_class_common_visit(struct bt_ctf_stream_class_common *stream_class, bt_ctf_visitor visitor, void *data) { @@ -428,7 +424,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_stream_class_visit(struct bt_ctf_stream_class *stream_class, bt_ctf_visitor visitor, void *data) { @@ -436,7 +431,6 @@ int bt_ctf_stream_class_visit(struct bt_ctf_stream_class *stream_class, visitor, data); } -BT_HIDDEN void bt_ctf_stream_class_common_freeze(struct bt_ctf_stream_class_common *stream_class) { if (!stream_class || stream_class->frozen) { @@ -453,7 +447,6 @@ void bt_ctf_stream_class_common_freeze(struct bt_ctf_stream_class_common *stream bt_ctf_clock_class_freeze(stream_class->clock_class); } -BT_HIDDEN int bt_ctf_stream_class_common_validate_single_clock_class( struct bt_ctf_stream_class_common *stream_class, struct bt_ctf_clock_class **expected_clock_class) @@ -680,6 +673,7 @@ void bt_ctf_stream_class_destroy(struct bt_ctf_object *obj) g_free(stream_class); } +BT_EXPORT struct bt_ctf_stream_class *bt_ctf_stream_class_create(const char *name) { struct bt_ctf_stream_class *stream_class; @@ -785,7 +779,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_stream_class_map_clock_class( struct bt_ctf_stream_class *stream_class, struct bt_ctf_field_type *packet_context_type, @@ -829,6 +822,7 @@ end: return ret; } +BT_EXPORT struct bt_ctf_clock *bt_ctf_stream_class_get_clock( struct bt_ctf_stream_class *stream_class) { @@ -854,6 +848,7 @@ end: return clock; } +BT_EXPORT int bt_ctf_stream_class_set_clock( struct bt_ctf_stream_class *stream_class, struct bt_ctf_clock *clock) @@ -894,7 +889,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_stream_class_serialize(struct bt_ctf_stream_class *stream_class, struct metadata_context *context) { @@ -1018,6 +1012,7 @@ end: return ret; } +BT_EXPORT struct bt_ctf_trace *bt_ctf_stream_class_get_trace( struct bt_ctf_stream_class *stream_class) { @@ -1025,12 +1020,14 @@ struct bt_ctf_trace *bt_ctf_stream_class_get_trace( BT_CTF_TO_COMMON(stream_class))); } +BT_EXPORT const char *bt_ctf_stream_class_get_name( struct bt_ctf_stream_class *stream_class) { return bt_ctf_stream_class_common_get_name(BT_CTF_TO_COMMON(stream_class)); } +BT_EXPORT int bt_ctf_stream_class_set_name( struct bt_ctf_stream_class *stream_class, const char *name) { @@ -1038,18 +1035,21 @@ int bt_ctf_stream_class_set_name( name); } +BT_EXPORT int64_t bt_ctf_stream_class_get_id( struct bt_ctf_stream_class *stream_class) { return bt_ctf_stream_class_common_get_id(BT_CTF_TO_COMMON(stream_class)); } +BT_EXPORT int bt_ctf_stream_class_set_id( struct bt_ctf_stream_class *stream_class, uint64_t id) { return bt_ctf_stream_class_common_set_id(BT_CTF_TO_COMMON(stream_class), id); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_stream_class_get_packet_context_type( struct bt_ctf_stream_class *stream_class) { @@ -1058,6 +1058,7 @@ struct bt_ctf_field_type *bt_ctf_stream_class_get_packet_context_type( BT_CTF_TO_COMMON(stream_class))); } +BT_EXPORT int bt_ctf_stream_class_set_packet_context_type( struct bt_ctf_stream_class *stream_class, struct bt_ctf_field_type *packet_context_type) @@ -1066,6 +1067,7 @@ int bt_ctf_stream_class_set_packet_context_type( BT_CTF_TO_COMMON(stream_class), (void *) packet_context_type); } +BT_EXPORT struct bt_ctf_field_type * bt_ctf_stream_class_get_event_header_type( struct bt_ctf_stream_class *stream_class) @@ -1075,6 +1077,7 @@ bt_ctf_stream_class_get_event_header_type( BT_CTF_TO_COMMON(stream_class))); } +BT_EXPORT int bt_ctf_stream_class_set_event_header_type( struct bt_ctf_stream_class *stream_class, struct bt_ctf_field_type *event_header_type) @@ -1083,6 +1086,7 @@ int bt_ctf_stream_class_set_event_header_type( BT_CTF_TO_COMMON(stream_class), (void *) event_header_type); } +BT_EXPORT struct bt_ctf_field_type * bt_ctf_stream_class_get_event_context_type( struct bt_ctf_stream_class *stream_class) @@ -1092,6 +1096,7 @@ bt_ctf_stream_class_get_event_context_type( BT_CTF_TO_COMMON(stream_class))); } +BT_EXPORT int bt_ctf_stream_class_set_event_context_type( struct bt_ctf_stream_class *stream_class, struct bt_ctf_field_type *event_context_type) @@ -1100,6 +1105,7 @@ int bt_ctf_stream_class_set_event_context_type( BT_CTF_TO_COMMON(stream_class), (void *) event_context_type); } +BT_EXPORT int64_t bt_ctf_stream_class_get_event_class_count( struct bt_ctf_stream_class *stream_class) { @@ -1107,6 +1113,7 @@ int64_t bt_ctf_stream_class_get_event_class_count( BT_CTF_TO_COMMON(stream_class)); } +BT_EXPORT struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class_by_index( struct bt_ctf_stream_class *stream_class, uint64_t index) { @@ -1115,6 +1122,7 @@ struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class_by_index( BT_CTF_TO_COMMON(stream_class), index)); } +BT_EXPORT struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class_by_id( struct bt_ctf_stream_class *stream_class, uint64_t id) { @@ -1123,6 +1131,7 @@ struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class_by_id( BT_CTF_TO_COMMON(stream_class), id)); } +BT_EXPORT int bt_ctf_stream_class_add_event_class( struct bt_ctf_stream_class *stream_class, struct bt_ctf_event_class *event_class) diff --git a/src/ctf-writer/stream-class.h b/src/ctf-writer/stream-class.h index 9cb78fe6..ab54ce73 100644 --- a/src/ctf-writer/stream-class.h +++ b/src/ctf-writer/stream-class.h @@ -70,14 +70,11 @@ struct bt_ctf_stream_class_common { struct bt_ctf_event_class_common; -BT_HIDDEN int bt_ctf_stream_class_common_initialize(struct bt_ctf_stream_class_common *stream_class, const char *name, bt_ctf_object_release_func release_func); -BT_HIDDEN void bt_ctf_stream_class_common_finalize(struct bt_ctf_stream_class_common *stream_class); -BT_HIDDEN void bt_ctf_stream_class_common_freeze(struct bt_ctf_stream_class_common *stream_class); static inline @@ -110,26 +107,21 @@ end: return ret; } -BT_HIDDEN void bt_ctf_stream_class_common_set_byte_order( struct bt_ctf_stream_class_common *stream_class, int byte_order); -BT_HIDDEN int bt_ctf_stream_class_common_validate_single_clock_class( struct bt_ctf_stream_class_common *stream_class, struct bt_ctf_clock_class **expected_clock_class); -BT_HIDDEN int bt_ctf_stream_class_common_add_event_class( struct bt_ctf_stream_class_common *stream_class, struct bt_ctf_event_class_common *event_class, bt_ctf_validation_flag_copy_field_type_func copy_field_type_func); -BT_HIDDEN int bt_ctf_stream_class_common_visit(struct bt_ctf_stream_class_common *stream_class, bt_ctf_visitor visitor, void *data); -BT_HIDDEN int bt_ctf_stream_class_visit(struct bt_ctf_stream_class *stream_class, bt_ctf_visitor visitor, void *data); @@ -508,11 +500,9 @@ struct bt_ctf_stream_class { struct metadata_context; -BT_HIDDEN int bt_ctf_stream_class_serialize(struct bt_ctf_stream_class *stream_class, struct metadata_context *context); -BT_HIDDEN int bt_ctf_stream_class_map_clock_class( struct bt_ctf_stream_class *stream_class, struct bt_ctf_field_type *packet_context_type, diff --git a/src/ctf-writer/stream.c b/src/ctf-writer/stream.c index 41da4c88..2242d977 100644 --- a/src/ctf-writer/stream.c +++ b/src/ctf-writer/stream.c @@ -33,7 +33,6 @@ #include "trace.h" #include "writer.h" -BT_HIDDEN void bt_ctf_stream_common_finalize(struct bt_ctf_stream_common *stream) { BT_LOGD("Finalizing common stream object: addr=%p, name=\"%s\"", @@ -44,7 +43,6 @@ void bt_ctf_stream_common_finalize(struct bt_ctf_stream_common *stream) } } -BT_HIDDEN int bt_ctf_stream_common_initialize( struct bt_ctf_stream_common *stream, struct bt_ctf_stream_class_common *stream_class, const char *name, @@ -1030,7 +1028,6 @@ end: return ret; } -BT_HIDDEN struct bt_ctf_stream *bt_ctf_stream_create_with_id( struct bt_ctf_stream_class *stream_class, const char *name, uint64_t id) @@ -1161,6 +1158,7 @@ end: return stream; } +BT_EXPORT struct bt_ctf_stream *bt_ctf_stream_create( struct bt_ctf_stream_class *stream_class, const char *name, uint64_t id_param) @@ -1169,6 +1167,7 @@ struct bt_ctf_stream *bt_ctf_stream_create( name, id_param); } +BT_EXPORT int bt_ctf_stream_get_discarded_events_count( struct bt_ctf_stream *stream, uint64_t *count) { @@ -1223,6 +1222,7 @@ end: return ret; } +BT_EXPORT void bt_ctf_stream_append_discarded_events(struct bt_ctf_stream *stream, uint64_t event_count) { @@ -1364,6 +1364,7 @@ end: return ret; } +BT_EXPORT int bt_ctf_stream_append_event(struct bt_ctf_stream *stream, struct bt_ctf_event *event) { @@ -1450,6 +1451,7 @@ error: return ret; } +BT_EXPORT struct bt_ctf_field *bt_ctf_stream_get_packet_context(struct bt_ctf_stream *stream) { struct bt_ctf_field *packet_context = NULL; @@ -1467,6 +1469,7 @@ end: return packet_context; } +BT_EXPORT int bt_ctf_stream_set_packet_context(struct bt_ctf_stream *stream, struct bt_ctf_field *field) { @@ -1503,6 +1506,7 @@ end: return ret; } +BT_EXPORT struct bt_ctf_field *bt_ctf_stream_get_packet_header(struct bt_ctf_stream *stream) { struct bt_ctf_field *packet_header = NULL; @@ -1520,6 +1524,7 @@ end: return packet_header; } +BT_EXPORT int bt_ctf_stream_set_packet_header(struct bt_ctf_stream *stream, struct bt_ctf_field *field) { @@ -1591,6 +1596,7 @@ void reset_structure_field(struct bt_ctf_field *structure, const char *name) } } +BT_EXPORT int bt_ctf_stream_flush(struct bt_ctf_stream *stream) { int ret = 0; @@ -1926,17 +1932,20 @@ int try_set_structure_field_integer(struct bt_ctf_field *structure, const char * return _set_structure_field_integer(structure, name, value, BT_CTF_FALSE); } +BT_EXPORT struct bt_ctf_stream_class *bt_ctf_stream_get_class( struct bt_ctf_stream *stream) { return bt_ctf_object_get_ref(bt_ctf_stream_common_borrow_class(BT_CTF_TO_COMMON(stream))); } +BT_EXPORT const char *bt_ctf_stream_get_name(struct bt_ctf_stream *stream) { return bt_ctf_stream_common_get_name(BT_CTF_TO_COMMON(stream)); } +BT_EXPORT int64_t bt_ctf_stream_get_id(struct bt_ctf_stream *stream) { return bt_ctf_stream_common_get_id(BT_CTF_TO_COMMON(stream)); diff --git a/src/ctf-writer/stream.h b/src/ctf-writer/stream.h index 3e45bbb7..605a3e55 100644 --- a/src/ctf-writer/stream.h +++ b/src/ctf-writer/stream.h @@ -30,13 +30,11 @@ struct bt_ctf_stream_common { GString *name; }; -BT_HIDDEN int bt_ctf_stream_common_initialize( struct bt_ctf_stream_common *stream, struct bt_ctf_stream_class_common *stream_class, const char *name, uint64_t id, bt_ctf_object_release_func release_func); -BT_HIDDEN void bt_ctf_stream_common_finalize(struct bt_ctf_stream_common *stream); static inline @@ -82,7 +80,6 @@ struct bt_ctf_stream { uint64_t last_ts_end; }; -BT_HIDDEN struct bt_ctf_stream *bt_ctf_stream_create_with_id( struct bt_ctf_stream_class *stream_class, const char *name, uint64_t id); diff --git a/src/ctf-writer/trace.c b/src/ctf-writer/trace.c index c6c5f8bd..ff13f9c3 100644 --- a/src/ctf-writer/trace.c +++ b/src/ctf-writer/trace.c @@ -43,7 +43,6 @@ #define DEFAULT_IDENTIFIER_SIZE 128 #define DEFAULT_METADATA_STRING_SIZE 4096 -BT_HIDDEN int bt_ctf_trace_common_initialize(struct bt_ctf_trace_common *trace, bt_ctf_object_release_func release_func) { @@ -90,7 +89,6 @@ end: return ret; } -BT_HIDDEN void bt_ctf_trace_common_finalize(struct bt_ctf_trace_common *trace) { BT_LOGD("Finalizing common trace object: addr=%p, name=\"%s\"", @@ -124,7 +122,6 @@ void bt_ctf_trace_common_finalize(struct bt_ctf_trace_common *trace) bt_ctf_object_put_ref(trace->packet_header_field_type); } -BT_HIDDEN int bt_ctf_trace_common_set_name(struct bt_ctf_trace_common *trace, const char *name) { int ret = 0; @@ -163,7 +160,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_trace_common_set_uuid(struct bt_ctf_trace_common *trace, const uint8_t *uuid) { @@ -200,7 +196,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_trace_common_set_environment_field(struct bt_ctf_trace_common *trace, const char *name, struct bt_ctf_private_value *value) { @@ -287,7 +282,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_trace_common_set_environment_field_string(struct bt_ctf_trace_common *trace, const char *name, const char *value) { @@ -316,7 +310,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_trace_common_set_environment_field_integer( struct bt_ctf_trace_common *trace, const char *name, int64_t value) { @@ -339,7 +332,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_trace_common_add_clock_class(struct bt_ctf_trace_common *trace, struct bt_ctf_clock_class *clock_class) { @@ -860,7 +852,6 @@ int check_packet_header_type_has_no_clock_class(struct bt_ctf_trace_common *trac return ret; } -BT_HIDDEN int bt_ctf_trace_common_add_stream_class(struct bt_ctf_trace_common *trace, struct bt_ctf_stream_class_common *stream_class, bt_ctf_validation_flag_copy_field_type_func copy_field_type_func, @@ -1242,7 +1233,6 @@ end: return ret; } -BT_HIDDEN bt_ctf_bool bt_ctf_trace_common_has_clock_class(struct bt_ctf_trace_common *trace, struct bt_ctf_clock_class *clock_class) { @@ -1255,7 +1245,6 @@ bt_ctf_bool bt_ctf_trace_common_has_clock_class(struct bt_ctf_trace_common *trac return query.found; } -BT_HIDDEN int bt_ctf_trace_common_set_native_byte_order(struct bt_ctf_trace_common *trace, enum bt_ctf_byte_order byte_order, bool allow_unspecified) { @@ -1304,7 +1293,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_trace_common_set_packet_header_field_type(struct bt_ctf_trace_common *trace, struct bt_ctf_field_type_common *packet_header_type) { @@ -1405,7 +1393,6 @@ void bt_ctf_trace_destroy(struct bt_ctf_object *obj) g_free(trace); } -BT_HIDDEN struct bt_ctf_trace *bt_ctf_trace_create(void) { struct bt_ctf_trace *trace = NULL; @@ -1433,17 +1420,20 @@ error: return trace; } +BT_EXPORT const uint8_t *bt_ctf_trace_get_uuid(struct bt_ctf_trace *trace) { return bt_ctf_trace_common_get_uuid(BT_CTF_TO_COMMON(trace)); } +BT_EXPORT int bt_ctf_trace_set_uuid(struct bt_ctf_trace *trace, const uint8_t *uuid) { return bt_ctf_trace_common_set_uuid(BT_CTF_TO_COMMON(trace), uuid); } +BT_EXPORT int bt_ctf_trace_set_environment_field_string(struct bt_ctf_trace *trace, const char *name, const char *value) { @@ -1451,6 +1441,7 @@ int bt_ctf_trace_set_environment_field_string(struct bt_ctf_trace *trace, name, value); } +BT_EXPORT int bt_ctf_trace_set_environment_field_integer( struct bt_ctf_trace *trace, const char *name, int64_t value) { @@ -1485,7 +1476,6 @@ struct bt_ctf_value *bt_ctf_trace_get_environment_field_value_by_name( BT_CTF_TO_COMMON(trace), name)); } -BT_HIDDEN int bt_ctf_trace_add_clock_class(struct bt_ctf_trace *trace, struct bt_ctf_clock_class *clock_class) { @@ -1493,13 +1483,11 @@ int bt_ctf_trace_add_clock_class(struct bt_ctf_trace *trace, (void *) clock_class); } -BT_HIDDEN int64_t bt_ctf_trace_get_clock_class_count(struct bt_ctf_trace *trace) { return bt_ctf_trace_common_get_clock_class_count(BT_CTF_TO_COMMON(trace)); } -BT_HIDDEN struct bt_ctf_clock_class *bt_ctf_trace_get_clock_class_by_index( struct bt_ctf_trace *trace, uint64_t index) { @@ -1524,6 +1512,7 @@ int map_clock_classes_func(struct bt_ctf_stream_class_common *stream_class, return ret; } +BT_EXPORT int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace, struct bt_ctf_stream_class *stream_class) { @@ -1612,11 +1601,13 @@ end: return ret; } +BT_EXPORT int64_t bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace) { return bt_ctf_trace_common_get_stream_count(BT_CTF_TO_COMMON(trace)); } +BT_EXPORT struct bt_ctf_stream *bt_ctf_trace_get_stream_by_index( struct bt_ctf_trace *trace, uint64_t index) { @@ -1624,11 +1615,13 @@ struct bt_ctf_stream *bt_ctf_trace_get_stream_by_index( BT_CTF_TO_COMMON(trace), index)); } +BT_EXPORT int64_t bt_ctf_trace_get_stream_class_count(struct bt_ctf_trace *trace) { return bt_ctf_trace_common_get_stream_class_count(BT_CTF_TO_COMMON(trace)); } +BT_EXPORT struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_index( struct bt_ctf_trace *trace, uint64_t index) { @@ -1636,6 +1629,7 @@ struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_index( BT_CTF_TO_COMMON(trace), index)); } +BT_EXPORT struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_id( struct bt_ctf_trace *trace, uint64_t id) { @@ -1643,7 +1637,6 @@ struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_id( BT_CTF_TO_COMMON(trace), id)); } -BT_HIDDEN struct bt_ctf_clock_class *bt_ctf_trace_get_clock_class_by_name( struct bt_ctf_trace *trace, const char *name) { @@ -1822,12 +1815,14 @@ end: return metadata; } +BT_EXPORT enum bt_ctf_byte_order bt_ctf_trace_get_native_byte_order( struct bt_ctf_trace *trace) { return (int) bt_ctf_trace_common_get_native_byte_order(BT_CTF_TO_COMMON(trace)); } +BT_EXPORT int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace, enum bt_ctf_byte_order byte_order) { @@ -1835,6 +1830,7 @@ int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace, (int) byte_order, false); } +BT_EXPORT struct bt_ctf_field_type *bt_ctf_trace_get_packet_header_field_type( struct bt_ctf_trace *trace) { @@ -1842,6 +1838,7 @@ struct bt_ctf_field_type *bt_ctf_trace_get_packet_header_field_type( BT_CTF_TO_COMMON(trace))); } +BT_EXPORT int bt_ctf_trace_set_packet_header_field_type(struct bt_ctf_trace *trace, struct bt_ctf_field_type *packet_header_type) { @@ -1849,6 +1846,7 @@ int bt_ctf_trace_set_packet_header_field_type(struct bt_ctf_trace *trace, (void *) packet_header_type); } +BT_EXPORT const char *bt_ctf_trace_get_name(struct bt_ctf_trace *trace) { return bt_ctf_trace_common_get_name(BT_CTF_TO_COMMON(trace)); diff --git a/src/ctf-writer/trace.h b/src/ctf-writer/trace.h index 7fe067d2..a12ff1e6 100644 --- a/src/ctf-writer/trace.h +++ b/src/ctf-writer/trace.h @@ -48,15 +48,12 @@ struct bt_ctf_trace_common { int valid; }; -BT_HIDDEN bt_ctf_bool bt_ctf_trace_common_has_clock_class(struct bt_ctf_trace_common *trace, struct bt_ctf_clock_class *clock_class); -BT_HIDDEN int bt_ctf_trace_common_initialize(struct bt_ctf_trace_common *trace, bt_ctf_object_release_func release_func); -BT_HIDDEN void bt_ctf_trace_common_finalize(struct bt_ctf_trace_common *trace); static inline @@ -66,7 +63,6 @@ const char *bt_ctf_trace_common_get_name(struct bt_ctf_trace_common *trace) return trace->name ? trace->name->str : NULL; } -BT_HIDDEN int bt_ctf_trace_common_set_name(struct bt_ctf_trace_common *trace, const char *name); static inline @@ -76,18 +72,14 @@ const uint8_t *bt_ctf_trace_common_get_uuid(struct bt_ctf_trace_common *trace) return trace->uuid_set ? trace->uuid : NULL; } -BT_HIDDEN int bt_ctf_trace_common_set_uuid(struct bt_ctf_trace_common *trace, const uint8_t *uuid); -BT_HIDDEN int bt_ctf_trace_common_set_environment_field(struct bt_ctf_trace_common *trace, const char *name, struct bt_ctf_private_value *value); -BT_HIDDEN int bt_ctf_trace_common_set_environment_field_string(struct bt_ctf_trace_common *trace, const char *name, const char *value); -BT_HIDDEN int bt_ctf_trace_common_set_environment_field_integer(struct bt_ctf_trace_common *trace, const char *name, int64_t value); @@ -132,7 +124,6 @@ bt_ctf_trace_common_borrow_environment_field_value_by_name( name); } -BT_HIDDEN int bt_ctf_trace_common_add_clock_class(struct bt_ctf_trace_common *trace, struct bt_ctf_clock_class *clock_class); @@ -260,7 +251,6 @@ enum bt_ctf_byte_order bt_ctf_trace_common_get_native_byte_order( return trace->native_byte_order; } -BT_HIDDEN int bt_ctf_trace_common_set_native_byte_order(struct bt_ctf_trace_common *trace, enum bt_ctf_byte_order byte_order, bool allow_unspecified); @@ -272,7 +262,6 @@ struct bt_ctf_field_type_common *bt_ctf_trace_common_borrow_packet_header_field_ return trace->packet_header_field_type; } -BT_HIDDEN int bt_ctf_trace_common_set_packet_header_field_type(struct bt_ctf_trace_common *trace, struct bt_ctf_field_type_common *packet_header_field_type); @@ -306,7 +295,6 @@ void bt_ctf_trace_common_freeze(struct bt_ctf_trace_common *trace) trace->frozen = 1; } -BT_HIDDEN int bt_ctf_trace_common_add_stream_class(struct bt_ctf_trace_common *trace, struct bt_ctf_stream_class_common *stream_class, bt_ctf_validation_flag_copy_field_type_func copy_field_type_func, @@ -330,47 +318,36 @@ struct bt_ctf_trace { * * Returns the metadata string on success, NULL on error. */ -BT_HIDDEN char *bt_ctf_trace_get_metadata_string(struct bt_ctf_trace *trace); -BT_HIDDEN struct bt_ctf_trace *bt_ctf_trace_create(void); -BT_HIDDEN int64_t bt_ctf_trace_get_clock_class_count( struct bt_ctf_trace *trace); -BT_HIDDEN struct bt_ctf_clock_class *bt_ctf_trace_get_clock_class_by_index( struct bt_ctf_trace *trace, uint64_t index); -BT_HIDDEN struct bt_ctf_clock_class *bt_ctf_trace_get_clock_class_by_name( struct bt_ctf_trace *trace, const char *name); -BT_HIDDEN int bt_ctf_trace_add_clock_class(struct bt_ctf_trace *trace, struct bt_ctf_clock_class *clock_class); -BT_HIDDEN int64_t bt_ctf_trace_get_environment_field_count( struct bt_ctf_trace *trace); -BT_HIDDEN const char *bt_ctf_trace_get_environment_field_name_by_index( struct bt_ctf_trace *trace, uint64_t index); -BT_HIDDEN struct bt_ctf_value * bt_ctf_trace_get_environment_field_value_by_index(struct bt_ctf_trace *trace, uint64_t index); -BT_HIDDEN struct bt_ctf_value * bt_ctf_trace_get_environment_field_value_by_name( struct bt_ctf_trace *trace, const char *name); -BT_HIDDEN int bt_ctf_trace_visit(struct bt_ctf_trace *trace, bt_ctf_visitor visitor, void *data); diff --git a/src/ctf-writer/utils.c b/src/ctf-writer/utils.c index 6c4b0ed8..781aa67c 100644 --- a/src/ctf-writer/utils.c +++ b/src/ctf-writer/utils.c @@ -62,6 +62,7 @@ void trace_finalize(void) } } +BT_EXPORT bt_ctf_bool bt_ctf_identifier_is_valid(const char *identifier) { bt_ctf_bool is_valid = BT_CTF_TRUE; diff --git a/src/ctf-writer/validation.c b/src/ctf-writer/validation.c index 86d68626..13fd9eb8 100644 --- a/src/ctf-writer/validation.c +++ b/src/ctf-writer/validation.c @@ -245,7 +245,6 @@ end: return ret; } -BT_HIDDEN int bt_ctf_validate_class_types(struct bt_ctf_private_value *environment, struct bt_ctf_field_type_common *packet_header_type, struct bt_ctf_field_type_common *packet_context_type, @@ -590,7 +589,6 @@ error: return ret; } -BT_HIDDEN void bt_ctf_validation_replace_types(struct bt_ctf_trace_common *trace, struct bt_ctf_stream_class_common *stream_class, struct bt_ctf_event_class_common *event_class, @@ -623,7 +621,6 @@ void bt_ctf_validation_replace_types(struct bt_ctf_trace_common *trace, } } -BT_HIDDEN void bt_ctf_validation_output_put_types( struct bt_ctf_validation_output *output) { diff --git a/src/ctf-writer/validation.h b/src/ctf-writer/validation.h index 7434c42b..fef42a6d 100644 --- a/src/ctf-writer/validation.h +++ b/src/ctf-writer/validation.h @@ -64,7 +64,6 @@ struct bt_ctf_validation_output { * * All parameters are owned by the caller. */ -BT_HIDDEN int bt_ctf_validate_class_types(struct bt_ctf_private_value *environment, struct bt_ctf_field_type_common *packet_header_type, struct bt_ctf_field_type_common *packet_context_type, @@ -92,7 +91,6 @@ int bt_ctf_validate_class_types(struct bt_ctf_private_value *environment, * * All parameters are owned by the caller. */ -BT_HIDDEN void bt_ctf_validation_replace_types(struct bt_ctf_trace_common *trace, struct bt_ctf_stream_class_common *stream_class, struct bt_ctf_event_class_common *event_class, @@ -105,7 +103,6 @@ void bt_ctf_validation_replace_types(struct bt_ctf_trace_common *trace, * * `output` is owned by the caller and is not freed here. */ -BT_HIDDEN void bt_ctf_validation_output_put_types( struct bt_ctf_validation_output *output); diff --git a/src/ctf-writer/values.c b/src/ctf-writer/values.c index 3eeed2d3..f6cc21b0 100644 --- a/src/ctf-writer/values.c +++ b/src/ctf-writer/values.c @@ -70,7 +70,10 @@ struct bt_ctf_value bt_ctf_value_null_instance = { .frozen = BT_CTF_TRUE, }; +BT_EXPORT struct bt_ctf_value *const bt_ctf_value_null = &bt_ctf_value_null_instance; + +BT_EXPORT struct bt_ctf_private_value *const bt_ctf_private_value_null = (void *) &bt_ctf_value_null_instance; @@ -545,7 +548,6 @@ void bt_ctf_value_destroy(struct bt_ctf_object *obj) g_free(value); } -BT_HIDDEN enum bt_ctf_value_status _bt_ctf_value_freeze(struct bt_ctf_value *object) { enum bt_ctf_value_status ret = BT_CTF_VALUE_STATUS_OK; @@ -563,7 +565,6 @@ end: return ret; } -BT_HIDDEN enum bt_ctf_value_type bt_ctf_value_get_type(const struct bt_ctf_value *object) { BT_CTF_ASSERT_PRE_NON_NULL(object, "Value object"); @@ -581,7 +582,6 @@ struct bt_ctf_value bt_ctf_value_create_base(enum bt_ctf_value_type type) return value; } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_bool_create_init(bt_ctf_bool val) { struct bt_ctf_value_bool *bool_obj; @@ -601,13 +601,11 @@ end: return (void *) BT_CTF_VALUE_FROM_CONCRETE(bool_obj); } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_bool_create(void) { return bt_ctf_private_value_bool_create_init(BT_CTF_FALSE); } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_integer_create_init(int64_t val) { struct bt_ctf_value_integer *integer_obj; @@ -628,13 +626,11 @@ end: return (void *) BT_CTF_VALUE_FROM_CONCRETE(integer_obj); } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_integer_create(void) { return bt_ctf_private_value_integer_create_init(0); } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_real_create_init(double val) { struct bt_ctf_value_real *real_obj; @@ -655,13 +651,11 @@ end: return (void *) BT_CTF_VALUE_FROM_CONCRETE(real_obj); } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_real_create(void) { return bt_ctf_private_value_real_create_init(0.); } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_string_create_init(const char *val) { struct bt_ctf_value_string *string_obj = NULL; @@ -694,13 +688,11 @@ end: return (void *) BT_CTF_VALUE_FROM_CONCRETE(string_obj); } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_string_create(void) { return bt_ctf_private_value_string_create_init(""); } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_array_create(void) { struct bt_ctf_value_array *array_obj; @@ -729,7 +721,6 @@ end: return (void *) BT_CTF_VALUE_FROM_CONCRETE(array_obj); } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_map_create(void) { struct bt_ctf_value_map *map_obj; @@ -758,7 +749,6 @@ end: return (void *) BT_CTF_VALUE_FROM_CONCRETE(map_obj); } -BT_HIDDEN bt_ctf_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj) { BT_CTF_ASSERT_PRE_NON_NULL(bool_obj, "Value object"); @@ -766,7 +756,6 @@ bt_ctf_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj) return BT_CTF_VALUE_TO_BOOL(bool_obj)->value; } -BT_HIDDEN void bt_ctf_private_value_bool_set(struct bt_ctf_private_value *bool_obj, bt_ctf_bool val) { BT_CTF_ASSERT_PRE_NON_NULL(bool_obj, "Value object"); @@ -777,7 +766,6 @@ void bt_ctf_private_value_bool_set(struct bt_ctf_private_value *bool_obj, bt_ctf bool_obj, val); } -BT_HIDDEN int64_t bt_ctf_value_integer_get(const struct bt_ctf_value *integer_obj) { BT_CTF_ASSERT_PRE_NON_NULL(integer_obj, "Value object"); @@ -785,7 +773,6 @@ int64_t bt_ctf_value_integer_get(const struct bt_ctf_value *integer_obj) return BT_CTF_VALUE_TO_INTEGER(integer_obj)->value; } -BT_HIDDEN void bt_ctf_private_value_integer_set(struct bt_ctf_private_value *integer_obj, int64_t val) { @@ -797,7 +784,6 @@ void bt_ctf_private_value_integer_set(struct bt_ctf_private_value *integer_obj, integer_obj, val); } -BT_HIDDEN double bt_ctf_value_real_get(const struct bt_ctf_value *real_obj) { BT_CTF_ASSERT_PRE_NON_NULL(real_obj, "Value object"); @@ -805,7 +791,6 @@ double bt_ctf_value_real_get(const struct bt_ctf_value *real_obj) return BT_CTF_VALUE_TO_REAL(real_obj)->value; } -BT_HIDDEN void bt_ctf_private_value_real_set(struct bt_ctf_private_value *real_obj, double val) { BT_CTF_ASSERT_PRE_NON_NULL(real_obj, "Value object"); @@ -816,7 +801,6 @@ void bt_ctf_private_value_real_set(struct bt_ctf_private_value *real_obj, double real_obj, val); } -BT_HIDDEN const char *bt_ctf_value_string_get(const struct bt_ctf_value *string_obj) { BT_CTF_ASSERT_PRE_NON_NULL(string_obj, "Value object"); @@ -824,7 +808,6 @@ const char *bt_ctf_value_string_get(const struct bt_ctf_value *string_obj) return BT_CTF_VALUE_TO_STRING(string_obj)->gstr->str; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_string_set( struct bt_ctf_private_value *string_obj, const char *val) { @@ -837,7 +820,6 @@ enum bt_ctf_value_status bt_ctf_private_value_string_set( return BT_CTF_VALUE_STATUS_OK; } -BT_HIDDEN uint64_t bt_ctf_value_array_get_length(const struct bt_ctf_value *array_obj) { BT_CTF_ASSERT_PRE_NON_NULL(array_obj, "Value object"); @@ -845,7 +827,6 @@ uint64_t bt_ctf_value_array_get_length(const struct bt_ctf_value *array_obj) return (uint64_t) BT_CTF_VALUE_TO_ARRAY(array_obj)->garray->len; } -BT_HIDDEN struct bt_ctf_value *bt_ctf_value_array_borrow_element_by_index( const struct bt_ctf_value *array_obj, uint64_t index) @@ -860,7 +841,6 @@ struct bt_ctf_value *bt_ctf_value_array_borrow_element_by_index( return g_ptr_array_index(typed_array_obj->garray, index); } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_array_borrow_element_by_index( const struct bt_ctf_private_value *array_obj, uint64_t index) @@ -869,7 +849,6 @@ struct bt_ctf_private_value *bt_ctf_private_value_array_borrow_element_by_index( (void *) array_obj, index); } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_element( struct bt_ctf_private_value *array_obj, struct bt_ctf_value *element_obj) @@ -889,7 +868,6 @@ enum bt_ctf_value_status bt_ctf_private_value_array_append_element( return BT_CTF_VALUE_STATUS_OK; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_bool_element( struct bt_ctf_private_value *array_obj, bt_ctf_bool val) { @@ -903,7 +881,6 @@ enum bt_ctf_value_status bt_ctf_private_value_array_append_bool_element( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_integer_element( struct bt_ctf_private_value *array_obj, int64_t val) { @@ -917,7 +894,6 @@ enum bt_ctf_value_status bt_ctf_private_value_array_append_integer_element( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_real_element( struct bt_ctf_private_value *array_obj, double val) { @@ -931,7 +907,6 @@ enum bt_ctf_value_status bt_ctf_private_value_array_append_real_element( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_string_element( struct bt_ctf_private_value *array_obj, const char *val) { @@ -945,7 +920,6 @@ enum bt_ctf_value_status bt_ctf_private_value_array_append_string_element( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_empty_array_element( struct bt_ctf_private_value *array_obj) { @@ -959,7 +933,6 @@ enum bt_ctf_value_status bt_ctf_private_value_array_append_empty_array_element( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_empty_map_element( struct bt_ctf_private_value *array_obj) { @@ -973,7 +946,6 @@ enum bt_ctf_value_status bt_ctf_private_value_array_append_empty_map_element( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_set_element_by_index( struct bt_ctf_private_value *array_obj, uint64_t index, struct bt_ctf_value *element_obj) @@ -996,7 +968,6 @@ enum bt_ctf_value_status bt_ctf_private_value_array_set_element_by_index( return BT_CTF_VALUE_STATUS_OK; } -BT_HIDDEN uint64_t bt_ctf_value_map_get_size(const struct bt_ctf_value *map_obj) { BT_CTF_ASSERT_PRE_NON_NULL(map_obj, "Value object"); @@ -1004,7 +975,6 @@ uint64_t bt_ctf_value_map_get_size(const struct bt_ctf_value *map_obj) return (uint64_t) g_hash_table_size(BT_CTF_VALUE_TO_MAP(map_obj)->ght); } -BT_HIDDEN struct bt_ctf_value *bt_ctf_value_map_borrow_entry_value(const struct bt_ctf_value *map_obj, const char *key) { @@ -1015,14 +985,12 @@ struct bt_ctf_value *bt_ctf_value_map_borrow_entry_value(const struct bt_ctf_val GUINT_TO_POINTER(g_quark_from_string(key))); } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_map_borrow_entry_value( const struct bt_ctf_private_value *map_obj, const char *key) { return (void *) bt_ctf_value_map_borrow_entry_value((void *) map_obj, key); } -BT_HIDDEN bt_ctf_bool bt_ctf_value_map_has_entry(const struct bt_ctf_value *map_obj, const char *key) { BT_CTF_ASSERT_PRE_NON_NULL(map_obj, "Value object"); @@ -1032,7 +1000,6 @@ bt_ctf_bool bt_ctf_value_map_has_entry(const struct bt_ctf_value *map_obj, const GUINT_TO_POINTER(g_quark_from_string(key))); } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_entry( struct bt_ctf_private_value *map_obj, const char *key, struct bt_ctf_value *element_obj) @@ -1051,7 +1018,6 @@ enum bt_ctf_value_status bt_ctf_private_value_map_insert_entry( return BT_CTF_VALUE_STATUS_OK; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_bool_entry( struct bt_ctf_private_value *map_obj, const char *key, bt_ctf_bool val) { @@ -1065,7 +1031,6 @@ enum bt_ctf_value_status bt_ctf_private_value_map_insert_bool_entry( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_integer_entry( struct bt_ctf_private_value *map_obj, const char *key, int64_t val) { @@ -1079,7 +1044,6 @@ enum bt_ctf_value_status bt_ctf_private_value_map_insert_integer_entry( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_real_entry( struct bt_ctf_private_value *map_obj, const char *key, double val) { @@ -1093,7 +1057,6 @@ enum bt_ctf_value_status bt_ctf_private_value_map_insert_real_entry( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_string_entry( struct bt_ctf_private_value *map_obj, const char *key, const char *val) @@ -1108,7 +1071,6 @@ enum bt_ctf_value_status bt_ctf_private_value_map_insert_string_entry( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_empty_array_entry( struct bt_ctf_private_value *map_obj, const char *key) { @@ -1122,7 +1084,6 @@ enum bt_ctf_value_status bt_ctf_private_value_map_insert_empty_array_entry( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_empty_map_entry( struct bt_ctf_private_value *map_obj, const char *key) { @@ -1136,7 +1097,6 @@ enum bt_ctf_value_status bt_ctf_private_value_map_insert_empty_map_entry( return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_value_map_foreach_entry(const struct bt_ctf_value *map_obj, bt_ctf_value_map_foreach_entry_cb cb, void *data) { @@ -1165,7 +1125,6 @@ enum bt_ctf_value_status bt_ctf_value_map_foreach_entry(const struct bt_ctf_valu return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_foreach_entry( const struct bt_ctf_private_value *map_obj, bt_ctf_private_value_map_foreach_entry_cb cb, void *data) @@ -1221,7 +1180,6 @@ end: return ret; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_value_map_extend( struct bt_ctf_private_value **extended_map_obj, const struct bt_ctf_value *base_map_obj, @@ -1283,7 +1241,6 @@ end: return extend_data.status; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_value_copy(struct bt_ctf_private_value **copy_obj, const struct bt_ctf_value *object) { @@ -1305,7 +1262,6 @@ enum bt_ctf_value_status bt_ctf_value_copy(struct bt_ctf_private_value **copy_ob return status; } -BT_HIDDEN bt_ctf_bool bt_ctf_value_compare(const struct bt_ctf_value *object_a, const struct bt_ctf_value *object_b) { diff --git a/src/ctf-writer/values.h b/src/ctf-writer/values.h index 44061932..ad29a9fb 100644 --- a/src/ctf-writer/values.h +++ b/src/ctf-writer/values.h @@ -29,7 +29,6 @@ enum bt_ctf_value_status { BT_CTF_VALUE_STATUS_OK = 0, }; -BT_HIDDEN enum bt_ctf_value_status _bt_ctf_value_freeze(struct bt_ctf_value *object); #ifdef BT_DEV_MODE @@ -63,7 +62,6 @@ enum bt_ctf_value_type { BT_CTF_VALUE_TYPE_MAP = 6, }; -BT_HIDDEN enum bt_ctf_value_type bt_ctf_value_get_type(const struct bt_ctf_value *object); static inline @@ -108,27 +106,20 @@ bt_ctf_bool bt_ctf_value_is_map(const struct bt_ctf_value *object) return bt_ctf_value_get_type(object) == BT_CTF_VALUE_TYPE_MAP; } -BT_HIDDEN enum bt_ctf_value_status bt_ctf_value_copy(struct bt_ctf_private_value **copy, const struct bt_ctf_value *object); -BT_HIDDEN bt_ctf_bool bt_ctf_value_compare(const struct bt_ctf_value *object_a, const struct bt_ctf_value *object_b); -BT_HIDDEN bt_ctf_bool bt_ctf_value_bool_get(const struct bt_ctf_value *bool_obj); -BT_HIDDEN int64_t bt_ctf_value_integer_get(const struct bt_ctf_value *integer_obj); -BT_HIDDEN double bt_ctf_value_real_get(const struct bt_ctf_value *real_obj); -BT_HIDDEN const char *bt_ctf_value_string_get(const struct bt_ctf_value *string_obj); -BT_HIDDEN uint64_t bt_ctf_value_array_get_length(const struct bt_ctf_value *array_obj); static inline @@ -137,11 +128,9 @@ bt_ctf_bool bt_ctf_value_array_is_empty(const struct bt_ctf_value *array_obj) return bt_ctf_value_array_get_length(array_obj) == 0; } -BT_HIDDEN struct bt_ctf_value *bt_ctf_value_array_borrow_element_by_index( const struct bt_ctf_value *array_obj, uint64_t index); -BT_HIDDEN uint64_t bt_ctf_value_map_get_size(const struct bt_ctf_value *map_obj); static inline @@ -150,23 +139,19 @@ bt_ctf_bool bt_ctf_value_map_is_empty(const struct bt_ctf_value *map_obj) return bt_ctf_value_map_get_size(map_obj) == 0; } -BT_HIDDEN struct bt_ctf_value *bt_ctf_value_map_borrow_entry_value( const struct bt_ctf_value *map_obj, const char *key); typedef bt_ctf_bool (* bt_ctf_value_map_foreach_entry_cb)(const char *key, struct bt_ctf_value *object, void *data); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_value_map_foreach_entry( const struct bt_ctf_value *map_obj, bt_ctf_value_map_foreach_entry_cb cb, void *data); -BT_HIDDEN bt_ctf_bool bt_ctf_value_map_has_entry(const struct bt_ctf_value *map_obj, const char *key); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_value_map_extend( struct bt_ctf_private_value **extended_map_obj, const struct bt_ctf_value *base_map_obj, @@ -185,135 +170,103 @@ struct bt_ctf_value *bt_ctf_private_value_as_value( return (void *) priv_value; } -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_bool_create(void); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_bool_create_init(bt_ctf_bool val); -BT_HIDDEN void bt_ctf_private_value_bool_set(struct bt_ctf_private_value *bool_obj, bt_ctf_bool val); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_integer_create(void); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_integer_create_init( int64_t val); -BT_HIDDEN void bt_ctf_private_value_integer_set( struct bt_ctf_private_value *integer_obj, int64_t val); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_real_create(void); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_real_create_init(double val); -BT_HIDDEN void bt_ctf_private_value_real_set( struct bt_ctf_private_value *real_obj, double val); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_string_create(void); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_string_create_init( const char *val); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_string_set( struct bt_ctf_private_value *string_obj, const char *val); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_array_create(void); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_array_borrow_element_by_index( const struct bt_ctf_private_value *array_obj, uint64_t index); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_element( struct bt_ctf_private_value *array_obj, struct bt_ctf_value *element_obj); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_bool_element( struct bt_ctf_private_value *array_obj, bt_ctf_bool val); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_integer_element( struct bt_ctf_private_value *array_obj, int64_t val); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_real_element( struct bt_ctf_private_value *array_obj, double val); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_string_element( struct bt_ctf_private_value *array_obj, const char *val); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_empty_array_element( struct bt_ctf_private_value *array_obj); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_append_empty_map_element( struct bt_ctf_private_value *array_obj); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_array_set_element_by_index( struct bt_ctf_private_value *array_obj, uint64_t index, struct bt_ctf_value *element_obj); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_map_create(void); -BT_HIDDEN struct bt_ctf_private_value *bt_ctf_private_value_map_borrow_entry_value( const struct bt_ctf_private_value *map_obj, const char *key); typedef bt_ctf_bool (* bt_ctf_private_value_map_foreach_entry_cb)(const char *key, struct bt_ctf_private_value *object, void *data); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_foreach_entry( const struct bt_ctf_private_value *map_obj, bt_ctf_private_value_map_foreach_entry_cb cb, void *data); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_entry( struct bt_ctf_private_value *map_obj, const char *key, struct bt_ctf_value *element_obj); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_bool_entry( struct bt_ctf_private_value *map_obj, const char *key, bt_ctf_bool val); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_integer_entry( struct bt_ctf_private_value *map_obj, const char *key, int64_t val); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_real_entry( struct bt_ctf_private_value *map_obj, const char *key, double val); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_string_entry( struct bt_ctf_private_value *map_obj, const char *key, const char *val); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_empty_array_entry( struct bt_ctf_private_value *map_obj, const char *key); -BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_empty_map_entry( struct bt_ctf_private_value *map_obj, const char *key); diff --git a/src/ctf-writer/visitor.c b/src/ctf-writer/visitor.c index 711a03dd..573dfe45 100644 --- a/src/ctf-writer/visitor.c +++ b/src/ctf-writer/visitor.c @@ -12,7 +12,6 @@ #include "visitor.h" -BT_HIDDEN int bt_ctf_visitor_helper(struct bt_ctf_visitor_object *root, bt_ctf_child_count_accessor child_counter, bt_ctf_child_accessor child_accessor, @@ -51,6 +50,7 @@ end: return ret; } +BT_EXPORT enum bt_ctf_visitor_object_type bt_ctf_visitor_object_get_type( struct bt_ctf_visitor_object *object) { @@ -65,6 +65,7 @@ end: return ret; } +BT_EXPORT void *bt_ctf_visitor_object_get_object(struct bt_ctf_visitor_object *object) { void *ret = NULL; diff --git a/src/ctf-writer/visitor.h b/src/ctf-writer/visitor.h index c0007111..bdbf2283 100644 --- a/src/ctf-writer/visitor.h +++ b/src/ctf-writer/visitor.h @@ -22,7 +22,6 @@ struct bt_ctf_visitor_object { void *object; }; -BT_HIDDEN int bt_ctf_visitor_helper(struct bt_ctf_visitor_object *root, bt_ctf_child_count_accessor child_counter, bt_ctf_child_accessor child_accessor, diff --git a/src/ctf-writer/writer.c b/src/ctf-writer/writer.c index 9b969dd0..c3b83c48 100644 --- a/src/ctf-writer/writer.c +++ b/src/ctf-writer/writer.c @@ -85,6 +85,7 @@ end: return ret; } +BT_EXPORT struct bt_ctf_writer *bt_ctf_writer_create(const char *path) { int ret; @@ -158,6 +159,7 @@ error: return writer; } +BT_EXPORT void bt_ctf_writer_destroy(struct bt_ctf_object *obj) { struct bt_ctf_writer *writer; @@ -178,6 +180,7 @@ void bt_ctf_writer_destroy(struct bt_ctf_object *obj) g_free(writer); } +BT_EXPORT struct bt_ctf_trace *bt_ctf_writer_get_trace(struct bt_ctf_writer *writer) { struct bt_ctf_trace *trace = NULL; @@ -192,6 +195,7 @@ end: return trace; } +BT_EXPORT struct bt_ctf_stream *bt_ctf_writer_create_stream(struct bt_ctf_writer *writer, struct bt_ctf_stream_class *stream_class) { @@ -247,6 +251,7 @@ error: return stream; } +BT_EXPORT int bt_ctf_writer_add_environment_field(struct bt_ctf_writer *writer, const char *name, const char *value) @@ -263,6 +268,7 @@ end: return ret; } +BT_EXPORT int bt_ctf_writer_add_environment_field_int64(struct bt_ctf_writer *writer, const char *name, int64_t value) { @@ -278,6 +284,7 @@ end: return ret; } +BT_EXPORT int bt_ctf_writer_add_clock(struct bt_ctf_writer *writer, struct bt_ctf_clock *clock) { @@ -292,6 +299,7 @@ end: return ret; } +BT_EXPORT char *bt_ctf_writer_get_metadata_string(struct bt_ctf_writer *writer) { char *metadata_string = NULL; @@ -306,6 +314,7 @@ end: return metadata_string; } +BT_EXPORT void bt_ctf_writer_flush_metadata(struct bt_ctf_writer *writer) { int ret; @@ -341,6 +350,7 @@ end: g_free(metadata_string); } +BT_EXPORT int bt_ctf_writer_set_byte_order(struct bt_ctf_writer *writer, enum bt_ctf_byte_order byte_order) { @@ -365,7 +375,6 @@ end: return ret; } -BT_HIDDEN void bt_ctf_writer_freeze(struct bt_ctf_writer *writer) { writer->frozen = 1; @@ -389,7 +398,6 @@ const unsigned int field_type_aliases_sizes[] = { [FIELD_TYPE_ALIAS_UINT64_T] = 64, }; -BT_HIDDEN struct bt_ctf_field_type *get_field_type(enum field_type_alias alias) { int ret; @@ -411,7 +419,6 @@ end: return field_type; } -BT_HIDDEN const char *bt_ctf_get_byte_order_string(enum bt_ctf_byte_order byte_order) { const char *string; diff --git a/src/ctf-writer/writer.h b/src/ctf-writer/writer.h index 4c6e5163..24c92c36 100644 --- a/src/ctf-writer/writer.h +++ b/src/ctf-writer/writer.h @@ -42,13 +42,10 @@ enum field_type_alias { NR_FIELD_TYPE_ALIAS, }; -BT_HIDDEN struct bt_ctf_field_type *get_field_type(enum field_type_alias alias); -BT_HIDDEN const char *bt_ctf_get_byte_order_string(enum bt_ctf_byte_order byte_order); -BT_HIDDEN void bt_ctf_writer_freeze(struct bt_ctf_writer *writer); #endif /* BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H */ diff --git a/src/ctfser/ctfser.c b/src/ctfser/ctfser.c index 30bb91df..fc0d12c1 100644 --- a/src/ctfser/ctfser.c +++ b/src/ctfser/ctfser.c @@ -41,7 +41,6 @@ void mmap_align_ctfser(struct bt_ctfser *ctfser) MAP_SHARED, ctfser->fd, ctfser->mmap_offset, ctfser->log_level); } -BT_HIDDEN int _bt_ctfser_increase_cur_packet_size(struct bt_ctfser *ctfser) { int ret; @@ -94,7 +93,6 @@ end: return ret; } -BT_HIDDEN int bt_ctfser_init(struct bt_ctfser *ctfser, const char *path, int log_level) { int ret = 0; @@ -118,7 +116,6 @@ end: return ret; } -BT_HIDDEN int bt_ctfser_fini(struct bt_ctfser *ctfser) { int ret = 0; @@ -176,7 +173,6 @@ end: return ret; } -BT_HIDDEN int bt_ctfser_open_packet(struct bt_ctfser *ctfser) { int ret = 0; @@ -241,7 +237,6 @@ end: return ret; } -BT_HIDDEN void bt_ctfser_close_current_packet(struct bt_ctfser *ctfser, uint64_t packet_size_bytes) { diff --git a/src/ctfser/ctfser.h b/src/ctfser/ctfser.h index d2fb0b91..a152b146 100644 --- a/src/ctfser/ctfser.h +++ b/src/ctfser/ctfser.h @@ -67,7 +67,7 @@ struct bt_ctfser { * * This function opens the file `path` for writing. */ -BT_EXTERN_C BT_HIDDEN +BT_EXTERN_C int bt_ctfser_init(struct bt_ctfser *ctfser, const char *path, int log_level); @@ -77,7 +77,7 @@ int bt_ctfser_init(struct bt_ctfser *ctfser, const char *path, * This function truncates the stream file so that there's no extra * padding after the last packet, and then closes the file. */ -BT_EXTERN_C BT_HIDDEN +BT_EXTERN_C int bt_ctfser_fini(struct bt_ctfser *ctfser); /* @@ -85,17 +85,17 @@ int bt_ctfser_fini(struct bt_ctfser *ctfser); * * All the next writing functions are performed within this new packet. */ -BT_EXTERN_C BT_HIDDEN +BT_EXTERN_C int bt_ctfser_open_packet(struct bt_ctfser *ctfser); /* * Closes the current packet, making its size `packet_size_bytes`. */ -BT_EXTERN_C BT_HIDDEN +BT_EXTERN_C void bt_ctfser_close_current_packet(struct bt_ctfser *ctfser, uint64_t packet_size_bytes); -BT_EXTERN_C BT_HIDDEN +BT_EXTERN_C int _bt_ctfser_increase_cur_packet_size(struct bt_ctfser *ctfser); static inline diff --git a/src/fd-cache/fd-cache.c b/src/fd-cache/fd-cache.c index 94450839..f22e7eb5 100644 --- a/src/fd-cache/fd-cache.c +++ b/src/fd-cache/fd-cache.c @@ -82,7 +82,6 @@ void file_key_destroy(gpointer data) g_free(fk); } -BT_HIDDEN int bt_fd_cache_init(struct bt_fd_cache *fdc, int log_level) { int ret = 0; @@ -97,7 +96,6 @@ int bt_fd_cache_init(struct bt_fd_cache *fdc, int log_level) return ret; } -BT_HIDDEN void bt_fd_cache_fini(struct bt_fd_cache *fdc) { if (!fdc->cache) { @@ -114,7 +112,6 @@ end: return; } -BT_HIDDEN struct bt_fd_cache_handle *bt_fd_cache_get_handle(struct bt_fd_cache *fdc, const char *path) { @@ -197,7 +194,6 @@ end: return (struct bt_fd_cache_handle *) fd_internal; } -BT_HIDDEN void bt_fd_cache_put_handle(struct bt_fd_cache *fdc, struct bt_fd_cache_handle *handle) { diff --git a/src/fd-cache/fd-cache.h b/src/fd-cache/fd-cache.h index 3132311c..9a04bb47 100644 --- a/src/fd-cache/fd-cache.h +++ b/src/fd-cache/fd-cache.h @@ -26,17 +26,13 @@ int bt_fd_cache_handle_get_fd(struct bt_fd_cache_handle *handle) return handle->fd; } -BT_HIDDEN int bt_fd_cache_init(struct bt_fd_cache *fdc, int log_level); -BT_HIDDEN void bt_fd_cache_fini(struct bt_fd_cache *fdc); -BT_HIDDEN struct bt_fd_cache_handle *bt_fd_cache_get_handle(struct bt_fd_cache *fdc, const char *path); -BT_HIDDEN void bt_fd_cache_put_handle(struct bt_fd_cache *fdc, struct bt_fd_cache_handle *handle); diff --git a/src/lib/assert-cond-base.h b/src/lib/assert-cond-base.h index 271ed02e..2ba8538b 100644 --- a/src/lib/assert-cond-base.h +++ b/src/lib/assert-cond-base.h @@ -77,7 +77,6 @@ * * 4. Aborts. */ -BT_HIDDEN __attribute__((noreturn)) void bt_lib_assert_cond_failed(const char *cond_type, const char *func, const char *id_suffix, const char *fmt, ...); diff --git a/src/lib/assert-cond.c b/src/lib/assert-cond.c index c2d23c9e..fff35182 100644 --- a/src/lib/assert-cond.c +++ b/src/lib/assert-cond.c @@ -53,7 +53,6 @@ GString *format_cond_id(const char *cond_type, const char *func, return id; } -BT_HIDDEN void bt_lib_assert_cond_failed(const char *cond_type, const char *func, const char *id_suffix, const char *fmt, ...) { diff --git a/src/lib/babeltrace2.c b/src/lib/babeltrace2.c index a29cf9db..e478cae4 100644 --- a/src/lib/babeltrace2.c +++ b/src/lib/babeltrace2.c @@ -9,55 +9,66 @@ #include #include "common/version.h" +#include "common/macros.h" +BT_EXPORT unsigned int bt_version_get_major(void) { return BT_VERSION_MAJOR; } +BT_EXPORT unsigned int bt_version_get_minor(void) { return BT_VERSION_MINOR; } +BT_EXPORT unsigned int bt_version_get_patch(void) { return BT_VERSION_PATCH; } +BT_EXPORT const char *bt_version_get_development_stage(void) { return strlen(BT_VERSION_DEV_STAGE) == 0 ? NULL : BT_VERSION_DEV_STAGE; } +BT_EXPORT const char *bt_version_get_vcs_revision_description(void) { return strlen(BT_VERSION_GIT) == 0 ? NULL : BT_VERSION_GIT; } +BT_EXPORT const char *bt_version_get_name(void) { return strlen(BT_VERSION_NAME) == 0 ? NULL : BT_VERSION_NAME; } +BT_EXPORT const char *bt_version_get_name_description(void) { return strlen(BT_VERSION_DESCRIPTION) == 0 ? NULL : BT_VERSION_DESCRIPTION; } +BT_EXPORT const char *bt_version_get_extra_name(void) { return strlen(BT_VERSION_EXTRA_NAME) == 0 ? NULL : BT_VERSION_EXTRA_NAME; } +BT_EXPORT const char *bt_version_get_extra_description(void) { return strlen(BT_VERSION_EXTRA_DESCRIPTION) == 0 ? NULL : BT_VERSION_EXTRA_DESCRIPTION; } +BT_EXPORT const char *bt_version_get_extra_patch_names(void) { return strlen(BT_VERSION_EXTRA_PATCHES) == 0 ? NULL : diff --git a/src/lib/current-thread.c b/src/lib/current-thread.c index 9e14e4e7..69f14713 100644 --- a/src/lib/current-thread.c +++ b/src/lib/current-thread.c @@ -28,6 +28,7 @@ */ static __thread struct bt_error *thread_error; +BT_EXPORT const struct bt_error *bt_current_thread_take_error(void) { struct bt_error *error = thread_error; @@ -38,6 +39,7 @@ const struct bt_error *bt_current_thread_take_error(void) return error; } +BT_EXPORT void bt_current_thread_clear_error(void) { bt_error_destroy(thread_error); @@ -46,6 +48,7 @@ void bt_current_thread_clear_error(void) thread_error = NULL; } +BT_EXPORT void bt_current_thread_move_error(const struct bt_error *error) { BT_ASSERT_PRE_ERROR_NON_NULL(error); @@ -82,6 +85,7 @@ end: return status; } +BT_EXPORT enum bt_current_thread_error_append_cause_status bt_current_thread_error_append_cause_from_unknown( const char *module_name, const char *file_name, @@ -110,6 +114,7 @@ end: return status; } +BT_EXPORT enum bt_current_thread_error_append_cause_status bt_current_thread_error_append_cause_from_component( bt_self_component *self_comp, const char *file_name, @@ -138,6 +143,7 @@ end: return status; } +BT_EXPORT enum bt_current_thread_error_append_cause_status bt_current_thread_error_append_cause_from_component_class( bt_self_component_class *self_comp_class, const char *file_name, @@ -166,6 +172,7 @@ end: return status; } +BT_EXPORT enum bt_current_thread_error_append_cause_status bt_current_thread_error_append_cause_from_message_iterator( bt_self_message_iterator *self_iter, const char *file_name, diff --git a/src/lib/error.c b/src/lib/error.c index 149579f4..ab794673 100644 --- a/src/lib/error.c +++ b/src/lib/error.c @@ -418,7 +418,6 @@ end: return cause; } -BT_HIDDEN struct bt_error *bt_error_create(void) { struct bt_error *error; @@ -448,7 +447,6 @@ end: return error; } -BT_HIDDEN void bt_error_destroy(struct bt_error *error) { if (!error) { @@ -466,7 +464,6 @@ end: return; } -BT_HIDDEN int bt_error_append_cause_from_unknown(struct bt_error *error, const char *module_name, const char *file_name, uint64_t line_no, const char *msg_fmt, va_list args) @@ -497,7 +494,6 @@ end: return status; } -BT_HIDDEN int bt_error_append_cause_from_component( struct bt_error *error, bt_self_component *self_comp, const char *file_name, uint64_t line_no, @@ -529,7 +525,6 @@ end: return status; } -BT_HIDDEN int bt_error_append_cause_from_component_class( struct bt_error *error, bt_self_component_class *self_comp_class, @@ -562,7 +557,6 @@ end: return status; } -BT_HIDDEN int bt_error_append_cause_from_message_iterator( struct bt_error *error, bt_self_message_iterator *self_iter, const char *file_name, uint64_t line_no, @@ -600,18 +594,21 @@ uint64_t error_cause_count(const bt_error *error) return error->causes ? error->causes->len : 0; } +BT_EXPORT uint64_t bt_error_get_cause_count(const bt_error *error) { BT_ASSERT_PRE_ERROR_NON_NULL(error); return error_cause_count(error); } +BT_EXPORT void bt_error_release(const struct bt_error *error) { BT_ASSERT_PRE_ERROR_NON_NULL(error); bt_error_destroy((void *) error); } +BT_EXPORT const struct bt_error_cause *bt_error_borrow_cause_by_index( const bt_error *error, uint64_t index) { @@ -620,6 +617,7 @@ const struct bt_error_cause *bt_error_borrow_cause_by_index( return error->causes->pdata[index]; } +BT_EXPORT enum bt_error_cause_actor_type bt_error_cause_get_actor_type( const struct bt_error_cause *cause) { @@ -627,30 +625,35 @@ enum bt_error_cause_actor_type bt_error_cause_get_actor_type( return cause->actor_type; } +BT_EXPORT const char *bt_error_cause_get_message(const struct bt_error_cause *cause) { BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause); return cause->message->str; } +BT_EXPORT const char *bt_error_cause_get_module_name(const struct bt_error_cause *cause) { BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause); return cause->module_name->str; } +BT_EXPORT const char *bt_error_cause_get_file_name(const struct bt_error_cause *cause) { BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause); return cause->file_name->str; } +BT_EXPORT uint64_t bt_error_cause_get_line_number(const bt_error_cause *cause) { BT_ASSERT_PRE_ERROR_CAUSE_NON_NULL(cause); return cause->line_no; } +BT_EXPORT const char *bt_error_cause_component_actor_get_component_name( const struct bt_error_cause *cause) { @@ -663,6 +666,7 @@ const char *bt_error_cause_component_actor_get_component_name( return spec_cause->comp_name->str; } +BT_EXPORT bt_component_class_type bt_error_cause_component_actor_get_component_class_type( const struct bt_error_cause *cause) { @@ -675,6 +679,7 @@ bt_component_class_type bt_error_cause_component_actor_get_component_class_type( return spec_cause->comp_class_id.type; } +BT_EXPORT const char *bt_error_cause_component_actor_get_component_class_name( const struct bt_error_cause *cause) { @@ -687,6 +692,7 @@ const char *bt_error_cause_component_actor_get_component_class_name( return spec_cause->comp_class_id.name->str; } +BT_EXPORT const char *bt_error_cause_component_actor_get_plugin_name( const struct bt_error_cause *cause) { @@ -700,6 +706,7 @@ const char *bt_error_cause_component_actor_get_plugin_name( spec_cause->comp_class_id.plugin_name->str : NULL; } +BT_EXPORT bt_component_class_type bt_error_cause_component_class_actor_get_component_class_type( const struct bt_error_cause *cause) @@ -713,6 +720,7 @@ bt_error_cause_component_class_actor_get_component_class_type( return spec_cause->comp_class_id.type; } +BT_EXPORT const char *bt_error_cause_component_class_actor_get_component_class_name( const struct bt_error_cause *cause) { @@ -725,6 +733,7 @@ const char *bt_error_cause_component_class_actor_get_component_class_name( return spec_cause->comp_class_id.name->str; } +BT_EXPORT const char *bt_error_cause_component_class_actor_get_plugin_name( const struct bt_error_cause *cause) { @@ -738,6 +747,7 @@ const char *bt_error_cause_component_class_actor_get_plugin_name( spec_cause->comp_class_id.plugin_name->str : NULL; } +BT_EXPORT const char *bt_error_cause_message_iterator_actor_get_component_name( const struct bt_error_cause *cause) { @@ -750,6 +760,7 @@ const char *bt_error_cause_message_iterator_actor_get_component_name( return spec_cause->comp_name->str; } +BT_EXPORT const char * bt_error_cause_message_iterator_actor_get_component_output_port_name( const struct bt_error_cause *cause) @@ -763,6 +774,7 @@ bt_error_cause_message_iterator_actor_get_component_output_port_name( return spec_cause->output_port_name->str; } +BT_EXPORT bt_component_class_type bt_error_cause_message_iterator_actor_get_component_class_type( const struct bt_error_cause *cause) @@ -776,6 +788,7 @@ bt_error_cause_message_iterator_actor_get_component_class_type( return spec_cause->comp_class_id.type; } +BT_EXPORT const char *bt_error_cause_message_iterator_actor_get_component_class_name( const struct bt_error_cause *cause) { @@ -788,6 +801,7 @@ const char *bt_error_cause_message_iterator_actor_get_component_class_name( return spec_cause->comp_class_id.name->str; } +BT_EXPORT const char *bt_error_cause_message_iterator_actor_get_plugin_name( const struct bt_error_cause *cause) { diff --git a/src/lib/error.h b/src/lib/error.h index 8095a930..5d185a49 100644 --- a/src/lib/error.h +++ b/src/lib/error.h @@ -71,31 +71,29 @@ const char *bt_error_cause_actor_type_string( } }; -BT_HIDDEN struct bt_error *bt_error_create(void); -BT_HIDDEN void bt_error_destroy(struct bt_error *error); -BT_HIDDEN __BT_ATTR_FORMAT_PRINTF(5, 0) +__BT_ATTR_FORMAT_PRINTF(5, 0) int bt_error_append_cause_from_unknown(struct bt_error *error, const char *module_name, const char *file_name, uint64_t line_no, const char *msg_fmt, va_list args); -BT_HIDDEN __BT_ATTR_FORMAT_PRINTF(5, 0) +__BT_ATTR_FORMAT_PRINTF(5, 0) int bt_error_append_cause_from_component( struct bt_error *error, bt_self_component *self_comp, const char *file_name, uint64_t line_no, const char *msg_fmt, va_list args); -BT_HIDDEN __BT_ATTR_FORMAT_PRINTF(5, 0) +__BT_ATTR_FORMAT_PRINTF(5, 0) int bt_error_append_cause_from_component_class( struct bt_error *error, bt_self_component_class *self_comp_class, const char *file_name, uint64_t line_no, const char *msg_fmt, va_list args); -BT_HIDDEN __BT_ATTR_FORMAT_PRINTF(5, 0) +__BT_ATTR_FORMAT_PRINTF(5, 0) int bt_error_append_cause_from_message_iterator( struct bt_error *error, bt_self_message_iterator *self_iter, const char *file_name, uint64_t line_no, diff --git a/src/lib/graph/component-class-sink-simple.c b/src/lib/graph/component-class-sink-simple.c index 812e3b5f..b7c18361 100644 --- a/src/lib/graph/component-class-sink-simple.c +++ b/src/lib/graph/component-class-sink-simple.c @@ -182,7 +182,6 @@ enum bt_component_class_sink_consume_method_status simple_sink_consume( return status; } -BT_HIDDEN struct bt_component_class_sink *bt_component_class_sink_simple_borrow(void) { enum bt_component_class_set_method_status set_method_status; diff --git a/src/lib/graph/component-class-sink-simple.h b/src/lib/graph/component-class-sink-simple.h index 5454bd39..98cc979b 100644 --- a/src/lib/graph/component-class-sink-simple.h +++ b/src/lib/graph/component-class-sink-simple.h @@ -18,7 +18,6 @@ struct simple_sink_init_method_data { void *user_data; }; -BT_HIDDEN struct bt_component_class_sink *bt_component_class_sink_simple_borrow(void); #endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_SINK_SIMPLE_H */ diff --git a/src/lib/graph/component-class.c b/src/lib/graph/component-class.c index 538cd77b..516c31f1 100644 --- a/src/lib/graph/component-class.c +++ b/src/lib/graph/component-class.c @@ -156,6 +156,7 @@ end: return ret; } +BT_EXPORT struct bt_component_class_source *bt_component_class_source_create( const char *name, struct bt_message_iterator_class *message_iterator_class) @@ -195,6 +196,7 @@ end: return (void *) source_class; } +BT_EXPORT struct bt_component_class_filter *bt_component_class_filter_create( const char *name, struct bt_message_iterator_class *message_iterator_class) @@ -234,6 +236,7 @@ end: return (void *) filter_class; } +BT_EXPORT struct bt_component_class_sink *bt_component_class_sink_create( const char *name, bt_component_class_sink_consume_method method) { @@ -273,6 +276,7 @@ end: return (void *) sink_class; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_source_set_get_supported_mip_versions_method( struct bt_component_class_source *comp_cls, @@ -288,6 +292,7 @@ bt_component_class_source_set_get_supported_mip_versions_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_filter_set_get_supported_mip_versions_method( struct bt_component_class_filter *comp_cls, @@ -303,6 +308,7 @@ bt_component_class_filter_set_get_supported_mip_versions_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_sink_set_get_supported_mip_versions_method( struct bt_component_class_sink *comp_cls, @@ -318,6 +324,7 @@ bt_component_class_sink_set_get_supported_mip_versions_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_source_set_initialize_method( struct bt_component_class_source *comp_cls, @@ -333,6 +340,7 @@ bt_component_class_source_set_initialize_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_filter_set_initialize_method( struct bt_component_class_filter *comp_cls, @@ -348,6 +356,7 @@ bt_component_class_filter_set_initialize_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_sink_set_initialize_method( struct bt_component_class_sink *comp_cls, @@ -363,6 +372,7 @@ bt_component_class_sink_set_initialize_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_source_set_finalize_method( struct bt_component_class_source *comp_cls, @@ -378,6 +388,7 @@ bt_component_class_source_set_finalize_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_filter_set_finalize_method( struct bt_component_class_filter *comp_cls, @@ -393,6 +404,7 @@ bt_component_class_filter_set_finalize_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_sink_set_finalize_method( struct bt_component_class_sink *comp_cls, @@ -408,6 +420,7 @@ bt_component_class_sink_set_finalize_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_source_set_query_method( struct bt_component_class_source *comp_cls, @@ -423,6 +436,7 @@ bt_component_class_source_set_query_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_filter_set_query_method( struct bt_component_class_filter *comp_cls, @@ -438,6 +452,7 @@ bt_component_class_filter_set_query_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_sink_set_query_method( struct bt_component_class_sink *comp_cls, @@ -453,6 +468,7 @@ bt_component_class_sink_set_query_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_filter_set_input_port_connected_method( struct bt_component_class_filter *comp_cls, @@ -468,6 +484,7 @@ bt_component_class_filter_set_input_port_connected_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_sink_set_input_port_connected_method( struct bt_component_class_sink *comp_cls, @@ -483,6 +500,7 @@ bt_component_class_sink_set_input_port_connected_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_source_set_output_port_connected_method( struct bt_component_class_source *comp_cls, @@ -498,6 +516,7 @@ bt_component_class_source_set_output_port_connected_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_filter_set_output_port_connected_method( struct bt_component_class_filter *comp_cls, @@ -513,6 +532,7 @@ bt_component_class_filter_set_output_port_connected_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_method_status bt_component_class_sink_set_graph_is_configured_method( struct bt_component_class_sink *comp_cls, @@ -528,6 +548,7 @@ bt_component_class_sink_set_graph_is_configured_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_description_status bt_component_class_set_description( struct bt_component_class *comp_cls, @@ -546,6 +567,7 @@ bt_component_class_set_description( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_component_class_set_help_status bt_component_class_set_help( struct bt_component_class *comp_cls, const char *help) @@ -559,12 +581,14 @@ enum bt_component_class_set_help_status bt_component_class_set_help( return BT_FUNC_STATUS_OK; } +BT_EXPORT const char *bt_component_class_get_name(const struct bt_component_class *comp_cls) { BT_ASSERT_PRE_DEV_COMP_CLS_NON_NULL(comp_cls); return comp_cls->name->str; } +BT_EXPORT enum bt_component_class_type bt_component_class_get_type( const struct bt_component_class *comp_cls) { @@ -572,6 +596,7 @@ enum bt_component_class_type bt_component_class_get_type( return comp_cls->type; } +BT_EXPORT const char *bt_component_class_get_description( const struct bt_component_class *comp_cls) { @@ -581,6 +606,7 @@ const char *bt_component_class_get_description( comp_cls->description->str : NULL; } +BT_EXPORT const char *bt_component_class_get_help( const struct bt_component_class *comp_cls) { @@ -589,7 +615,6 @@ const char *bt_component_class_get_help( comp_cls->help->str[0] != '\0' ? comp_cls->help->str : NULL; } -BT_HIDDEN void bt_component_class_add_destroy_listener( struct bt_component_class *comp_cls, bt_component_class_destroy_listener_func func, void *data) @@ -605,7 +630,6 @@ void bt_component_class_add_destroy_listener( "%![cc-]+C, listener-func-addr=%p", comp_cls, func); } -BT_HIDDEN void _bt_component_class_freeze(const struct bt_component_class *comp_cls) { BT_ASSERT(comp_cls); @@ -613,48 +637,56 @@ void _bt_component_class_freeze(const struct bt_component_class *comp_cls) ((struct bt_component_class *) comp_cls)->frozen = true; } +BT_EXPORT void bt_component_class_get_ref( const struct bt_component_class *component_class) { bt_object_get_ref(component_class); } +BT_EXPORT void bt_component_class_put_ref( const struct bt_component_class *component_class) { bt_object_put_ref(component_class); } +BT_EXPORT void bt_component_class_source_get_ref( const struct bt_component_class_source *component_class_source) { bt_object_get_ref(component_class_source); } +BT_EXPORT void bt_component_class_source_put_ref( const struct bt_component_class_source *component_class_source) { bt_object_put_ref(component_class_source); } +BT_EXPORT void bt_component_class_filter_get_ref( const struct bt_component_class_filter *component_class_filter) { bt_object_get_ref(component_class_filter); } +BT_EXPORT void bt_component_class_filter_put_ref( const struct bt_component_class_filter *component_class_filter) { bt_object_put_ref(component_class_filter); } +BT_EXPORT void bt_component_class_sink_get_ref( const struct bt_component_class_sink *component_class_sink) { bt_object_get_ref(component_class_sink); } +BT_EXPORT void bt_component_class_sink_put_ref( const struct bt_component_class_sink *component_class_sink) { diff --git a/src/lib/graph/component-class.h b/src/lib/graph/component-class.h index 17000909..1f22a067 100644 --- a/src/lib/graph/component-class.h +++ b/src/lib/graph/component-class.h @@ -84,11 +84,9 @@ struct bt_component_class_sink { } methods; }; -BT_HIDDEN void bt_component_class_add_destroy_listener(struct bt_component_class *class, bt_component_class_destroy_listener_func func, void *data); -BT_HIDDEN void _bt_component_class_freeze( const struct bt_component_class *component_class); diff --git a/src/lib/graph/component-descriptor-set.c b/src/lib/graph/component-descriptor-set.c index 0ef24388..d7ef275b 100644 --- a/src/lib/graph/component-descriptor-set.c +++ b/src/lib/graph/component-descriptor-set.c @@ -65,6 +65,7 @@ end: return; } +BT_EXPORT struct bt_component_descriptor_set *bt_component_descriptor_set_create(void) { struct bt_component_descriptor_set *comp_descr_set; @@ -113,6 +114,7 @@ end: return comp_descr_set; } +BT_EXPORT enum bt_component_descriptor_set_add_descriptor_status bt_component_descriptor_set_add_descriptor_with_initialize_method_data( struct bt_component_descriptor_set *comp_descr_set, @@ -193,6 +195,7 @@ end: return status; } +BT_EXPORT enum bt_component_descriptor_set_add_descriptor_status bt_component_descriptor_set_add_descriptor( struct bt_component_descriptor_set *comp_descr_set, @@ -205,12 +208,14 @@ bt_component_descriptor_set_add_descriptor( comp_descr_set, comp_cls, params, NULL); } +BT_EXPORT void bt_component_descriptor_set_get_ref( const struct bt_component_descriptor_set *comp_descr_set) { bt_object_get_ref(comp_descr_set); } +BT_EXPORT void bt_component_descriptor_set_put_ref( const struct bt_component_descriptor_set *comp_descr_set) { diff --git a/src/lib/graph/component-filter.c b/src/lib/graph/component-filter.c index 44bf4843..ba940dea 100644 --- a/src/lib/graph/component-filter.c +++ b/src/lib/graph/component-filter.c @@ -21,12 +21,10 @@ #include "component-class.h" #include "lib/func-status.h" -BT_HIDDEN void bt_component_filter_destroy(struct bt_component *component) { } -BT_HIDDEN struct bt_component *bt_component_filter_create( const struct bt_component_class *class) { @@ -43,6 +41,7 @@ end: return (void *) filter; } +BT_EXPORT const bt_component_class_filter * bt_component_filter_borrow_class_const( const bt_component_filter *component) @@ -59,6 +58,7 @@ bt_component_filter_borrow_class_const( return (bt_component_class_filter *) cls; } +BT_EXPORT uint64_t bt_component_filter_get_output_port_count( const struct bt_component_filter *comp) { @@ -66,6 +66,7 @@ uint64_t bt_component_filter_get_output_port_count( return bt_component_get_output_port_count((void *) comp, __func__); } +BT_EXPORT const struct bt_port_output * bt_component_filter_borrow_output_port_by_name_const( const struct bt_component_filter *comp, const char *name) @@ -78,6 +79,7 @@ bt_component_filter_borrow_output_port_by_name_const( (void *) comp, name, __func__); } +BT_EXPORT struct bt_self_component_port_output * bt_self_component_filter_borrow_output_port_by_name( struct bt_self_component_filter *comp, const char *name) @@ -90,6 +92,7 @@ bt_self_component_filter_borrow_output_port_by_name( (void *) comp, name, __func__); } +BT_EXPORT const struct bt_port_output * bt_component_filter_borrow_output_port_by_index_const( const struct bt_component_filter *comp, uint64_t index) @@ -102,6 +105,7 @@ bt_component_filter_borrow_output_port_by_index_const( (void *) comp, index, __func__); } +BT_EXPORT struct bt_self_component_port_output * bt_self_component_filter_borrow_output_port_by_index( struct bt_self_component_filter *comp, uint64_t index) @@ -114,6 +118,7 @@ bt_self_component_filter_borrow_output_port_by_index( (void *) comp, index, __func__); } +BT_EXPORT enum bt_self_component_add_port_status bt_self_component_filter_add_output_port( struct bt_self_component_filter *self_comp, const char *name, void *user_data, @@ -145,6 +150,7 @@ end: return status; } +BT_EXPORT uint64_t bt_component_filter_get_input_port_count( const struct bt_component_filter *component) { @@ -152,6 +158,7 @@ uint64_t bt_component_filter_get_input_port_count( return bt_component_get_input_port_count((void *) component, __func__); } +BT_EXPORT const struct bt_port_input *bt_component_filter_borrow_input_port_by_name_const( const struct bt_component_filter *component, const char *name) { @@ -163,6 +170,7 @@ const struct bt_port_input *bt_component_filter_borrow_input_port_by_name_const( (void *) component, name, __func__); } +BT_EXPORT struct bt_self_component_port_input * bt_self_component_filter_borrow_input_port_by_name( struct bt_self_component_filter *component, const char *name) @@ -175,6 +183,7 @@ bt_self_component_filter_borrow_input_port_by_name( (void *) component, name, __func__); } +BT_EXPORT const struct bt_port_input * bt_component_filter_borrow_input_port_by_index_const( const struct bt_component_filter *component, uint64_t index) @@ -187,6 +196,7 @@ bt_component_filter_borrow_input_port_by_index_const( (void *) component, index, __func__); } +BT_EXPORT struct bt_self_component_port_input * bt_self_component_filter_borrow_input_port_by_index( struct bt_self_component_filter *component, uint64_t index) @@ -199,6 +209,7 @@ bt_self_component_filter_borrow_input_port_by_index( (void *) component, index, __func__); } +BT_EXPORT enum bt_self_component_add_port_status bt_self_component_filter_add_input_port( struct bt_self_component_filter *self_comp, const char *name, void *user_data, @@ -230,12 +241,14 @@ end: return status; } +BT_EXPORT void bt_component_filter_get_ref( const struct bt_component_filter *component_filter) { bt_object_get_ref(component_filter); } +BT_EXPORT void bt_component_filter_put_ref( const struct bt_component_filter *component_filter) { diff --git a/src/lib/graph/component-filter.h b/src/lib/graph/component-filter.h index 1df52b10..1c43d0c5 100644 --- a/src/lib/graph/component-filter.h +++ b/src/lib/graph/component-filter.h @@ -18,11 +18,9 @@ struct bt_component_filter { struct bt_component parent; }; -BT_HIDDEN struct bt_component *bt_component_filter_create( const struct bt_component_class *class); -BT_HIDDEN void bt_component_filter_destroy(struct bt_component *component); #endif /* BABELTRACE_GRAPH_COMPONENT_FILTER_INTERNAL_H */ diff --git a/src/lib/graph/component-sink.c b/src/lib/graph/component-sink.c index d45532b4..fb006f98 100644 --- a/src/lib/graph/component-sink.c +++ b/src/lib/graph/component-sink.c @@ -21,12 +21,10 @@ #include "graph.h" #include "lib/func-status.h" -BT_HIDDEN void bt_component_sink_destroy(struct bt_component *component) { } -BT_HIDDEN struct bt_component *bt_component_sink_create( const struct bt_component_class *class) { @@ -43,6 +41,7 @@ end: return (void *) sink; } +BT_EXPORT const bt_component_class_sink * bt_component_sink_borrow_class_const( const bt_component_sink *component) @@ -59,6 +58,7 @@ bt_component_sink_borrow_class_const( return (bt_component_class_sink *) cls; } +BT_EXPORT uint64_t bt_component_sink_get_input_port_count( const struct bt_component_sink *component) { @@ -66,6 +66,7 @@ uint64_t bt_component_sink_get_input_port_count( return bt_component_get_input_port_count((void *) component, __func__); } +BT_EXPORT const struct bt_port_input * bt_component_sink_borrow_input_port_by_name_const( const struct bt_component_sink *component, const char *name) @@ -78,6 +79,7 @@ bt_component_sink_borrow_input_port_by_name_const( __func__); } +BT_EXPORT struct bt_self_component_port_input * bt_self_component_sink_borrow_input_port_by_name( struct bt_self_component_sink *component, const char *name) @@ -90,6 +92,7 @@ bt_self_component_sink_borrow_input_port_by_name( (void *) component, name, __func__); } +BT_EXPORT const struct bt_port_input *bt_component_sink_borrow_input_port_by_index_const( const struct bt_component_sink *component, uint64_t index) { @@ -101,6 +104,7 @@ const struct bt_port_input *bt_component_sink_borrow_input_port_by_index_const( (void *) component, index, __func__); } +BT_EXPORT struct bt_self_component_port_input * bt_self_component_sink_borrow_input_port_by_index( struct bt_self_component_sink *component, uint64_t index) @@ -113,6 +117,7 @@ bt_self_component_sink_borrow_input_port_by_index( (void *) component, index, __func__); } +BT_EXPORT enum bt_self_component_add_port_status bt_self_component_sink_add_input_port( struct bt_self_component_sink *self_comp, const char *name, void *user_data, @@ -144,6 +149,7 @@ end: return status; } +BT_EXPORT bt_bool bt_self_component_sink_is_interrupted( const struct bt_self_component_sink *self_comp) { @@ -154,12 +160,14 @@ bt_bool bt_self_component_sink_is_interrupted( bt_component_borrow_graph(comp)); } +BT_EXPORT void bt_component_sink_get_ref( const struct bt_component_sink *component_sink) { bt_object_get_ref(component_sink); } +BT_EXPORT void bt_component_sink_put_ref( const struct bt_component_sink *component_sink) { diff --git a/src/lib/graph/component-sink.h b/src/lib/graph/component-sink.h index 538a28fd..c2ee1026 100644 --- a/src/lib/graph/component-sink.h +++ b/src/lib/graph/component-sink.h @@ -22,11 +22,9 @@ struct bt_component_sink { bool graph_is_configured_method_called; }; -BT_HIDDEN struct bt_component *bt_component_sink_create( const struct bt_component_class *class); -BT_HIDDEN void bt_component_sink_destroy(struct bt_component *component); #endif /* BABELTRACE_GRAPH_COMPONENT_SINK_INTERNAL_H */ diff --git a/src/lib/graph/component-source.c b/src/lib/graph/component-source.c index 71d28b28..5701563a 100644 --- a/src/lib/graph/component-source.c +++ b/src/lib/graph/component-source.c @@ -21,12 +21,10 @@ #include "message/iterator.h" #include "lib/func-status.h" -BT_HIDDEN void bt_component_source_destroy(struct bt_component *component) { } -BT_HIDDEN struct bt_component *bt_component_source_create( const struct bt_component_class *class) { @@ -43,6 +41,7 @@ end: return (void *) source; } +BT_EXPORT const bt_component_class_source * bt_component_source_borrow_class_const( const bt_component_source *component) @@ -59,6 +58,7 @@ bt_component_source_borrow_class_const( return (bt_component_class_source *) cls; } +BT_EXPORT uint64_t bt_component_source_get_output_port_count( const struct bt_component_source *comp) { @@ -66,6 +66,7 @@ uint64_t bt_component_source_get_output_port_count( return bt_component_get_output_port_count((void *) comp, __func__); } +BT_EXPORT const struct bt_port_output * bt_component_source_borrow_output_port_by_name_const( const struct bt_component_source *comp, const char *name) @@ -78,6 +79,7 @@ bt_component_source_borrow_output_port_by_name_const( __func__); } +BT_EXPORT struct bt_self_component_port_output * bt_self_component_source_borrow_output_port_by_name( struct bt_self_component_source *comp, const char *name) @@ -90,6 +92,7 @@ bt_self_component_source_borrow_output_port_by_name( (void *) comp, name, __func__); } +BT_EXPORT const struct bt_port_output * bt_component_source_borrow_output_port_by_index_const( const struct bt_component_source *comp, uint64_t index) @@ -102,6 +105,7 @@ bt_component_source_borrow_output_port_by_index_const( __func__); } +BT_EXPORT struct bt_self_component_port_output * bt_self_component_source_borrow_output_port_by_index( struct bt_self_component_source *comp, uint64_t index) @@ -114,6 +118,7 @@ bt_self_component_source_borrow_output_port_by_index( (void *) comp, index, __func__); } +BT_EXPORT enum bt_self_component_add_port_status bt_self_component_source_add_output_port( struct bt_self_component_source *self_comp, const char *name, void *user_data, @@ -146,12 +151,14 @@ end: return status; } +BT_EXPORT void bt_component_source_get_ref( const struct bt_component_source *component_source) { bt_object_get_ref(component_source); } +BT_EXPORT void bt_component_source_put_ref( const struct bt_component_source *component_source) { diff --git a/src/lib/graph/component-source.h b/src/lib/graph/component-source.h index f51aab7e..bcade78a 100644 --- a/src/lib/graph/component-source.h +++ b/src/lib/graph/component-source.h @@ -17,11 +17,9 @@ struct bt_component_source { struct bt_component parent; }; -BT_HIDDEN struct bt_component *bt_component_source_create( const struct bt_component_class *class); -BT_HIDDEN void bt_component_source_destroy(struct bt_component *component); #endif /* BABELTRACE_GRAPH_COMPONENT_SOURCE_INTERNAL_H */ diff --git a/src/lib/graph/component.c b/src/lib/graph/component.c index fcfdb8b9..14653172 100644 --- a/src/lib/graph/component.c +++ b/src/lib/graph/component.c @@ -180,6 +180,7 @@ void destroy_component(struct bt_object *obj) g_free(component); } +BT_EXPORT enum bt_component_class_type bt_component_get_class_type( const struct bt_component *component) { @@ -261,7 +262,6 @@ end: return status; } -BT_HIDDEN uint64_t bt_component_get_input_port_count(const struct bt_component *comp, const char *api_func) { @@ -269,7 +269,6 @@ uint64_t bt_component_get_input_port_count(const struct bt_component *comp, return (uint64_t) comp->input_ports->len; } -BT_HIDDEN uint64_t bt_component_get_output_port_count(const struct bt_component *comp, const char *api_func) { @@ -277,7 +276,6 @@ uint64_t bt_component_get_output_port_count(const struct bt_component *comp, return (uint64_t) comp->output_ports->len; } -BT_HIDDEN int bt_component_create(struct bt_component_class *component_class, const char *name, bt_logging_level log_level, struct bt_component **user_component) @@ -346,12 +344,14 @@ end: return ret; } +BT_EXPORT const char *bt_component_get_name(const struct bt_component *component) { BT_ASSERT_PRE_DEV_COMP_NON_NULL(component); return component->name->str; } +BT_EXPORT const struct bt_component_class *bt_component_borrow_class_const( const struct bt_component *component) { @@ -359,6 +359,7 @@ const struct bt_component_class *bt_component_borrow_class_const( return component->class; } +BT_EXPORT void *bt_self_component_get_data(const struct bt_self_component *self_comp) { struct bt_component *component = (void *) self_comp; @@ -367,6 +368,7 @@ void *bt_self_component_get_data(const struct bt_self_component *self_comp) return component->user_data; } +BT_EXPORT void bt_self_component_set_data(struct bt_self_component *self_comp, void *data) { @@ -377,7 +379,6 @@ void bt_self_component_set_data(struct bt_self_component *self_comp, BT_LIB_LOGD("Set component's user data: %!+c", component); } -BT_HIDDEN void bt_component_set_graph(struct bt_component *component, struct bt_graph *graph) { @@ -406,7 +407,6 @@ struct bt_port *borrow_port_by_name(GPtrArray *ports, return ret_port; } -BT_HIDDEN struct bt_port_input *bt_component_borrow_input_port_by_name( struct bt_component *comp, const char *name, const char *api_func) @@ -415,7 +415,6 @@ struct bt_port_input *bt_component_borrow_input_port_by_name( return (void *) borrow_port_by_name(comp->input_ports, name, api_func); } -BT_HIDDEN struct bt_port_output *bt_component_borrow_output_port_by_name( struct bt_component *comp, const char *name, const char *api_func) @@ -433,7 +432,6 @@ struct bt_port *borrow_port_by_index(GPtrArray *ports, uint64_t index, return g_ptr_array_index(ports, index); } -BT_HIDDEN struct bt_port_input *bt_component_borrow_input_port_by_index( struct bt_component *comp, uint64_t index, const char *api_func) @@ -443,7 +441,6 @@ struct bt_port_input *bt_component_borrow_input_port_by_index( borrow_port_by_index(comp->input_ports, index, api_func); } -BT_HIDDEN struct bt_port_output *bt_component_borrow_output_port_by_index( struct bt_component *comp, uint64_t index, const char *api_func) @@ -453,7 +450,6 @@ struct bt_port_output *bt_component_borrow_output_port_by_index( borrow_port_by_index(comp->output_ports, index, api_func); } -BT_HIDDEN enum bt_self_component_add_port_status bt_component_add_input_port( struct bt_component *component, const char *name, void *user_data, struct bt_port **port, const char *api_func) @@ -470,7 +466,6 @@ enum bt_self_component_add_port_status bt_component_add_input_port( BT_PORT_TYPE_INPUT, name, user_data, port, api_func); } -BT_HIDDEN enum bt_self_component_add_port_status bt_component_add_output_port( struct bt_component *component, const char *name, void *user_data, struct bt_port **port, @@ -488,7 +483,6 @@ enum bt_self_component_add_port_status bt_component_add_output_port( BT_PORT_TYPE_OUTPUT, name, user_data, port, api_func); } -BT_HIDDEN bool bt_component_port_name_is_unique(GPtrArray *ports, const char *name) { guint i; @@ -509,7 +503,6 @@ end: return unique; } -BT_HIDDEN enum bt_component_class_port_connected_method_status bt_component_port_connected( struct bt_component *comp, struct bt_port *self_port, @@ -600,7 +593,6 @@ bt_component_port_connected( return status; } -BT_HIDDEN void bt_component_add_destroy_listener(struct bt_component *component, bt_component_destroy_listener_func func, void *data) { @@ -616,7 +608,6 @@ void bt_component_add_destroy_listener(struct bt_component *component, component, func, data); } -BT_HIDDEN void bt_component_remove_destroy_listener(struct bt_component *component, bt_component_destroy_listener_func func, void *data) { @@ -640,6 +631,7 @@ void bt_component_remove_destroy_listener(struct bt_component *component, } } +BT_EXPORT bt_logging_level bt_component_get_logging_level( const struct bt_component *component) { @@ -647,6 +639,7 @@ bt_logging_level bt_component_get_logging_level( return component->log_level; } +BT_EXPORT uint64_t bt_self_component_get_graph_mip_version( bt_self_component *self_component) { @@ -656,11 +649,13 @@ uint64_t bt_self_component_get_graph_mip_version( return bt_component_borrow_graph(comp)->mip_version; } +BT_EXPORT void bt_component_get_ref(const struct bt_component *component) { bt_object_get_ref(component); } +BT_EXPORT void bt_component_put_ref(const struct bt_component *component) { bt_object_put_ref(component); diff --git a/src/lib/graph/component.h b/src/lib/graph/component.h index f12ca3b1..9751ca96 100644 --- a/src/lib/graph/component.h +++ b/src/lib/graph/component.h @@ -69,73 +69,58 @@ struct bt_graph *bt_component_borrow_graph(struct bt_component *comp) return (void *) bt_object_borrow_parent(&comp->base); } -BT_HIDDEN int bt_component_create(struct bt_component_class *component_class, const char *name, bt_logging_level log_level, struct bt_component **component); -BT_HIDDEN enum bt_component_class_port_connected_method_status bt_component_port_connected( struct bt_component *comp, struct bt_port *self_port, struct bt_port *other_port); -BT_HIDDEN void bt_component_set_graph(struct bt_component *component, struct bt_graph *graph); -BT_HIDDEN uint64_t bt_component_get_input_port_count(const struct bt_component *comp, const char *api_func); -BT_HIDDEN uint64_t bt_component_get_output_port_count(const struct bt_component *comp, const char *api_func); -BT_HIDDEN struct bt_port_input *bt_component_borrow_input_port_by_index( struct bt_component *comp, uint64_t index, const char *api_func); -BT_HIDDEN struct bt_port_output *bt_component_borrow_output_port_by_index( struct bt_component *comp, uint64_t index, const char *api_func); -BT_HIDDEN struct bt_port_input *bt_component_borrow_input_port_by_name( struct bt_component *comp, const char *name, const char *api_func); -BT_HIDDEN struct bt_port_output *bt_component_borrow_output_port_by_name( struct bt_component *comp, const char *name, const char *api_func); -BT_HIDDEN enum bt_self_component_add_port_status bt_component_add_input_port( struct bt_component *component, const char *name, void *user_data, struct bt_port **port, const char *api_func); -BT_HIDDEN enum bt_self_component_add_port_status bt_component_add_output_port( struct bt_component *component, const char *name, void *user_data, struct bt_port **port, const char *api_func); -BT_HIDDEN bool bt_component_port_name_is_unique(GPtrArray *ports, const char *name); -BT_HIDDEN void bt_component_remove_port(struct bt_component *component, struct bt_port *port); -BT_HIDDEN void bt_component_add_destroy_listener(struct bt_component *component, bt_component_destroy_listener_func func, void *data); -BT_HIDDEN void bt_component_remove_destroy_listener(struct bt_component *component, bt_component_destroy_listener_func func, void *data); diff --git a/src/lib/graph/connection.c b/src/lib/graph/connection.c index eb84c11b..bb53dd09 100644 --- a/src/lib/graph/connection.c +++ b/src/lib/graph/connection.c @@ -97,7 +97,6 @@ void parent_is_owner(struct bt_object *obj) try_remove_connection_from_graph(connection); } -BT_HIDDEN struct bt_connection *bt_connection_create(struct bt_graph *graph, struct bt_port *upstream_port, struct bt_port *downstream_port) @@ -139,7 +138,6 @@ end: return connection; } -BT_HIDDEN void bt_connection_end(struct bt_connection *conn, bool try_remove_from_graph) { struct bt_port *downstream_port = conn->downstream_port; @@ -212,6 +210,7 @@ void bt_connection_end(struct bt_connection *conn, bool try_remove_from_graph) } } +BT_EXPORT const struct bt_port_output *bt_connection_borrow_upstream_port_const( const struct bt_connection *connection) { @@ -219,6 +218,7 @@ const struct bt_port_output *bt_connection_borrow_upstream_port_const( return (void *) connection->upstream_port; } +BT_EXPORT const struct bt_port_input *bt_connection_borrow_downstream_port_const( const struct bt_connection *connection) { @@ -226,7 +226,6 @@ const struct bt_port_input *bt_connection_borrow_downstream_port_const( return (void *) connection->downstream_port; } -BT_HIDDEN void bt_connection_remove_iterator(struct bt_connection *conn, struct bt_message_iterator *iterator) { @@ -236,11 +235,13 @@ void bt_connection_remove_iterator(struct bt_connection *conn, try_remove_connection_from_graph(conn); } +BT_EXPORT void bt_connection_get_ref(const struct bt_connection *connection) { bt_object_get_ref(connection); } +BT_EXPORT void bt_connection_put_ref(const struct bt_connection *connection) { bt_object_put_ref(connection); diff --git a/src/lib/graph/connection.h b/src/lib/graph/connection.h index 87c23f33..bc2513d5 100644 --- a/src/lib/graph/connection.h +++ b/src/lib/graph/connection.h @@ -45,15 +45,12 @@ struct bt_connection { bool notified_graph_ports_connected; }; -BT_HIDDEN struct bt_connection *bt_connection_create(struct bt_graph *graph, struct bt_port *upstream_port, struct bt_port *downstream_port); -BT_HIDDEN void bt_connection_end(struct bt_connection *conn, bool try_remove_from_graph); -BT_HIDDEN void bt_connection_remove_iterator(struct bt_connection *conn, struct bt_message_iterator *iterator); diff --git a/src/lib/graph/graph.c b/src/lib/graph/graph.c index 37c23994..d0776249 100644 --- a/src/lib/graph/graph.c +++ b/src/lib/graph/graph.c @@ -170,6 +170,7 @@ void notify_message_graph_is_destroyed(struct bt_message *msg) bt_message_unlink_graph(msg); } +BT_EXPORT struct bt_graph *bt_graph_create(uint64_t mip_version) { struct bt_graph *graph; @@ -297,6 +298,7 @@ error: goto end; } +BT_EXPORT enum bt_graph_connect_ports_status bt_graph_connect_ports( struct bt_graph *graph, const struct bt_port_output *upstream_port_out, @@ -509,7 +511,6 @@ end: return status; } -BT_HIDDEN int bt_graph_consume_sink_no_check(struct bt_graph *graph, struct bt_component_sink *sink) { @@ -648,6 +649,7 @@ end: return status; } +BT_EXPORT enum bt_graph_run_once_status bt_graph_run_once(struct bt_graph *graph) { enum bt_graph_run_once_status status; @@ -673,6 +675,7 @@ end: return status; } +BT_EXPORT enum bt_graph_run_status bt_graph_run(struct bt_graph *graph) { enum bt_graph_run_status status; @@ -744,6 +747,7 @@ end: return status; } +BT_EXPORT enum bt_graph_add_listener_status bt_graph_add_source_component_output_port_added_listener( struct bt_graph *graph, @@ -772,6 +776,7 @@ bt_graph_add_source_component_output_port_added_listener( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_graph_add_listener_status bt_graph_add_filter_component_output_port_added_listener( struct bt_graph *graph, @@ -800,6 +805,7 @@ bt_graph_add_filter_component_output_port_added_listener( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_graph_add_listener_status bt_graph_add_filter_component_input_port_added_listener( struct bt_graph *graph, @@ -828,6 +834,7 @@ bt_graph_add_filter_component_input_port_added_listener( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_graph_add_listener_status bt_graph_add_sink_component_input_port_added_listener( struct bt_graph *graph, @@ -856,7 +863,6 @@ bt_graph_add_sink_component_input_port_added_listener( return BT_FUNC_STATUS_OK; } -BT_HIDDEN enum bt_graph_listener_func_status bt_graph_notify_port_added( struct bt_graph *graph, struct bt_port *port) { @@ -939,7 +945,6 @@ end: return status; } -BT_HIDDEN void bt_graph_remove_connection(struct bt_graph *graph, struct bt_connection *connection) { @@ -1130,6 +1135,7 @@ add_source_component_with_initialize_method_data( api_func, "bt_component_class_source_initialize_method"); } +BT_EXPORT enum bt_graph_add_component_status bt_graph_add_source_component_with_initialize_method_data( struct bt_graph *graph, @@ -1142,6 +1148,7 @@ bt_graph_add_source_component_with_initialize_method_data( name, params, init_method_data, log_level, component, __func__); } +BT_EXPORT enum bt_graph_add_component_status bt_graph_add_source_component( struct bt_graph *graph, const struct bt_component_class_source *comp_cls, @@ -1171,6 +1178,7 @@ add_filter_component_with_initialize_method_data( api_func, "bt_component_class_filter_initialize_method"); } +BT_EXPORT enum bt_graph_add_component_status bt_graph_add_filter_component_with_initialize_method_data( struct bt_graph *graph, @@ -1183,6 +1191,7 @@ bt_graph_add_filter_component_with_initialize_method_data( name, params, init_method_data, log_level, component, __func__); } +BT_EXPORT enum bt_graph_add_component_status bt_graph_add_filter_component( struct bt_graph *graph, const struct bt_component_class_filter *comp_cls, @@ -1212,6 +1221,7 @@ add_sink_component_with_initialize_method_data( api_func, "bt_component_class_sink_initialize_method"); } +BT_EXPORT enum bt_graph_add_component_status bt_graph_add_sink_component_with_initialize_method_data( struct bt_graph *graph, @@ -1225,6 +1235,7 @@ bt_graph_add_sink_component_with_initialize_method_data( __func__); } +BT_EXPORT enum bt_graph_add_component_status bt_graph_add_sink_component( struct bt_graph *graph, const struct bt_component_class_sink *comp_cls, @@ -1236,6 +1247,7 @@ enum bt_graph_add_component_status bt_graph_add_sink_component( name, params, NULL, log_level, component, __func__); } +BT_EXPORT enum bt_graph_add_component_status bt_graph_add_simple_sink_component(struct bt_graph *graph, const char *name, bt_graph_simple_sink_component_initialize_func init_func, @@ -1277,7 +1289,6 @@ end: return status; } -BT_HIDDEN void bt_graph_add_message(struct bt_graph *graph, struct bt_message *msg) { @@ -1295,13 +1306,13 @@ void bt_graph_add_message(struct bt_graph *graph, g_ptr_array_add(graph->messages, msg); } -BT_HIDDEN bool bt_graph_is_interrupted(const struct bt_graph *graph) { BT_ASSERT_DBG(graph); return bt_interrupter_array_any_is_set(graph->interrupters); } +BT_EXPORT enum bt_graph_add_interrupter_status bt_graph_add_interrupter( struct bt_graph *graph, const struct bt_interrupter *intr) { @@ -1315,17 +1326,20 @@ enum bt_graph_add_interrupter_status bt_graph_add_interrupter( return BT_FUNC_STATUS_OK; } +BT_EXPORT struct bt_interrupter *bt_graph_borrow_default_interrupter(bt_graph *graph) { BT_ASSERT_PRE_GRAPH_NON_NULL(graph); return graph->default_interrupter; } +BT_EXPORT void bt_graph_get_ref(const struct bt_graph *graph) { bt_object_get_ref(graph); } +BT_EXPORT void bt_graph_put_ref(const struct bt_graph *graph) { bt_object_put_ref(graph); diff --git a/src/lib/graph/graph.h b/src/lib/graph/graph.h index 066f7233..29490cdb 100644 --- a/src/lib/graph/graph.h +++ b/src/lib/graph/graph.h @@ -143,23 +143,18 @@ void bt_graph_set_can_consume(struct bt_graph *graph, bool can_consume) graph->can_consume = can_consume; } -BT_HIDDEN int bt_graph_consume_sink_no_check(struct bt_graph *graph, struct bt_component_sink *sink); -BT_HIDDEN enum bt_graph_listener_func_status bt_graph_notify_port_added(struct bt_graph *graph, struct bt_port *port); -BT_HIDDEN void bt_graph_remove_connection(struct bt_graph *graph, struct bt_connection *connection); -BT_HIDDEN void bt_graph_add_message(struct bt_graph *graph, struct bt_message *msg); -BT_HIDDEN bool bt_graph_is_interrupted(const struct bt_graph *graph); static inline diff --git a/src/lib/graph/interrupter.c b/src/lib/graph/interrupter.c index 75237d3b..6a2f018b 100644 --- a/src/lib/graph/interrupter.c +++ b/src/lib/graph/interrupter.c @@ -20,7 +20,8 @@ void destroy_interrupter(struct bt_object *obj) g_free(obj); } -extern struct bt_interrupter *bt_interrupter_create(void) +BT_EXPORT +struct bt_interrupter *bt_interrupter_create(void) { struct bt_interrupter *intr = g_new0(struct bt_interrupter, 1); @@ -41,29 +42,34 @@ end: return intr; } +BT_EXPORT void bt_interrupter_set(struct bt_interrupter *intr) { BT_ASSERT_PRE_INTR_NON_NULL(intr); intr->is_set = true; } +BT_EXPORT void bt_interrupter_reset(struct bt_interrupter *intr) { BT_ASSERT_PRE_INTR_NON_NULL(intr); intr->is_set = false; } +BT_EXPORT bt_bool bt_interrupter_is_set(const struct bt_interrupter *intr) { BT_ASSERT_PRE_INTR_NON_NULL(intr); return (bt_bool) intr->is_set; } +BT_EXPORT void bt_interrupter_get_ref(const struct bt_interrupter *intr) { bt_object_get_ref(intr); } +BT_EXPORT void bt_interrupter_put_ref(const struct bt_interrupter *intr) { bt_object_put_ref(intr); diff --git a/src/lib/graph/iterator.c b/src/lib/graph/iterator.c index fd49c27e..588d0b40 100644 --- a/src/lib/graph/iterator.c +++ b/src/lib/graph/iterator.c @@ -138,7 +138,6 @@ void bt_message_iterator_destroy(struct bt_object *obj) g_free(iterator); } -BT_HIDDEN void bt_message_iterator_try_finalize( struct bt_message_iterator *iterator) { @@ -240,7 +239,6 @@ end: return; } -BT_HIDDEN void bt_message_iterator_set_connection( struct bt_message_iterator *iterator, struct bt_connection *connection) @@ -457,6 +455,7 @@ end: return status; } +BT_EXPORT bt_message_iterator_create_from_message_iterator_status bt_message_iterator_create_from_message_iterator( struct bt_self_message_iterator *self_msg_iter, @@ -469,6 +468,7 @@ bt_message_iterator_create_from_message_iterator( input_port, message_iterator, __func__); } +BT_EXPORT bt_message_iterator_create_from_sink_component_status bt_message_iterator_create_from_sink_component( struct bt_self_component_sink *self_comp, @@ -481,6 +481,7 @@ bt_message_iterator_create_from_sink_component( input_port, message_iterator, __func__); } +BT_EXPORT void *bt_self_message_iterator_get_data( const struct bt_self_message_iterator *self_iterator) { @@ -491,6 +492,7 @@ void *bt_self_message_iterator_get_data( return iterator->user_data; } +BT_EXPORT void bt_self_message_iterator_set_data( struct bt_self_message_iterator *self_iterator, void *data) { @@ -503,6 +505,7 @@ void bt_self_message_iterator_set_data( "%!+i, user-data-addr=%p", iterator, data); } +BT_EXPORT void bt_self_message_iterator_configuration_set_can_seek_forward( bt_self_message_iterator_configuration *config, bt_bool can_seek_forward) @@ -824,6 +827,7 @@ call_iterator_next_method( return status; } +BT_EXPORT enum bt_message_iterator_next_status bt_message_iterator_next( struct bt_message_iterator *iterator, @@ -906,6 +910,7 @@ end: return status; } +BT_EXPORT struct bt_component * bt_message_iterator_borrow_component( struct bt_message_iterator *iterator) @@ -914,6 +919,7 @@ bt_message_iterator_borrow_component( return iterator->upstream_component; } +BT_EXPORT struct bt_self_component *bt_self_message_iterator_borrow_component( struct bt_self_message_iterator *self_iterator) { @@ -924,6 +930,7 @@ struct bt_self_component *bt_self_message_iterator_borrow_component( return (void *) iterator->upstream_component; } +BT_EXPORT struct bt_self_component_port_output *bt_self_message_iterator_borrow_port( struct bt_self_message_iterator *self_iterator) { @@ -937,6 +944,7 @@ struct bt_self_component_port_output *bt_self_message_iterator_borrow_port( #define CAN_SEEK_NS_FROM_ORIGIN_METHOD_NAME \ "bt_message_iterator_class_can_seek_ns_from_origin_method" +BT_EXPORT enum bt_message_iterator_can_seek_ns_from_origin_status bt_message_iterator_can_seek_ns_from_origin( struct bt_message_iterator *iterator, @@ -1014,6 +1022,7 @@ end: #define CAN_SEEK_BEGINNING_METHOD_NAME \ "bt_message_iterator_class_can_seek_beginning" +BT_EXPORT enum bt_message_iterator_can_seek_beginning_status bt_message_iterator_can_seek_beginning( struct bt_message_iterator *iterator, @@ -1113,6 +1122,7 @@ bool message_iterator_can_seek_beginning( #define SEEK_BEGINNING_METHOD_NAME \ "bt_message_iterator_class_seek_beginning_method" +BT_EXPORT enum bt_message_iterator_seek_beginning_status bt_message_iterator_seek_beginning(struct bt_message_iterator *iterator) { @@ -1162,6 +1172,7 @@ bt_message_iterator_seek_beginning(struct bt_message_iterator *iterator) return status; } +BT_EXPORT bt_bool bt_message_iterator_can_seek_forward( bt_message_iterator *iterator) @@ -1709,6 +1720,7 @@ bool message_iterator_can_seek_ns_from_origin( "bt_message_iterator_class_seek_ns_from_origin_method" +BT_EXPORT enum bt_message_iterator_seek_ns_from_origin_status bt_message_iterator_seek_ns_from_origin( struct bt_message_iterator *iterator, @@ -1985,6 +1997,7 @@ end: return status; } +BT_EXPORT bt_bool bt_self_message_iterator_is_interrupted( const struct bt_self_message_iterator *self_msg_iter) { @@ -1995,12 +2008,14 @@ bt_bool bt_self_message_iterator_is_interrupted( return (bt_bool) bt_graph_is_interrupted(iterator->graph); } +BT_EXPORT void bt_message_iterator_get_ref( const struct bt_message_iterator *iterator) { bt_object_get_ref(iterator); } +BT_EXPORT void bt_message_iterator_put_ref( const struct bt_message_iterator *iterator) { diff --git a/src/lib/graph/message-iterator-class.c b/src/lib/graph/message-iterator-class.c index 4322f4fe..9e5e3016 100644 --- a/src/lib/graph/message-iterator-class.c +++ b/src/lib/graph/message-iterator-class.c @@ -18,7 +18,6 @@ (_msg_iter_cls), "Message iterator class", \ ": %!+I", (_msg_iter_cls)) -BT_HIDDEN void _bt_message_iterator_class_freeze( const struct bt_message_iterator_class *msg_iter_cls) { @@ -27,12 +26,14 @@ void _bt_message_iterator_class_freeze( ((struct bt_message_iterator_class *) msg_iter_cls)->frozen = true; } +BT_EXPORT void bt_message_iterator_class_get_ref( const bt_message_iterator_class *message_iterator_class) { bt_object_get_ref(message_iterator_class); } +BT_EXPORT void bt_message_iterator_class_put_ref( const bt_message_iterator_class *message_iterator_class) { @@ -52,6 +53,7 @@ void destroy_iterator_class(struct bt_object *obj) g_free(class); } +BT_EXPORT struct bt_message_iterator_class *bt_message_iterator_class_create( bt_message_iterator_class_next_method next_method) { @@ -77,6 +79,7 @@ end: return message_iterator_class; } +BT_EXPORT bt_message_iterator_class_set_method_status bt_message_iterator_class_set_initialize_method( bt_message_iterator_class *message_iterator_class, @@ -92,6 +95,7 @@ bt_message_iterator_class_set_initialize_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT bt_message_iterator_class_set_method_status bt_message_iterator_class_set_finalize_method( bt_message_iterator_class *message_iterator_class, @@ -107,6 +111,7 @@ bt_message_iterator_class_set_finalize_method( return BT_FUNC_STATUS_OK; } +BT_EXPORT bt_message_iterator_class_set_method_status bt_message_iterator_class_set_seek_ns_from_origin_methods( bt_message_iterator_class *message_iterator_class, @@ -124,6 +129,7 @@ bt_message_iterator_class_set_seek_ns_from_origin_methods( return BT_FUNC_STATUS_OK; } +BT_EXPORT bt_message_iterator_class_set_method_status bt_message_iterator_class_set_seek_beginning_methods( bt_message_iterator_class *message_iterator_class, diff --git a/src/lib/graph/message-iterator-class.h b/src/lib/graph/message-iterator-class.h index 538f5b4a..50785695 100644 --- a/src/lib/graph/message-iterator-class.h +++ b/src/lib/graph/message-iterator-class.h @@ -30,7 +30,6 @@ struct bt_message_iterator_class { } methods; }; -BT_HIDDEN void _bt_message_iterator_class_freeze( const struct bt_message_iterator_class *message_iterator_class); diff --git a/src/lib/graph/message/discarded-items.c b/src/lib/graph/message/discarded-items.c index 313348c9..4a846313 100644 --- a/src/lib/graph/message/discarded-items.c +++ b/src/lib/graph/message/discarded-items.c @@ -224,6 +224,7 @@ borrow_discarded_items_message_end_default_clock_snapshot_const( #define SC_SUPPORTS_DISC_PRECOND_ID(_item_type) \ "stream-class-supports-discarded-" _item_type +BT_EXPORT struct bt_message *bt_message_discarded_events_create( struct bt_self_message_iterator *message_iterator, const struct bt_stream *stream) @@ -236,6 +237,7 @@ struct bt_message *bt_message_discarded_events_create( SC_SUPPORTS_DISC_PRECOND_ID("events")); } +BT_EXPORT struct bt_message *bt_message_discarded_events_create_with_default_clock_snapshots( struct bt_self_message_iterator *message_iterator, const struct bt_stream *stream, uint64_t beginning_raw_value, @@ -251,6 +253,7 @@ struct bt_message *bt_message_discarded_events_create_with_default_clock_snapsho SC_SUPPORTS_DISC_PRECOND_ID("events")); } +BT_EXPORT struct bt_stream *bt_message_discarded_events_borrow_stream( struct bt_message *message) { @@ -259,6 +262,7 @@ struct bt_stream *bt_message_discarded_events_borrow_stream( return borrow_discarded_items_message_stream(message); } +BT_EXPORT void bt_message_discarded_events_set_count(struct bt_message *message, uint64_t count) { @@ -269,6 +273,7 @@ void bt_message_discarded_events_set_count(struct bt_message *message, set_discarded_items_message_count(message, count); } +BT_EXPORT const struct bt_clock_snapshot * bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const( const struct bt_message *msg) @@ -279,6 +284,7 @@ bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const( msg, __func__); } +BT_EXPORT const struct bt_clock_snapshot * bt_message_discarded_events_borrow_end_default_clock_snapshot_const( const struct bt_message *msg) @@ -289,6 +295,7 @@ bt_message_discarded_events_borrow_end_default_clock_snapshot_const( msg, __func__); } +BT_EXPORT const struct bt_stream * bt_message_discarded_events_borrow_stream_const(const struct bt_message *message) { @@ -296,6 +303,7 @@ bt_message_discarded_events_borrow_stream_const(const struct bt_message *message (void *) message); } +BT_EXPORT enum bt_property_availability bt_message_discarded_events_get_count( const struct bt_message *message, uint64_t *count) { @@ -305,6 +313,7 @@ enum bt_property_availability bt_message_discarded_events_get_count( return get_discarded_items_message_count(message, count); } +BT_EXPORT struct bt_message *bt_message_discarded_packets_create( struct bt_self_message_iterator *message_iterator, const struct bt_stream *stream) @@ -316,6 +325,7 @@ struct bt_message *bt_message_discarded_packets_create( false, 0, 0, __func__, SC_SUPPORTS_DISC_PRECOND_ID("packets")); } +BT_EXPORT struct bt_message *bt_message_discarded_packets_create_with_default_clock_snapshots( struct bt_self_message_iterator *message_iterator, const struct bt_stream *stream, uint64_t beginning_raw_value, @@ -331,6 +341,7 @@ struct bt_message *bt_message_discarded_packets_create_with_default_clock_snapsh SC_SUPPORTS_DISC_PRECOND_ID("packets")); } +BT_EXPORT struct bt_stream *bt_message_discarded_packets_borrow_stream( struct bt_message *message) { @@ -339,6 +350,7 @@ struct bt_stream *bt_message_discarded_packets_borrow_stream( return borrow_discarded_items_message_stream(message); } +BT_EXPORT void bt_message_discarded_packets_set_count(struct bt_message *message, uint64_t count) { @@ -349,6 +361,7 @@ void bt_message_discarded_packets_set_count(struct bt_message *message, set_discarded_items_message_count(message, count); } +BT_EXPORT const struct bt_clock_snapshot * bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const( const struct bt_message *msg) @@ -359,6 +372,7 @@ bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const( msg, __func__); } +BT_EXPORT const struct bt_clock_snapshot * bt_message_discarded_packets_borrow_end_default_clock_snapshot_const( const struct bt_message *msg) @@ -369,6 +383,7 @@ bt_message_discarded_packets_borrow_end_default_clock_snapshot_const( msg, __func__); } +BT_EXPORT const struct bt_stream * bt_message_discarded_packets_borrow_stream_const(const struct bt_message *message) { @@ -376,6 +391,7 @@ bt_message_discarded_packets_borrow_stream_const(const struct bt_message *messag (void *) message); } +BT_EXPORT enum bt_property_availability bt_message_discarded_packets_get_count( const struct bt_message *message, uint64_t *count) { @@ -396,6 +412,7 @@ borrow_discarded_items_message_stream_class_default_clock_class( return disc_items_msg->stream->class->default_clock_class; } +BT_EXPORT const struct bt_clock_class * bt_message_discarded_events_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) @@ -406,6 +423,7 @@ bt_message_discarded_events_borrow_stream_class_default_clock_class_const( msg); } +BT_EXPORT const struct bt_clock_class * bt_message_discarded_packets_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) diff --git a/src/lib/graph/message/event.c b/src/lib/graph/message/event.c index 932a598e..28bb1d4f 100644 --- a/src/lib/graph/message/event.c +++ b/src/lib/graph/message/event.c @@ -30,7 +30,6 @@ BT_ASSERT_PRE_DEV_MSG_HAS_TYPE("message", (_msg), "event", \ BT_MESSAGE_TYPE_EVENT) -BT_HIDDEN struct bt_message *bt_message_event_new( struct bt_graph *graph) { @@ -202,6 +201,7 @@ end: return (void *) message; } +BT_EXPORT struct bt_message *bt_message_event_create( struct bt_self_message_iterator *msg_iter, const struct bt_event_class *event_class, @@ -213,6 +213,7 @@ struct bt_message *bt_message_event_create( false, 0, __func__); } +BT_EXPORT struct bt_message *bt_message_event_create_with_packet( struct bt_self_message_iterator *msg_iter, const struct bt_event_class *event_class, @@ -224,6 +225,7 @@ struct bt_message *bt_message_event_create_with_packet( packet->stream, false, 0, __func__); } +BT_EXPORT struct bt_message *bt_message_event_create_with_default_clock_snapshot( struct bt_self_message_iterator *msg_iter, const struct bt_event_class *event_class, @@ -236,6 +238,7 @@ struct bt_message *bt_message_event_create_with_default_clock_snapshot( true, raw_value, __func__); } +BT_EXPORT struct bt_message * bt_message_event_create_with_packet_and_default_clock_snapshot( struct bt_self_message_iterator *msg_iter, @@ -249,7 +252,6 @@ bt_message_event_create_with_packet_and_default_clock_snapshot( packet->stream, true, raw_value, __func__); } -BT_HIDDEN void bt_message_event_destroy(struct bt_message *msg) { struct bt_message_event *event_msg = (void *) msg; @@ -270,7 +272,6 @@ void bt_message_event_destroy(struct bt_message *msg) g_free(msg); } -BT_HIDDEN void bt_message_event_recycle(struct bt_message *msg) { struct bt_message_event *event_msg = (void *) msg; @@ -316,6 +317,7 @@ struct bt_event *borrow_event(struct bt_message *message) return event_message->event; } +BT_EXPORT struct bt_event *bt_message_event_borrow_event( struct bt_message *message) { @@ -323,6 +325,7 @@ struct bt_event *bt_message_event_borrow_event( return borrow_event(message); } +BT_EXPORT const struct bt_event *bt_message_event_borrow_event_const( const struct bt_message *message) { @@ -330,6 +333,7 @@ const struct bt_event *bt_message_event_borrow_event_const( return borrow_event((void *) message); } +BT_EXPORT const struct bt_clock_snapshot * bt_message_event_borrow_default_clock_snapshot_const( const struct bt_message *msg) @@ -346,6 +350,7 @@ bt_message_event_borrow_default_clock_snapshot_const( return event_msg->default_cs; } +BT_EXPORT const bt_clock_class * bt_message_event_borrow_stream_class_default_clock_class_const( const bt_message *msg) diff --git a/src/lib/graph/message/event.h b/src/lib/graph/message/event.h index ee366e32..af052d3f 100644 --- a/src/lib/graph/message/event.h +++ b/src/lib/graph/message/event.h @@ -26,13 +26,10 @@ struct bt_message_event { struct bt_clock_snapshot *default_cs; }; -BT_HIDDEN struct bt_message *bt_message_event_new(struct bt_graph *graph); -BT_HIDDEN void bt_message_event_recycle(struct bt_message *msg); -BT_HIDDEN void bt_message_event_destroy(struct bt_message *msg); #ifdef __cplusplus diff --git a/src/lib/graph/message/iterator.h b/src/lib/graph/message/iterator.h index b587735d..08257534 100644 --- a/src/lib/graph/message/iterator.h +++ b/src/lib/graph/message/iterator.h @@ -183,11 +183,9 @@ struct bt_message_iterator { void *user_data; }; -BT_HIDDEN void bt_message_iterator_try_finalize( struct bt_message_iterator *iterator); -BT_HIDDEN void bt_message_iterator_set_connection( struct bt_message_iterator *iterator, struct bt_connection *connection); diff --git a/src/lib/graph/message/message-iterator-inactivity.c b/src/lib/graph/message/message-iterator-inactivity.c index 89302ff2..3006811f 100644 --- a/src/lib/graph/message/message-iterator-inactivity.c +++ b/src/lib/graph/message/message-iterator-inactivity.c @@ -34,6 +34,7 @@ void bt_message_message_iterator_inactivity_destroy(struct bt_object *obj) g_free(message); } +BT_EXPORT struct bt_message *bt_message_message_iterator_inactivity_create( struct bt_self_message_iterator *self_msg_iter, const struct bt_clock_class *clock_class, @@ -79,7 +80,8 @@ end: return (void *) ret_msg; } -extern const struct bt_clock_snapshot * +BT_EXPORT +const struct bt_clock_snapshot * bt_message_message_iterator_inactivity_borrow_clock_snapshot_const( const bt_message *msg) { diff --git a/src/lib/graph/message/message.c b/src/lib/graph/message/message.c index f5e21c3e..02c3e64b 100644 --- a/src/lib/graph/message/message.c +++ b/src/lib/graph/message/message.c @@ -14,7 +14,6 @@ #include "lib/graph/message/message.h" #include "lib/graph/graph.h" -BT_HIDDEN void bt_message_init(struct bt_message *message, enum bt_message_type type, bt_object_release_func release, @@ -29,6 +28,7 @@ void bt_message_init(struct bt_message *message, } } +BT_EXPORT enum bt_message_type bt_message_get_type( const struct bt_message *message) { @@ -36,18 +36,19 @@ enum bt_message_type bt_message_get_type( return message->type; } -BT_HIDDEN void bt_message_unlink_graph(struct bt_message *msg) { BT_ASSERT(msg); msg->graph = NULL; } +BT_EXPORT void bt_message_get_ref(const struct bt_message *message) { bt_object_get_ref(message); } +BT_EXPORT void bt_message_put_ref(const struct bt_message *message) { bt_object_put_ref(message); diff --git a/src/lib/graph/message/message.h b/src/lib/graph/message/message.h index 791ac9ae..78f2fb9a 100644 --- a/src/lib/graph/message/message.h +++ b/src/lib/graph/message/message.h @@ -39,7 +39,6 @@ struct bt_message { struct bt_graph *graph; }; -BT_HIDDEN void bt_message_init(struct bt_message *message, enum bt_message_type type, bt_object_release_func release, @@ -86,7 +85,6 @@ static inline void _bt_message_freeze(struct bt_message *message) message->frozen = BT_TRUE; } -BT_HIDDEN void bt_message_unlink_graph(struct bt_message *msg); #ifdef BT_DEV_MODE diff --git a/src/lib/graph/message/packet.c b/src/lib/graph/message/packet.c index e27c766c..b956b106 100644 --- a/src/lib/graph/message/packet.c +++ b/src/lib/graph/message/packet.c @@ -73,14 +73,12 @@ end: return (void *) message; } -BT_HIDDEN struct bt_message *bt_message_packet_beginning_new(struct bt_graph *graph) { return new_packet_message(graph, BT_MESSAGE_TYPE_PACKET_BEGINNING, (bt_object_release_func) bt_message_packet_beginning_recycle); } -BT_HIDDEN struct bt_message *bt_message_packet_end_new(struct bt_graph *graph) { return new_packet_message(graph, BT_MESSAGE_TYPE_PACKET_END, @@ -173,6 +171,7 @@ end: return (void *) message; } +BT_EXPORT struct bt_message *bt_message_packet_beginning_create( struct bt_self_message_iterator *self_msg_iter, const struct bt_packet *packet) @@ -186,6 +185,7 @@ struct bt_message *bt_message_packet_beginning_create( &msg_iter->graph->packet_begin_msg_pool, false, 0, __func__); } +BT_EXPORT struct bt_message *bt_message_packet_beginning_create_with_default_clock_snapshot( struct bt_self_message_iterator *self_msg_iter, const struct bt_packet *packet, uint64_t raw_value) @@ -200,6 +200,7 @@ struct bt_message *bt_message_packet_beginning_create_with_default_clock_snapsho __func__); } +BT_EXPORT struct bt_message *bt_message_packet_end_create( struct bt_self_message_iterator *self_msg_iter, const struct bt_packet *packet) @@ -213,6 +214,7 @@ struct bt_message *bt_message_packet_end_create( &msg_iter->graph->packet_end_msg_pool, false, 0, __func__); } +BT_EXPORT struct bt_message *bt_message_packet_end_create_with_default_clock_snapshot( struct bt_self_message_iterator *self_msg_iter, const struct bt_packet *packet, uint64_t raw_value) @@ -227,7 +229,6 @@ struct bt_message *bt_message_packet_end_create_with_default_clock_snapshot( __func__); } -BT_HIDDEN void bt_message_packet_destroy(struct bt_message *msg) { struct bt_message_packet *packet_msg = (void *) msg; @@ -263,7 +264,6 @@ void recycle_packet_message(struct bt_message *msg, struct bt_object_pool *pool) bt_object_pool_recycle_object(pool, msg); } -BT_HIDDEN void bt_message_packet_beginning_recycle(struct bt_message *msg) { BT_ASSERT(msg); @@ -276,7 +276,6 @@ void bt_message_packet_beginning_recycle(struct bt_message *msg) recycle_packet_message(msg, &msg->graph->packet_begin_msg_pool); } -BT_HIDDEN void bt_message_packet_end_recycle(struct bt_message *msg) { BT_ASSERT(msg); @@ -289,6 +288,7 @@ void bt_message_packet_end_recycle(struct bt_message *msg) recycle_packet_message(msg, &msg->graph->packet_end_msg_pool); } +BT_EXPORT struct bt_packet *bt_message_packet_beginning_borrow_packet( struct bt_message *message) { @@ -299,6 +299,7 @@ struct bt_packet *bt_message_packet_beginning_borrow_packet( return packet_msg->packet; } +BT_EXPORT const struct bt_packet *bt_message_packet_beginning_borrow_packet_const( const struct bt_message *message) { @@ -306,6 +307,7 @@ const struct bt_packet *bt_message_packet_beginning_borrow_packet_const( (void *) message); } +BT_EXPORT struct bt_packet *bt_message_packet_end_borrow_packet( struct bt_message *message) { @@ -316,6 +318,7 @@ struct bt_packet *bt_message_packet_end_borrow_packet( return packet_msg->packet; } +BT_EXPORT const struct bt_packet *bt_message_packet_end_borrow_packet_const( const struct bt_message *message) { @@ -338,6 +341,7 @@ borrow_packet_message_default_clock_snapshot_const( return packet_msg->default_cs; } +BT_EXPORT const struct bt_clock_snapshot * bt_message_packet_beginning_borrow_default_clock_snapshot_const( const struct bt_message *msg) @@ -349,6 +353,7 @@ bt_message_packet_beginning_borrow_default_clock_snapshot_const( return borrow_packet_message_default_clock_snapshot_const(msg); } +BT_EXPORT const struct bt_clock_snapshot * bt_message_packet_end_borrow_default_clock_snapshot_const( const struct bt_message *msg) @@ -371,6 +376,7 @@ borrow_packet_message_stream_class_default_clock_class( return packet_msg->packet->stream->class->default_clock_class; } +BT_EXPORT const struct bt_clock_class * bt_message_packet_beginning_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) @@ -380,6 +386,7 @@ bt_message_packet_beginning_borrow_stream_class_default_clock_class_const( return borrow_packet_message_stream_class_default_clock_class(msg); } +BT_EXPORT const struct bt_clock_class * bt_message_packet_end_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) diff --git a/src/lib/graph/message/packet.h b/src/lib/graph/message/packet.h index 4a13d794..2915712a 100644 --- a/src/lib/graph/message/packet.h +++ b/src/lib/graph/message/packet.h @@ -22,19 +22,14 @@ struct bt_message_packet { struct bt_clock_snapshot *default_cs; }; -BT_HIDDEN void bt_message_packet_destroy(struct bt_message *msg); -BT_HIDDEN struct bt_message *bt_message_packet_beginning_new( struct bt_graph *graph); -BT_HIDDEN void bt_message_packet_beginning_recycle(struct bt_message *msg); -BT_HIDDEN struct bt_message *bt_message_packet_end_new(struct bt_graph *graph); -BT_HIDDEN void bt_message_packet_end_recycle(struct bt_message *msg); #endif /* BABELTRACE_GRAPH_MESSAGE_PACKET_INTERNAL_H */ diff --git a/src/lib/graph/message/stream.c b/src/lib/graph/message/stream.c index a3723e4a..86ec69eb 100644 --- a/src/lib/graph/message/stream.c +++ b/src/lib/graph/message/stream.c @@ -99,6 +99,7 @@ end: return &message->parent; } +BT_EXPORT struct bt_message *bt_message_stream_beginning_create( struct bt_self_message_iterator *self_msg_iter, const struct bt_stream *stream) @@ -109,6 +110,7 @@ struct bt_message *bt_message_stream_beginning_create( BT_MESSAGE_TYPE_STREAM_BEGINNING, __func__); } +BT_EXPORT struct bt_message *bt_message_stream_end_create( struct bt_self_message_iterator *self_msg_iter, const struct bt_stream *stream) @@ -129,6 +131,7 @@ struct bt_stream *borrow_stream_message_stream(struct bt_message *message) return stream_msg->stream; } +BT_EXPORT struct bt_stream *bt_message_stream_beginning_borrow_stream( struct bt_message *message) { @@ -137,6 +140,7 @@ struct bt_stream *bt_message_stream_beginning_borrow_stream( return borrow_stream_message_stream(message); } +BT_EXPORT struct bt_stream *bt_message_stream_end_borrow_stream( struct bt_message *message) { @@ -145,6 +149,7 @@ struct bt_stream *bt_message_stream_end_borrow_stream( return borrow_stream_message_stream(message); } +BT_EXPORT const struct bt_stream *bt_message_stream_beginning_borrow_stream_const( const struct bt_message *message) { @@ -152,6 +157,7 @@ const struct bt_stream *bt_message_stream_beginning_borrow_stream_const( (void *) message); } +BT_EXPORT const struct bt_stream *bt_message_stream_end_borrow_stream_const( const struct bt_message *message) { @@ -180,6 +186,7 @@ void set_stream_default_clock_snapshot( "%![msg-]+n, value=%" PRIu64, msg, raw_value); } +BT_EXPORT void bt_message_stream_beginning_set_default_clock_snapshot( struct bt_message *message, uint64_t raw_value) { @@ -188,6 +195,7 @@ void bt_message_stream_beginning_set_default_clock_snapshot( set_stream_default_clock_snapshot(message, raw_value, __func__); } +BT_EXPORT void bt_message_stream_end_set_default_clock_snapshot( struct bt_message *message, uint64_t raw_value) { @@ -215,6 +223,7 @@ borrow_stream_message_default_clock_snapshot_const( return stream_msg->default_cs_state; } +BT_EXPORT enum bt_message_stream_clock_snapshot_state bt_message_stream_beginning_borrow_default_clock_snapshot_const( const bt_message *message, const bt_clock_snapshot **snapshot) @@ -225,6 +234,7 @@ bt_message_stream_beginning_borrow_default_clock_snapshot_const( message, snapshot, __func__); } +BT_EXPORT enum bt_message_stream_clock_snapshot_state bt_message_stream_end_borrow_default_clock_snapshot_const( const bt_message *message, const bt_clock_snapshot **snapshot) @@ -246,6 +256,7 @@ borrow_stream_message_stream_class_default_clock_class( return stream_msg->stream->class->default_clock_class; } +BT_EXPORT const struct bt_clock_class * bt_message_stream_beginning_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) @@ -255,6 +266,7 @@ bt_message_stream_beginning_borrow_stream_class_default_clock_class_const( return borrow_stream_message_stream_class_default_clock_class(msg); } +BT_EXPORT const struct bt_clock_class * bt_message_stream_end_borrow_stream_class_default_clock_class_const( const struct bt_message *msg) diff --git a/src/lib/graph/mip.c b/src/lib/graph/mip.c index 19635a6a..96fb3686 100644 --- a/src/lib/graph/mip.c +++ b/src/lib/graph/mip.c @@ -176,6 +176,7 @@ end: * When any component descriptor does not support MIP version 0, this * function returns `BT_FUNC_STATUS_NO_MATCH`. */ +BT_EXPORT enum bt_get_greatest_operative_mip_version_status bt_get_greatest_operative_mip_version( const struct bt_component_descriptor_set *comp_descr_set, @@ -218,6 +219,7 @@ end: return status; } +BT_EXPORT uint64_t bt_get_maximal_mip_version(void) { return 0; diff --git a/src/lib/graph/port.c b/src/lib/graph/port.c index 291615a8..596510ce 100644 --- a/src/lib/graph/port.c +++ b/src/lib/graph/port.c @@ -34,7 +34,6 @@ void destroy_port(struct bt_object *obj) g_free(port); } -BT_HIDDEN struct bt_port *bt_port_create(struct bt_component *parent_component, enum bt_port_type type, const char *name, void *user_data) { @@ -71,18 +70,21 @@ end: return port; } +BT_EXPORT const char *bt_port_get_name(const struct bt_port *port) { BT_ASSERT_PRE_DEV_PORT_NON_NULL(port); return port->name->str; } +BT_EXPORT enum bt_port_type bt_port_get_type(const struct bt_port *port) { BT_ASSERT_PRE_DEV_PORT_NON_NULL(port); return port->type; } +BT_EXPORT const struct bt_connection *bt_port_borrow_connection_const( const struct bt_port *port) { @@ -90,6 +92,7 @@ const struct bt_connection *bt_port_borrow_connection_const( return port->connection; } +BT_EXPORT const struct bt_component *bt_port_borrow_component_const( const struct bt_port *port) { @@ -97,6 +100,7 @@ const struct bt_component *bt_port_borrow_component_const( return bt_port_borrow_component_inline(port); } +BT_EXPORT struct bt_self_component *bt_self_component_port_borrow_component( struct bt_self_component_port *port) { @@ -104,7 +108,6 @@ struct bt_self_component *bt_self_component_port_borrow_component( return (void *) bt_object_borrow_parent((void *) port); } -BT_HIDDEN void bt_port_set_connection(struct bt_port *port, struct bt_connection *connection) { @@ -118,43 +121,51 @@ void bt_port_set_connection(struct bt_port *port, connection); } +BT_EXPORT bt_bool bt_port_is_connected(const struct bt_port *port) { BT_ASSERT_PRE_DEV_PORT_NON_NULL(port); return port->connection ? BT_TRUE : BT_FALSE; } +BT_EXPORT void *bt_self_component_port_get_data(const struct bt_self_component_port *port) { BT_ASSERT_PRE_DEV_PORT_NON_NULL(port); return ((struct bt_port *) port)->user_data; } +BT_EXPORT void bt_port_get_ref(const struct bt_port *port) { bt_object_get_ref(port); } +BT_EXPORT void bt_port_put_ref(const struct bt_port *port) { bt_object_put_ref(port); } +BT_EXPORT void bt_port_input_get_ref(const struct bt_port_input *port_input) { bt_object_get_ref(port_input); } +BT_EXPORT void bt_port_input_put_ref(const struct bt_port_input *port_input) { bt_object_put_ref(port_input); } +BT_EXPORT void bt_port_output_get_ref(const struct bt_port_output *port_output) { bt_object_get_ref(port_output); } +BT_EXPORT void bt_port_output_put_ref(const struct bt_port_output *port_output) { bt_object_put_ref(port_output); diff --git a/src/lib/graph/port.h b/src/lib/graph/port.h index 674ca5bd..6f907dbc 100644 --- a/src/lib/graph/port.h +++ b/src/lib/graph/port.h @@ -21,11 +21,9 @@ struct bt_port { struct bt_component; -BT_HIDDEN struct bt_port *bt_port_create(struct bt_component *parent_component, enum bt_port_type type, const char *name, void *user_data); -BT_HIDDEN void bt_port_set_connection(struct bt_port *port, struct bt_connection *connection); diff --git a/src/lib/graph/query-executor.c b/src/lib/graph/query-executor.c index e68d1e97..97a12caa 100644 --- a/src/lib/graph/query-executor.c +++ b/src/lib/graph/query-executor.c @@ -50,6 +50,7 @@ void bt_query_executor_destroy(struct bt_object *obj) g_free(query_exec); } +BT_EXPORT struct bt_query_executor *bt_query_executor_create_with_method_data( const bt_component_class *comp_cls, const char *object, const bt_value *params, void *method_data) @@ -116,6 +117,7 @@ end: return (void *) query_exec; } +BT_EXPORT struct bt_query_executor *bt_query_executor_create( const bt_component_class *comp_cls, const char *object, const bt_value *params) @@ -125,6 +127,7 @@ struct bt_query_executor *bt_query_executor_create( object, params, NULL); } +BT_EXPORT enum bt_query_executor_query_status bt_query_executor_query( struct bt_query_executor *query_exec, const struct bt_value **user_result) @@ -242,6 +245,7 @@ end: return status; } +BT_EXPORT enum bt_query_executor_add_interrupter_status bt_query_executor_add_interrupter( struct bt_query_executor *query_exec, const struct bt_interrupter *intr) @@ -257,6 +261,7 @@ enum bt_query_executor_add_interrupter_status bt_query_executor_add_interrupter( return BT_FUNC_STATUS_OK; } +BT_EXPORT bt_bool bt_query_executor_is_interrupted(const struct bt_query_executor *query_exec) { BT_ASSERT_PRE_QUERY_EXEC_NON_NULL(query_exec); @@ -264,6 +269,7 @@ bt_bool bt_query_executor_is_interrupted(const struct bt_query_executor *query_e query_exec->interrupters); } +BT_EXPORT struct bt_interrupter *bt_query_executor_borrow_default_interrupter( struct bt_query_executor *query_exec) { @@ -271,6 +277,7 @@ struct bt_interrupter *bt_query_executor_borrow_default_interrupter( return query_exec->default_interrupter; } +BT_EXPORT enum bt_query_executor_set_logging_level_status bt_query_executor_set_logging_level(struct bt_query_executor *query_exec, enum bt_logging_level log_level) @@ -280,6 +287,7 @@ bt_query_executor_set_logging_level(struct bt_query_executor *query_exec, return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_logging_level bt_query_executor_get_logging_level( const struct bt_query_executor *query_exec) { @@ -287,11 +295,13 @@ enum bt_logging_level bt_query_executor_get_logging_level( return query_exec->log_level; } +BT_EXPORT void bt_query_executor_get_ref(const struct bt_query_executor *query_executor) { bt_object_get_ref(query_executor); } +BT_EXPORT void bt_query_executor_put_ref(const struct bt_query_executor *query_executor) { bt_object_put_ref(query_executor); diff --git a/src/lib/integer-range-set.c b/src/lib/integer-range-set.c index 2f2fea7e..1e27e189 100644 --- a/src/lib/integer-range-set.c +++ b/src/lib/integer-range-set.c @@ -16,6 +16,7 @@ #include "func-status.h" #include "integer-range-set.h" +BT_EXPORT uint64_t bt_integer_range_unsigned_get_lower( const struct bt_integer_range_unsigned *u_range) { @@ -25,6 +26,7 @@ uint64_t bt_integer_range_unsigned_get_lower( return range->lower.u; } +BT_EXPORT uint64_t bt_integer_range_unsigned_get_upper( const struct bt_integer_range_unsigned *u_range) { @@ -34,6 +36,7 @@ uint64_t bt_integer_range_unsigned_get_upper( return range->upper.u; } +BT_EXPORT int64_t bt_integer_range_signed_get_lower( const struct bt_integer_range_signed *i_range) { @@ -43,6 +46,7 @@ int64_t bt_integer_range_signed_get_lower( return range->lower.i; } +BT_EXPORT int64_t bt_integer_range_signed_get_upper( const struct bt_integer_range_signed *i_range) { @@ -60,6 +64,7 @@ bool compare_ranges(const struct bt_integer_range *range_a, range_a->upper.u == range_b->upper.u; } +BT_EXPORT bt_bool bt_integer_range_unsigned_is_equal( const struct bt_integer_range_unsigned *range_a, const struct bt_integer_range_unsigned *range_b) @@ -72,6 +77,7 @@ bt_bool bt_integer_range_unsigned_is_equal( (const void *) range_b); } +BT_EXPORT bt_bool bt_integer_range_signed_is_equal( const struct bt_integer_range_signed *range_a, const struct bt_integer_range_signed *range_b) @@ -84,6 +90,7 @@ bt_bool bt_integer_range_signed_is_equal( (const void *) range_b); } +BT_EXPORT uint64_t bt_integer_range_set_get_range_count( const bt_integer_range_set *range_set) { @@ -91,6 +98,7 @@ uint64_t bt_integer_range_set_get_range_count( return (uint64_t) range_set->ranges->len; } +BT_EXPORT const struct bt_integer_range_unsigned * bt_integer_range_set_unsigned_borrow_range_by_index_const( const bt_integer_range_set_unsigned *u_range_set, @@ -105,6 +113,7 @@ bt_integer_range_set_unsigned_borrow_range_by_index_const( index); } +BT_EXPORT const struct bt_integer_range_signed * bt_integer_range_set_signed_borrow_range_by_index_const( const bt_integer_range_set_signed *i_range_set, uint64_t index) @@ -166,6 +175,7 @@ end: return range_set; } +BT_EXPORT struct bt_integer_range_set_unsigned *bt_integer_range_set_unsigned_create(void) { BT_ASSERT_PRE_NO_ERROR(); @@ -173,6 +183,7 @@ struct bt_integer_range_set_unsigned *bt_integer_range_set_unsigned_create(void) return (void *) create_range_set(); } +BT_EXPORT struct bt_integer_range_set_signed *bt_integer_range_set_signed_create(void) { BT_ASSERT_PRE_NO_ERROR(); @@ -198,6 +209,7 @@ void add_range_to_range_set(struct bt_integer_range_set *range_set, "upper-unsigned=%" PRIu64, range_set, u_lower, u_upper); } +BT_EXPORT enum bt_integer_range_set_add_range_status bt_integer_range_set_unsigned_add_range( struct bt_integer_range_set_unsigned *range_set, @@ -211,6 +223,7 @@ bt_integer_range_set_unsigned_add_range( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_integer_range_set_add_range_status bt_integer_range_set_signed_add_range( struct bt_integer_range_set_signed *range_set, @@ -225,7 +238,6 @@ bt_integer_range_set_signed_add_range( return BT_FUNC_STATUS_OK; } -BT_HIDDEN void _bt_integer_range_set_freeze(const struct bt_integer_range_set *range_set) { BT_ASSERT(range_set); @@ -233,7 +245,6 @@ void _bt_integer_range_set_freeze(const struct bt_integer_range_set *range_set) ((struct bt_integer_range_set *) range_set)->frozen = true; } -BT_HIDDEN bool bt_integer_range_set_unsigned_has_overlaps( const struct bt_integer_range_set *range_set) { @@ -267,7 +278,6 @@ end: return has_overlap; } -BT_HIDDEN bool bt_integer_range_set_signed_has_overlaps( const struct bt_integer_range_set *range_set) { @@ -351,6 +361,7 @@ end: return is_equal; } +BT_EXPORT bt_bool bt_integer_range_set_unsigned_is_equal( const struct bt_integer_range_set_unsigned *range_set_a, const struct bt_integer_range_set_unsigned *range_set_b) @@ -363,6 +374,7 @@ bt_bool bt_integer_range_set_unsigned_is_equal( (const void *) range_set_b); } +BT_EXPORT bt_bool bt_integer_range_set_signed_is_equal( const struct bt_integer_range_set_signed *range_set_a, const struct bt_integer_range_set_signed *range_set_b) @@ -375,24 +387,28 @@ bt_bool bt_integer_range_set_signed_is_equal( (const void *) range_set_b); } +BT_EXPORT void bt_integer_range_set_unsigned_get_ref( const struct bt_integer_range_set_unsigned *range_set) { bt_object_get_ref(range_set); } +BT_EXPORT void bt_integer_range_set_unsigned_put_ref( const struct bt_integer_range_set_unsigned *range_set) { bt_object_put_ref(range_set); } +BT_EXPORT void bt_integer_range_set_signed_get_ref( const struct bt_integer_range_set_signed *range_set) { bt_object_get_ref(range_set); } +BT_EXPORT void bt_integer_range_set_signed_put_ref( const struct bt_integer_range_set_signed *range_set) { diff --git a/src/lib/integer-range-set.h b/src/lib/integer-range-set.h index 666f82e6..69e51993 100644 --- a/src/lib/integer-range-set.h +++ b/src/lib/integer-range-set.h @@ -39,7 +39,6 @@ struct bt_integer_range_set { bool frozen; }; -BT_HIDDEN void _bt_integer_range_set_freeze(const struct bt_integer_range_set *range_set); #ifdef BT_DEV_MODE @@ -48,11 +47,9 @@ void _bt_integer_range_set_freeze(const struct bt_integer_range_set *range_set); # define bt_integer_range_set_freeze(_sc) #endif -BT_HIDDEN bool bt_integer_range_set_unsigned_has_overlaps( const struct bt_integer_range_set *range_set); -BT_HIDDEN bool bt_integer_range_set_signed_has_overlaps( const struct bt_integer_range_set *range_set); diff --git a/src/lib/lib-logging.c b/src/lib/lib-logging.c index df73244b..b0b3488b 100644 --- a/src/lib/lib-logging.c +++ b/src/lib/lib-logging.c @@ -1484,6 +1484,13 @@ update_fmt: *out_fmt_ch = fmt_ch; } +/* + * This function would normally not be BT_EXPORTed, but it is used by the + * Python plugin provider, which is conceptually part of libbabeltrace2, but + * implemented as a separate shared object, for modularity. It is therefore + * exposed, but not part of the public ABI. + */ +BT_EXPORT void bt_lib_log_v(const char *func, const char *file, unsigned line, int lvl, const char *tag, const char *fmt, va_list *args) { @@ -1493,6 +1500,13 @@ void bt_lib_log_v(const char *func, const char *file, unsigned line, _bt_log_write_d(func, file, line, lvl, tag, "%s", lib_logging_buf); } +/* + * This function would normally not be BT_EXPORTed, but it is used by the + * Python plugin provider, which is conceptually part of libbabeltrace2, but + * implemented as a separate shared object, for modularity. It is therefore + * exposed, but not part of the public ABI. + */ +BT_EXPORT void bt_lib_log(const char *func, const char *file, unsigned line, int lvl, const char *tag, const char *fmt, ...) { @@ -1504,6 +1518,13 @@ void bt_lib_log(const char *func, const char *file, unsigned line, va_end(args); } +/* + * This function would normally not be BT_EXPORTed, but it is used by the + * Python plugin provider, which is conceptually part of libbabeltrace2, but + * implemented as a separate shared object, for modularity. It is therefore + * exposed, but not part of the ABI. + */ +BT_EXPORT void bt_lib_maybe_log_and_append_cause(const char *func, const char *file, unsigned line, int lvl, const char *tag, const char *fmt, ...) diff --git a/src/lib/logging.c b/src/lib/logging.c index 5502610f..05b43ab0 100644 --- a/src/lib/logging.c +++ b/src/lib/logging.c @@ -22,18 +22,22 @@ * `LIBBABELTRACE2_INIT_LOG_LEVEL` environment variable to enable * logging. */ +BT_EXPORT int bt_lib_log_level = BT_LOG_NONE; +BT_EXPORT enum bt_logging_level bt_logging_get_minimal_level(void) { return BT_MINIMAL_LOG_LEVEL; } +BT_EXPORT enum bt_logging_level bt_logging_get_global_level(void) { return bt_lib_log_level; } +BT_EXPORT void bt_logging_set_global_level(enum bt_logging_level log_level) { bt_lib_log_level = log_level; diff --git a/src/lib/logging.h b/src/lib/logging.h index 8462e47c..7a5aafc8 100644 --- a/src/lib/logging.h +++ b/src/lib/logging.h @@ -48,11 +48,6 @@ int bt_lib_log_level; * * Use one of the BT_LIB_LOG*() macros above instead of calling this * function directly. - * - * This function would normally be BT_HIDDEN, but it is used by the Python - * plugin provider, which is conceptually part of libbabeltrace2, but - * implemented as a separate shared object, for modularity. It is therefore - * exposed, but not part of the public ABI. */ void bt_lib_log(const char *func, const char *file, unsigned line, int lvl, const char *tag, const char *fmt, ...); @@ -85,11 +80,6 @@ void bt_lib_log_v(const char *func, const char *file, unsigned line, * * Use one of the BT_LIB_LOG*_APPEND_CAUSE() macros above instead of * calling this function directly. - * - * This function would normally be BT_HIDDEN, but it is used by the Python - * plugin provider, which is conceptually part of libbabeltrace2, but - * implemented as a separate shared object, for modularity. It is therefore - * exposed, but not part of the ABI. */ void bt_lib_maybe_log_and_append_cause(const char *func, const char *file, unsigned line, int lvl, const char *tag, diff --git a/src/lib/object-pool.h b/src/lib/object-pool.h index 5f65c59d..e0501daf 100644 --- a/src/lib/object-pool.h +++ b/src/lib/object-pool.h @@ -72,7 +72,6 @@ struct bt_object_pool { /* * Initializes an object pool which is already allocated. */ -BT_HIDDEN int bt_object_pool_initialize(struct bt_object_pool *pool, bt_object_pool_new_object_func new_object_func, bt_object_pool_destroy_object_func destroy_object_func, @@ -81,7 +80,6 @@ int bt_object_pool_initialize(struct bt_object_pool *pool, /* * Finalizes an object pool without deallocating it. */ -BT_HIDDEN void bt_object_pool_finalize(struct bt_object_pool *pool); /* diff --git a/src/lib/plugin/plugin-so.c b/src/lib/plugin/plugin-so.c index 3017e6c0..65ec447d 100644 --- a/src/lib/plugin/plugin-so.c +++ b/src/lib/plugin/plugin-so.c @@ -1368,7 +1368,6 @@ end: return status; } -BT_HIDDEN int bt_plugin_so_create_all_from_static(bool fail_on_load_error, struct bt_plugin_set **plugin_set_out) { @@ -1405,7 +1404,6 @@ end: return status; } -BT_HIDDEN int bt_plugin_so_create_all_from_file(const char *path, bool fail_on_load_error, struct bt_plugin_set **plugin_set_out) { @@ -1672,6 +1670,13 @@ void plugin_comp_class_destroy_listener(struct bt_component_class *comp_class, "comp-cls-addr=%p", comp_class); } +/* + * This function would normally not be BT_EXPORTed, but it is used by the + * Python plugin provider, which is conceptually part of libbabeltrace2, but + * implemented as a separate shared object, for modularity. It is therefore + * exposed, but not part of the public ABI. + */ +BT_EXPORT void bt_plugin_so_on_add_component_class(struct bt_plugin *plugin, struct bt_component_class *comp_class) { diff --git a/src/lib/plugin/plugin-so.h b/src/lib/plugin/plugin-so.h index c341749b..0ba19caa 100644 --- a/src/lib/plugin/plugin-so.h +++ b/src/lib/plugin/plugin-so.h @@ -37,20 +37,12 @@ struct bt_plugin_so_spec_data { const struct __bt_plugin_descriptor_version *version; }; -BT_HIDDEN int bt_plugin_so_create_all_from_file(const char *path, bool fail_on_load_error, struct bt_plugin_set **plugin_set_out); -BT_HIDDEN int bt_plugin_so_create_all_from_static(bool fail_on_load_error, struct bt_plugin_set **plugin_set_out); -/* - * This function would normally be BT_HIDDEN, but it is used by the Python - * plugin provider, which is conceptually part of libbabeltrace2, but - * implemented as a separate shared object, for modularity. It is therefore - * exposed, but not part of the public ABI. - */ void bt_plugin_so_on_add_component_class(struct bt_plugin *plugin, struct bt_component_class *comp_class); diff --git a/src/lib/plugin/plugin.c b/src/lib/plugin/plugin.c index 434bb3ea..547859f8 100644 --- a/src/lib/plugin/plugin.c +++ b/src/lib/plugin/plugin.c @@ -153,12 +153,14 @@ void fini_python_plugin_provider(void) { } #endif +BT_EXPORT uint64_t bt_plugin_set_get_plugin_count(const struct bt_plugin_set *plugin_set) { BT_ASSERT_PRE_DEV_PLUGIN_SET_NON_NULL(plugin_set); return (uint64_t) plugin_set->plugins->len; } +BT_EXPORT const struct bt_plugin *bt_plugin_set_borrow_plugin_by_index_const( const struct bt_plugin_set *plugin_set, uint64_t index) { @@ -167,6 +169,7 @@ const struct bt_plugin *bt_plugin_set_borrow_plugin_by_index_const( return g_ptr_array_index(plugin_set->plugins, index); } +BT_EXPORT enum bt_plugin_find_all_from_static_status bt_plugin_find_all_from_static( bt_bool fail_on_load_error, const struct bt_plugin_set **plugin_set_out) @@ -178,6 +181,7 @@ enum bt_plugin_find_all_from_static_status bt_plugin_find_all_from_static( (void *) plugin_set_out); } +BT_EXPORT enum bt_plugin_find_all_from_file_status bt_plugin_find_all_from_file( const char *path, bt_bool fail_on_load_error, const struct bt_plugin_set **plugin_set_out) @@ -256,6 +260,7 @@ void destroy_gstring(void *data) g_string_free(data, TRUE); } +BT_EXPORT enum bt_plugin_find_all_status bt_plugin_find_all(bt_bool find_in_std_env_var, bt_bool find_in_user_dir, bt_bool find_in_sys_dir, bt_bool find_in_static, bt_bool fail_on_load_error, @@ -443,6 +448,7 @@ end: return status; } +BT_EXPORT enum bt_plugin_find_status bt_plugin_find(const char *plugin_name, bt_bool find_in_std_env_var, bt_bool find_in_user_dir, bt_bool find_in_sys_dir, bt_bool find_in_static, @@ -647,6 +653,7 @@ end: return status; } +BT_EXPORT enum bt_plugin_find_all_from_dir_status bt_plugin_find_all_from_dir( const char *path, bt_bool recurse, bt_bool fail_on_load_error, const struct bt_plugin_set **plugin_set_out) @@ -705,30 +712,35 @@ end: return status; } +BT_EXPORT const char *bt_plugin_get_name(const struct bt_plugin *plugin) { BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin); return plugin->info.name_set ? plugin->info.name->str : NULL; } +BT_EXPORT const char *bt_plugin_get_author(const struct bt_plugin *plugin) { BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin); return plugin->info.author_set ? plugin->info.author->str : NULL; } +BT_EXPORT const char *bt_plugin_get_license(const struct bt_plugin *plugin) { BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin); return plugin->info.license_set ? plugin->info.license->str : NULL; } +BT_EXPORT const char *bt_plugin_get_path(const struct bt_plugin *plugin) { BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin); return plugin->info.path_set ? plugin->info.path->str : NULL; } +BT_EXPORT const char *bt_plugin_get_description(const struct bt_plugin *plugin) { BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin); @@ -736,6 +748,7 @@ const char *bt_plugin_get_description(const struct bt_plugin *plugin) plugin->info.description->str : NULL; } +BT_EXPORT enum bt_property_availability bt_plugin_get_version(const struct bt_plugin *plugin, unsigned int *major, unsigned int *minor, unsigned int *patch, const char **extra) @@ -771,18 +784,21 @@ end: return avail; } +BT_EXPORT uint64_t bt_plugin_get_source_component_class_count(const struct bt_plugin *plugin) { BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin); return (uint64_t) plugin->src_comp_classes->len; } +BT_EXPORT uint64_t bt_plugin_get_filter_component_class_count(const struct bt_plugin *plugin) { BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin); return (uint64_t) plugin->flt_comp_classes->len; } +BT_EXPORT uint64_t bt_plugin_get_sink_component_class_count(const struct bt_plugin *plugin) { BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin); @@ -799,6 +815,7 @@ struct bt_component_class *borrow_component_class_by_index( return g_ptr_array_index(comp_classes, index); } +BT_EXPORT const struct bt_component_class_source * bt_plugin_borrow_source_component_class_by_index_const( const struct bt_plugin *plugin, uint64_t index) @@ -807,6 +824,7 @@ bt_plugin_borrow_source_component_class_by_index_const( plugin->src_comp_classes, index); } +BT_EXPORT const struct bt_component_class_filter * bt_plugin_borrow_filter_component_class_by_index_const( const struct bt_plugin *plugin, uint64_t index) @@ -815,6 +833,7 @@ bt_plugin_borrow_filter_component_class_by_index_const( plugin->flt_comp_classes, index); } +BT_EXPORT const struct bt_component_class_sink * bt_plugin_borrow_sink_component_class_by_index_const( const struct bt_plugin *plugin, uint64_t index) @@ -851,6 +870,7 @@ struct bt_component_class *borrow_component_class_by_name( return comp_class; } +BT_EXPORT const struct bt_component_class_source * bt_plugin_borrow_source_component_class_by_name_const( const struct bt_plugin *plugin, const char *name) @@ -859,6 +879,7 @@ bt_plugin_borrow_source_component_class_by_name_const( plugin->src_comp_classes, name); } +BT_EXPORT const struct bt_component_class_filter * bt_plugin_borrow_filter_component_class_by_name_const( const struct bt_plugin *plugin, const char *name) @@ -867,6 +888,7 @@ bt_plugin_borrow_filter_component_class_by_name_const( plugin->flt_comp_classes, name); } +BT_EXPORT const struct bt_component_class_sink * bt_plugin_borrow_sink_component_class_by_name_const( const struct bt_plugin *plugin, const char *name) @@ -875,21 +897,25 @@ bt_plugin_borrow_sink_component_class_by_name_const( plugin->sink_comp_classes, name); } +BT_EXPORT void bt_plugin_get_ref(const struct bt_plugin *plugin) { bt_object_get_ref(plugin); } +BT_EXPORT void bt_plugin_put_ref(const struct bt_plugin *plugin) { bt_object_put_ref(plugin); } +BT_EXPORT void bt_plugin_set_get_ref(const struct bt_plugin_set *plugin_set) { bt_object_get_ref(plugin_set); } +BT_EXPORT void bt_plugin_set_put_ref(const struct bt_plugin_set *plugin_set) { bt_object_put_ref(plugin_set); diff --git a/src/lib/prio-heap/prio-heap.h b/src/lib/prio-heap/prio-heap.h index 88d18712..08ae757a 100644 --- a/src/lib/prio-heap/prio-heap.h +++ b/src/lib/prio-heap/prio-heap.h @@ -49,7 +49,6 @@ static inline void *bt_heap_maximum(const struct ptr_heap *heap) * * Returns -ENOMEM if out of memory. */ -BT_HIDDEN extern int bt_heap_init(struct ptr_heap *heap, size_t alloc_len, int gt(void *a, void *b)); @@ -58,7 +57,6 @@ extern int bt_heap_init(struct ptr_heap *heap, * bt_heap_free - free the heap * @heap: the heap to free */ -BT_HIDDEN extern void bt_heap_free(struct ptr_heap *heap); /** @@ -70,7 +68,6 @@ extern void bt_heap_free(struct ptr_heap *heap); * * Returns -ENOMEM if out of memory. */ -BT_HIDDEN extern int bt_heap_insert(struct ptr_heap *heap, void *p); /** @@ -80,7 +77,6 @@ extern int bt_heap_insert(struct ptr_heap *heap, void *p); * Returns the largest element in the heap. It removes this element from the * heap. Returns NULL if the heap is empty. */ -BT_HIDDEN extern void *bt_heap_remove(struct ptr_heap *heap); /** @@ -92,7 +88,6 @@ extern void *bt_heap_remove(struct ptr_heap *heap); * return NULL. This algorithm has a complexity of O(n), which is higher than * O(log(n)) provided by the rest of this API. */ -BT_HIDDEN extern void *bt_heap_cherrypick(struct ptr_heap *heap, void *p); /** @@ -107,7 +102,6 @@ extern void *bt_heap_cherrypick(struct ptr_heap *heap, void *p); * This is the equivalent of calling bt_heap_remove() and then bt_heap_insert(), but * it only rebalances the heap once. It never allocates memory. */ -BT_HIDDEN extern void *bt_heap_replace_max(struct ptr_heap *heap, void *p); /** @@ -117,7 +111,6 @@ extern void *bt_heap_replace_max(struct ptr_heap *heap, void *p); * * Returns -ENOMEM if out of memory. */ -BT_HIDDEN extern int bt_heap_copy(struct ptr_heap *dst, struct ptr_heap *src); #endif /* _BABELTRACE_PRIO_HEAP_H */ diff --git a/src/lib/trace-ir/attributes.c b/src/lib/trace-ir/attributes.c index 68f54b86..162bc4ec 100644 --- a/src/lib/trace-ir/attributes.c +++ b/src/lib/trace-ir/attributes.c @@ -22,7 +22,6 @@ #define BT_ATTR_NAME_INDEX 0 #define BT_ATTR_VALUE_INDEX 1 -BT_HIDDEN struct bt_value *bt_attributes_create(void) { struct bt_value *attr_obj; @@ -53,20 +52,17 @@ struct bt_value *bt_attributes_create(void) return attr_obj; } -BT_HIDDEN void bt_attributes_destroy(struct bt_value *attr_obj) { BT_LOGD("Destroying attributes object: addr=%p", attr_obj); BT_OBJECT_PUT_REF_AND_RESET(attr_obj); } -BT_HIDDEN uint64_t bt_attributes_get_count(const struct bt_value *attr_obj) { return bt_value_array_get_length(attr_obj); } -BT_HIDDEN const char *bt_attributes_get_field_name(const struct bt_value *attr_obj, uint64_t index) { @@ -85,7 +81,6 @@ const char *bt_attributes_get_field_name(const struct bt_value *attr_obj, return bt_value_string_get(attr_field_name_obj); } -BT_HIDDEN struct bt_value *bt_attributes_borrow_field_value( struct bt_value *attr_obj, uint64_t index) { @@ -132,7 +127,6 @@ struct bt_value *bt_attributes_borrow_field_by_name( return value_obj; } -BT_HIDDEN int bt_attributes_set_field_value(struct bt_value *attr_obj, const char *name, struct bt_value *value_obj) { @@ -183,7 +177,6 @@ end: return ret; } -BT_HIDDEN struct bt_value *bt_attributes_borrow_field_value_by_name( struct bt_value *attr_obj, const char *name) { @@ -206,7 +199,6 @@ end: return value_obj; } -BT_HIDDEN int bt_attributes_freeze(const struct bt_value *attr_obj) { uint64_t i, count; diff --git a/src/lib/trace-ir/attributes.h b/src/lib/trace-ir/attributes.h index b4487e00..8b259cc8 100644 --- a/src/lib/trace-ir/attributes.h +++ b/src/lib/trace-ir/attributes.h @@ -16,33 +16,25 @@ extern "C" { #include "common/macros.h" #include -BT_HIDDEN struct bt_value *bt_attributes_create(void); -BT_HIDDEN void bt_attributes_destroy(struct bt_value *attr_obj); -BT_HIDDEN uint64_t bt_attributes_get_count(const struct bt_value *attr_obj); -BT_HIDDEN const char *bt_attributes_get_field_name(const struct bt_value *attr_obj, uint64_t index); -BT_HIDDEN struct bt_value *bt_attributes_borrow_field_value( struct bt_value *attr_obj, uint64_t index); -BT_HIDDEN int bt_attributes_set_field_value(struct bt_value *attr_obj, const char *name, struct bt_value *value_obj); -BT_HIDDEN struct bt_value *bt_attributes_borrow_field_value_by_name( struct bt_value *attr_obj, const char *name); -BT_HIDDEN int bt_attributes_freeze(const struct bt_value *attr_obj); #ifdef __cplusplus diff --git a/src/lib/trace-ir/clock-class.c b/src/lib/trace-ir/clock-class.c index bb507306..b4e15009 100644 --- a/src/lib/trace-ir/clock-class.c +++ b/src/lib/trace-ir/clock-class.c @@ -67,6 +67,7 @@ void set_base_offset(struct bt_clock_class *clock_class) clock_class->frequency, &clock_class->base_offset.value_ns); } +BT_EXPORT struct bt_clock_class *bt_clock_class_create(bt_self_component *self_comp) { int ret; @@ -128,12 +129,14 @@ end: return clock_class; } +BT_EXPORT const char *bt_clock_class_get_name(const struct bt_clock_class *clock_class) { BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class); return clock_class->name.value; } +BT_EXPORT enum bt_clock_class_set_name_status bt_clock_class_set_name( struct bt_clock_class *clock_class, const char *name) { @@ -147,6 +150,7 @@ enum bt_clock_class_set_name_status bt_clock_class_set_name( return BT_FUNC_STATUS_OK; } +BT_EXPORT const char *bt_clock_class_get_description( const struct bt_clock_class *clock_class) { @@ -154,6 +158,7 @@ const char *bt_clock_class_get_description( return clock_class->description.value; } +BT_EXPORT enum bt_clock_class_set_description_status bt_clock_class_set_description( struct bt_clock_class *clock_class, const char *descr) { @@ -168,12 +173,14 @@ enum bt_clock_class_set_description_status bt_clock_class_set_description( return BT_FUNC_STATUS_OK; } +BT_EXPORT uint64_t bt_clock_class_get_frequency(const struct bt_clock_class *clock_class) { BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class); return clock_class->frequency; } +BT_EXPORT void bt_clock_class_set_frequency(struct bt_clock_class *clock_class, uint64_t frequency) { @@ -192,12 +199,14 @@ void bt_clock_class_set_frequency(struct bt_clock_class *clock_class, BT_LIB_LOGD("Set clock class's frequency: %!+K", clock_class); } +BT_EXPORT uint64_t bt_clock_class_get_precision(const struct bt_clock_class *clock_class) { BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class); return clock_class->precision; } +BT_EXPORT void bt_clock_class_set_precision(struct bt_clock_class *clock_class, uint64_t precision) { @@ -210,6 +219,7 @@ void bt_clock_class_set_precision(struct bt_clock_class *clock_class, BT_LIB_LOGD("Set clock class's precision: %!+K", clock_class); } +BT_EXPORT void bt_clock_class_get_offset(const struct bt_clock_class *clock_class, int64_t *seconds, uint64_t *cycles) { @@ -221,6 +231,7 @@ void bt_clock_class_get_offset(const struct bt_clock_class *clock_class, *cycles = clock_class->offset_cycles; } +BT_EXPORT void bt_clock_class_set_offset(struct bt_clock_class *clock_class, int64_t seconds, uint64_t cycles) { @@ -236,12 +247,14 @@ void bt_clock_class_set_offset(struct bt_clock_class *clock_class, BT_LIB_LOGD("Set clock class's offset: %!+K", clock_class); } +BT_EXPORT bt_bool bt_clock_class_origin_is_unix_epoch(const struct bt_clock_class *clock_class) { BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class); return (bool) clock_class->origin_is_unix_epoch; } +BT_EXPORT void bt_clock_class_set_origin_is_unix_epoch(struct bt_clock_class *clock_class, bt_bool origin_is_unix_epoch) { @@ -252,12 +265,14 @@ void bt_clock_class_set_origin_is_unix_epoch(struct bt_clock_class *clock_class, clock_class); } +BT_EXPORT bt_uuid bt_clock_class_get_uuid(const struct bt_clock_class *clock_class) { BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class); return clock_class->uuid.value; } +BT_EXPORT void bt_clock_class_set_uuid(struct bt_clock_class *clock_class, bt_uuid uuid) { @@ -269,7 +284,6 @@ void bt_clock_class_set_uuid(struct bt_clock_class *clock_class, BT_LIB_LOGD("Set clock class's UUID: %!+K", clock_class); } -BT_HIDDEN void _bt_clock_class_freeze(const struct bt_clock_class *clock_class) { BT_ASSERT(clock_class); @@ -285,6 +299,7 @@ void _bt_clock_class_freeze(const struct bt_clock_class *clock_class) ((struct bt_clock_class *) clock_class)->frozen = 1; } +BT_EXPORT enum bt_clock_class_cycles_to_ns_from_origin_status bt_clock_class_cycles_to_ns_from_origin( const struct bt_clock_class *clock_class, @@ -309,6 +324,7 @@ bt_clock_class_cycles_to_ns_from_origin( return ret; } +BT_EXPORT const struct bt_value *bt_clock_class_borrow_user_attributes_const( const struct bt_clock_class *clock_class) { @@ -316,6 +332,7 @@ const struct bt_value *bt_clock_class_borrow_user_attributes_const( return clock_class->user_attributes; } +BT_EXPORT struct bt_value *bt_clock_class_borrow_user_attributes( struct bt_clock_class *clock_class) { @@ -323,6 +340,7 @@ struct bt_value *bt_clock_class_borrow_user_attributes( (void *) clock_class); } +BT_EXPORT void bt_clock_class_set_user_attributes( struct bt_clock_class *clock_class, const struct bt_value *user_attributes) @@ -336,11 +354,13 @@ void bt_clock_class_set_user_attributes( bt_object_get_ref_no_null_check(clock_class->user_attributes); } +BT_EXPORT void bt_clock_class_get_ref(const struct bt_clock_class *clock_class) { bt_object_get_ref(clock_class); } +BT_EXPORT void bt_clock_class_put_ref(const struct bt_clock_class *clock_class) { bt_object_put_ref(clock_class); diff --git a/src/lib/trace-ir/clock-class.h b/src/lib/trace-ir/clock-class.h index 7c5b76af..210133b8 100644 --- a/src/lib/trace-ir/clock-class.h +++ b/src/lib/trace-ir/clock-class.h @@ -81,7 +81,6 @@ struct bt_clock_class { bool frozen; }; -BT_HIDDEN void _bt_clock_class_freeze(const struct bt_clock_class *clock_class); #ifdef BT_DEV_MODE @@ -90,7 +89,6 @@ void _bt_clock_class_freeze(const struct bt_clock_class *clock_class); # define bt_clock_class_freeze(_cc) #endif -BT_HIDDEN bt_bool bt_clock_class_is_valid(struct bt_clock_class *clock_class); static inline diff --git a/src/lib/trace-ir/clock-snapshot.c b/src/lib/trace-ir/clock-snapshot.c index 55e3777b..5e2c461c 100644 --- a/src/lib/trace-ir/clock-snapshot.c +++ b/src/lib/trace-ir/clock-snapshot.c @@ -20,7 +20,6 @@ #include "common/assert.h" #include "lib/func-status.h" -BT_HIDDEN void bt_clock_snapshot_destroy(struct bt_clock_snapshot *clock_snapshot) { BT_ASSERT(clock_snapshot); @@ -29,7 +28,6 @@ void bt_clock_snapshot_destroy(struct bt_clock_snapshot *clock_snapshot) g_free(clock_snapshot); } -BT_HIDDEN struct bt_clock_snapshot *bt_clock_snapshot_new( struct bt_clock_class *clock_class) { @@ -55,7 +53,6 @@ end: return ret; } -BT_HIDDEN struct bt_clock_snapshot *bt_clock_snapshot_create( struct bt_clock_class *clock_class) { @@ -79,7 +76,6 @@ end: return clock_snapshot; } -BT_HIDDEN void bt_clock_snapshot_recycle(struct bt_clock_snapshot *clock_snapshot) { struct bt_clock_class *clock_class; @@ -117,6 +113,7 @@ void bt_clock_snapshot_recycle(struct bt_clock_snapshot *clock_snapshot) bt_object_put_ref(clock_class); } +BT_EXPORT uint64_t bt_clock_snapshot_get_value( const struct bt_clock_snapshot *clock_snapshot) { @@ -125,6 +122,7 @@ uint64_t bt_clock_snapshot_get_value( return clock_snapshot->value_cycles; } +BT_EXPORT enum bt_clock_snapshot_get_ns_from_origin_status bt_clock_snapshot_get_ns_from_origin( const struct bt_clock_snapshot *clock_snapshot, @@ -153,6 +151,7 @@ end: return ret; } +BT_EXPORT const struct bt_clock_class *bt_clock_snapshot_borrow_clock_class_const( const struct bt_clock_snapshot *clock_snapshot) { diff --git a/src/lib/trace-ir/clock-snapshot.h b/src/lib/trace-ir/clock-snapshot.h index 29de3b96..942523b4 100644 --- a/src/lib/trace-ir/clock-snapshot.h +++ b/src/lib/trace-ir/clock-snapshot.h @@ -60,17 +60,13 @@ void bt_clock_snapshot_set_raw_value(struct bt_clock_snapshot *clock_snapshot, bt_clock_snapshot_set(clock_snapshot); } -BT_HIDDEN void bt_clock_snapshot_destroy(struct bt_clock_snapshot *clock_snapshot); -BT_HIDDEN struct bt_clock_snapshot *bt_clock_snapshot_new(struct bt_clock_class *clock_class); -BT_HIDDEN struct bt_clock_snapshot *bt_clock_snapshot_create( struct bt_clock_class *clock_class); -BT_HIDDEN void bt_clock_snapshot_recycle(struct bt_clock_snapshot *clock_snapshot); #endif /* BABELTRACE_TRACE_IR_CLOCK_SNAPSHOT_INTERNAL_H */ diff --git a/src/lib/trace-ir/event-class.c b/src/lib/trace-ir/event-class.c index 871f40cb..1ba9a1ae 100644 --- a/src/lib/trace-ir/event-class.c +++ b/src/lib/trace-ir/event-class.c @@ -160,6 +160,7 @@ end: return event_class; } +BT_EXPORT struct bt_event_class *bt_event_class_create( struct bt_stream_class *stream_class) { @@ -174,6 +175,7 @@ struct bt_event_class *bt_event_class_create( (uint64_t) stream_class->event_classes->len); } +BT_EXPORT struct bt_event_class *bt_event_class_create_with_id( struct bt_stream_class *stream_class, uint64_t id) { @@ -186,12 +188,14 @@ struct bt_event_class *bt_event_class_create_with_id( return create_event_class_with_id(stream_class, id); } +BT_EXPORT const char *bt_event_class_get_name(const struct bt_event_class *event_class) { BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class); return event_class->name.value; } +BT_EXPORT enum bt_event_class_set_name_status bt_event_class_set_name( struct bt_event_class *event_class, const char *name) { @@ -205,12 +209,14 @@ enum bt_event_class_set_name_status bt_event_class_set_name( return BT_FUNC_STATUS_OK; } +BT_EXPORT uint64_t bt_event_class_get_id(const struct bt_event_class *event_class) { BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class); return event_class->id; } +BT_EXPORT enum bt_property_availability bt_event_class_get_log_level( const struct bt_event_class *event_class, enum bt_event_class_log_level *log_level) @@ -223,6 +229,7 @@ enum bt_property_availability bt_event_class_get_log_level( return event_class->log_level.base.avail; } +BT_EXPORT void bt_event_class_set_log_level( struct bt_event_class *event_class, enum bt_event_class_log_level log_level) @@ -234,12 +241,14 @@ void bt_event_class_set_log_level( BT_LIB_LOGD("Set event class's log level: %!+E", event_class); } +BT_EXPORT const char *bt_event_class_get_emf_uri(const struct bt_event_class *event_class) { BT_ASSERT_PRE_DEV_EC_NON_NULL(event_class); return event_class->emf_uri.value; } +BT_EXPORT enum bt_event_class_set_emf_uri_status bt_event_class_set_emf_uri( struct bt_event_class *event_class, const char *emf_uri) @@ -254,6 +263,7 @@ enum bt_event_class_set_emf_uri_status bt_event_class_set_emf_uri( return BT_FUNC_STATUS_OK; } +BT_EXPORT struct bt_stream_class *bt_event_class_borrow_stream_class( struct bt_event_class *event_class) { @@ -261,6 +271,7 @@ struct bt_stream_class *bt_event_class_borrow_stream_class( return bt_event_class_borrow_stream_class_inline(event_class); } +BT_EXPORT const struct bt_stream_class * bt_event_class_borrow_stream_class_const( const struct bt_event_class *event_class) @@ -268,6 +279,7 @@ bt_event_class_borrow_stream_class_const( return bt_event_class_borrow_stream_class((void *) event_class); } +BT_EXPORT const struct bt_field_class * bt_event_class_borrow_specific_context_field_class_const( const struct bt_event_class *event_class) @@ -276,6 +288,7 @@ bt_event_class_borrow_specific_context_field_class_const( return event_class->specific_context_fc; } +BT_EXPORT struct bt_field_class * bt_event_class_borrow_specific_context_field_class( struct bt_event_class *event_class) @@ -284,6 +297,7 @@ bt_event_class_borrow_specific_context_field_class( return event_class->specific_context_fc; } +BT_EXPORT enum bt_event_class_set_field_class_status bt_event_class_set_specific_context_field_class( struct bt_event_class *event_class, @@ -333,6 +347,7 @@ end: return ret; } +BT_EXPORT const struct bt_field_class *bt_event_class_borrow_payload_field_class_const( const struct bt_event_class *event_class) { @@ -340,6 +355,7 @@ const struct bt_field_class *bt_event_class_borrow_payload_field_class_const( return event_class->payload_fc; } +BT_EXPORT struct bt_field_class *bt_event_class_borrow_payload_field_class( struct bt_event_class *event_class) { @@ -347,6 +363,7 @@ struct bt_field_class *bt_event_class_borrow_payload_field_class( return event_class->payload_fc; } +BT_EXPORT enum bt_event_class_set_field_class_status bt_event_class_set_payload_field_class( struct bt_event_class *event_class, @@ -395,7 +412,6 @@ end: return ret; } -BT_HIDDEN void _bt_event_class_freeze(const struct bt_event_class *event_class) { /* The field classes are already frozen */ @@ -407,6 +423,7 @@ void _bt_event_class_freeze(const struct bt_event_class *event_class) ((struct bt_event_class *) event_class)->frozen = true; } +BT_EXPORT const struct bt_value *bt_event_class_borrow_user_attributes_const( const struct bt_event_class *event_class) { @@ -414,6 +431,7 @@ const struct bt_value *bt_event_class_borrow_user_attributes_const( return event_class->user_attributes; } +BT_EXPORT struct bt_value *bt_event_class_borrow_user_attributes( struct bt_event_class *event_class) { @@ -421,6 +439,7 @@ struct bt_value *bt_event_class_borrow_user_attributes( (void *) event_class); } +BT_EXPORT void bt_event_class_set_user_attributes( struct bt_event_class *event_class, const struct bt_value *user_attributes) @@ -434,11 +453,13 @@ void bt_event_class_set_user_attributes( bt_object_get_ref_no_null_check(event_class->user_attributes); } +BT_EXPORT void bt_event_class_get_ref(const struct bt_event_class *event_class) { bt_object_get_ref(event_class); } +BT_EXPORT void bt_event_class_put_ref(const struct bt_event_class *event_class) { bt_object_put_ref(event_class); diff --git a/src/lib/trace-ir/event-class.h b/src/lib/trace-ir/event-class.h index 00b2e23c..261ae84a 100644 --- a/src/lib/trace-ir/event-class.h +++ b/src/lib/trace-ir/event-class.h @@ -56,7 +56,6 @@ struct bt_event_class { bool frozen; }; -BT_HIDDEN void _bt_event_class_freeze(const struct bt_event_class *event_class); #ifdef BT_DEV_MODE diff --git a/src/lib/trace-ir/event.c b/src/lib/trace-ir/event.c index fe2c5805..2a8676d8 100644 --- a/src/lib/trace-ir/event.c +++ b/src/lib/trace-ir/event.c @@ -30,7 +30,6 @@ #include "attributes.h" #include "event-class.h" -BT_HIDDEN void _bt_event_set_is_frozen(const struct bt_event *event, bool is_frozen) { BT_ASSERT_DBG(event); @@ -63,7 +62,6 @@ void _bt_event_set_is_frozen(const struct bt_event *event, bool is_frozen) } } -BT_HIDDEN struct bt_event *bt_event_new(struct bt_event_class *event_class) { struct bt_event *event = NULL; @@ -119,36 +117,42 @@ end: return event; } +BT_EXPORT struct bt_event_class *bt_event_borrow_class(struct bt_event *event) { BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event); return event->class; } +BT_EXPORT const struct bt_event_class *bt_event_borrow_class_const( const struct bt_event *event) { return bt_event_borrow_class((void *) event); } +BT_EXPORT struct bt_stream *bt_event_borrow_stream(struct bt_event *event) { BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event); return event->stream; } +BT_EXPORT const struct bt_stream *bt_event_borrow_stream_const( const struct bt_event *event) { return bt_event_borrow_stream((void *) event); } +BT_EXPORT struct bt_field *bt_event_borrow_common_context_field(struct bt_event *event) { BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event); return event->common_context_field; } +BT_EXPORT const struct bt_field *bt_event_borrow_common_context_field_const( const struct bt_event *event) { @@ -156,12 +160,14 @@ const struct bt_field *bt_event_borrow_common_context_field_const( return event->common_context_field; } +BT_EXPORT struct bt_field *bt_event_borrow_specific_context_field(struct bt_event *event) { BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event); return event->specific_context_field; } +BT_EXPORT const struct bt_field *bt_event_borrow_specific_context_field_const( const struct bt_event *event) { @@ -169,12 +175,14 @@ const struct bt_field *bt_event_borrow_specific_context_field_const( return event->specific_context_field; } +BT_EXPORT struct bt_field *bt_event_borrow_payload_field(struct bt_event *event) { BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event); return event->payload_field; } +BT_EXPORT const struct bt_field *bt_event_borrow_payload_field_const( const struct bt_event *event) { @@ -182,7 +190,6 @@ const struct bt_field *bt_event_borrow_payload_field_const( return event->payload_field; } -BT_HIDDEN void bt_event_destroy(struct bt_event *event) { BT_ASSERT(event); @@ -215,12 +222,14 @@ void bt_event_destroy(struct bt_event *event) g_free(event); } +BT_EXPORT struct bt_packet *bt_event_borrow_packet(struct bt_event *event) { BT_ASSERT_PRE_DEV_EVENT_NON_NULL(event); return event->packet; } +BT_EXPORT const struct bt_packet *bt_event_borrow_packet_const( const struct bt_event *event) { diff --git a/src/lib/trace-ir/event.h b/src/lib/trace-ir/event.h index 6ef18291..251d49ec 100644 --- a/src/lib/trace-ir/event.h +++ b/src/lib/trace-ir/event.h @@ -53,13 +53,10 @@ struct bt_event { bool frozen; }; -BT_HIDDEN void bt_event_destroy(struct bt_event *event); -BT_HIDDEN struct bt_event *bt_event_new(struct bt_event_class *event_class); -BT_HIDDEN void _bt_event_set_is_frozen(const struct bt_event *event, bool is_frozen); #ifdef BT_DEV_MODE diff --git a/src/lib/trace-ir/field-class.c b/src/lib/trace-ir/field-class.c index 2a923025..cd9eeaba 100644 --- a/src/lib/trace-ir/field-class.c +++ b/src/lib/trace-ir/field-class.c @@ -31,6 +31,7 @@ #include "lib/integer-range-set.h" #include "lib/value.h" +BT_EXPORT enum bt_field_class_type bt_field_class_get_type( const struct bt_field_class *fc) { @@ -75,6 +76,7 @@ void destroy_bit_array_field_class(struct bt_object *obj) g_free(obj); } +BT_EXPORT struct bt_field_class *bt_field_class_bit_array_create( struct bt_trace_class *trace_class, uint64_t length) { @@ -109,6 +111,7 @@ end: return (void *) ba_fc; } +BT_EXPORT uint64_t bt_field_class_bit_array_get_length(const struct bt_field_class *fc) { const struct bt_field_class_bit_array *ba_fc = (const void *) fc; @@ -128,6 +131,7 @@ void destroy_bool_field_class(struct bt_object *obj) g_free(obj); } +BT_EXPORT struct bt_field_class *bt_field_class_bool_create( bt_trace_class *trace_class) { @@ -217,6 +221,7 @@ end: return (void *) int_fc; } +BT_EXPORT struct bt_field_class *bt_field_class_integer_unsigned_create( bt_trace_class *trace_class) { @@ -226,6 +231,7 @@ struct bt_field_class *bt_field_class_integer_unsigned_create( BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER); } +BT_EXPORT struct bt_field_class *bt_field_class_integer_signed_create( bt_trace_class *trace_class) { @@ -235,6 +241,7 @@ struct bt_field_class *bt_field_class_integer_signed_create( BT_FIELD_CLASS_TYPE_SIGNED_INTEGER); } +BT_EXPORT uint64_t bt_field_class_integer_get_field_value_range( const struct bt_field_class *fc) { @@ -253,6 +260,7 @@ bool size_is_valid_for_enumeration_field_class(struct bt_field_class *fc, return true; } +BT_EXPORT void bt_field_class_integer_set_field_value_range( struct bt_field_class *fc, uint64_t size) { @@ -276,6 +284,7 @@ void bt_field_class_integer_set_field_value_range( BT_LIB_LOGD("Set integer field class's field value range: %!+F", fc); } +BT_EXPORT enum bt_field_class_integer_preferred_display_base bt_field_class_integer_get_preferred_display_base(const struct bt_field_class *fc) { @@ -286,6 +295,7 @@ bt_field_class_integer_get_preferred_display_base(const struct bt_field_class *f return int_fc->base; } +BT_EXPORT void bt_field_class_integer_set_preferred_display_base( struct bt_field_class *fc, enum bt_field_class_integer_preferred_display_base base) @@ -386,6 +396,7 @@ end: return (void *) enum_fc; } +BT_EXPORT struct bt_field_class *bt_field_class_enumeration_unsigned_create( bt_trace_class *trace_class) { @@ -395,6 +406,7 @@ struct bt_field_class *bt_field_class_enumeration_unsigned_create( BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION); } +BT_EXPORT struct bt_field_class *bt_field_class_enumeration_signed_create( bt_trace_class *trace_class) { @@ -404,6 +416,7 @@ struct bt_field_class *bt_field_class_enumeration_signed_create( BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION); } +BT_EXPORT uint64_t bt_field_class_enumeration_get_mapping_count( const struct bt_field_class *fc) { @@ -414,6 +427,7 @@ uint64_t bt_field_class_enumeration_get_mapping_count( return (uint64_t) enum_fc->mappings->len; } +BT_EXPORT const struct bt_field_class_enumeration_unsigned_mapping * bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( const struct bt_field_class *fc, uint64_t index) @@ -427,6 +441,7 @@ bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( return (const void *) BT_FIELD_CLASS_ENUM_MAPPING_AT_INDEX(fc, index); } +BT_EXPORT const struct bt_field_class_enumeration_signed_mapping * bt_field_class_enumeration_signed_borrow_mapping_by_index_const( const struct bt_field_class *fc, uint64_t index) @@ -467,6 +482,7 @@ end: return mapping; } +BT_EXPORT const struct bt_field_class_enumeration_signed_mapping * bt_field_class_enumeration_signed_borrow_mapping_by_label_const( const struct bt_field_class *fc, const char *label) @@ -478,6 +494,7 @@ bt_field_class_enumeration_signed_borrow_mapping_by_label_const( (const void *) fc, label, __func__); } +BT_EXPORT const struct bt_field_class_enumeration_unsigned_mapping * bt_field_class_enumeration_unsigned_borrow_mapping_by_label_const( const struct bt_field_class *fc, const char *label) @@ -489,6 +506,7 @@ bt_field_class_enumeration_unsigned_borrow_mapping_by_label_const( (const void *) fc, label, __func__); } +BT_EXPORT const char *bt_field_class_enumeration_mapping_get_label( const struct bt_field_class_enumeration_mapping *mapping) { @@ -497,6 +515,7 @@ const char *bt_field_class_enumeration_mapping_get_label( return mapping->label->str; } +BT_EXPORT const struct bt_integer_range_set_unsigned * bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( const struct bt_field_class_enumeration_unsigned_mapping *u_mapping) @@ -509,6 +528,7 @@ bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( return (const void *) mapping->range_set; } +BT_EXPORT const struct bt_integer_range_set_signed * bt_field_class_enumeration_signed_mapping_borrow_ranges_const( const struct bt_field_class_enumeration_signed_mapping *s_mapping) @@ -521,6 +541,7 @@ bt_field_class_enumeration_signed_mapping_borrow_ranges_const( return (const void *) mapping->range_set; } +BT_EXPORT enum bt_field_class_enumeration_get_mapping_labels_for_value_status bt_field_class_enumeration_unsigned_get_mapping_labels_for_value( const struct bt_field_class *fc, uint64_t value, @@ -563,6 +584,7 @@ bt_field_class_enumeration_unsigned_get_mapping_labels_for_value( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_field_class_enumeration_get_mapping_labels_for_value_status bt_field_class_enumeration_signed_get_mapping_labels_for_value( const struct bt_field_class *fc, int64_t value, @@ -668,6 +690,7 @@ end: return status; } +BT_EXPORT enum bt_field_class_enumeration_add_mapping_status bt_field_class_enumeration_unsigned_add_mapping( struct bt_field_class *fc, const char *label, @@ -682,6 +705,7 @@ bt_field_class_enumeration_unsigned_add_mapping( (const void *) range_set, __func__); } +BT_EXPORT enum bt_field_class_enumeration_add_mapping_status bt_field_class_enumeration_signed_add_mapping( struct bt_field_class *fc, const char *label, @@ -734,6 +758,7 @@ end: return (void *) real_fc; } +BT_EXPORT struct bt_field_class *bt_field_class_real_single_precision_create( bt_trace_class *trace_class) { @@ -743,6 +768,7 @@ struct bt_field_class *bt_field_class_real_single_precision_create( BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL); } +BT_EXPORT struct bt_field_class *bt_field_class_real_double_precision_create( bt_trace_class *trace_class) { @@ -855,6 +881,7 @@ void destroy_structure_field_class(struct bt_object *obj) g_free(obj); } +BT_EXPORT struct bt_field_class *bt_field_class_structure_create( bt_trace_class *trace_class) { @@ -1010,6 +1037,7 @@ int append_named_field_class_to_container_field_class( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_field_class_structure_append_member_status bt_field_class_structure_append_member( struct bt_field_class *fc, const char *name, @@ -1040,6 +1068,7 @@ end: return status; } +BT_EXPORT uint64_t bt_field_class_structure_get_member_count( const struct bt_field_class *fc) { @@ -1062,6 +1091,7 @@ borrow_named_field_class_from_container_field_class_at_index( return fc->named_fcs->pdata[index]; } +BT_EXPORT const struct bt_field_class_structure_member * bt_field_class_structure_borrow_member_by_index_const( const struct bt_field_class *fc, uint64_t index) @@ -1073,6 +1103,7 @@ bt_field_class_structure_borrow_member_by_index_const( (void *) fc, index, __func__); } +BT_EXPORT struct bt_field_class_structure_member * bt_field_class_structure_borrow_member_by_index( struct bt_field_class *fc, uint64_t index) @@ -1107,6 +1138,7 @@ end: return named_fc; } +BT_EXPORT const struct bt_field_class_structure_member * bt_field_class_structure_borrow_member_by_name_const( const struct bt_field_class *fc, const char *name) @@ -1118,6 +1150,7 @@ bt_field_class_structure_borrow_member_by_name_const( (void *) fc, name, __func__); } +BT_EXPORT struct bt_field_class_structure_member * bt_field_class_structure_borrow_member_by_name( struct bt_field_class *fc, const char *name) @@ -1129,6 +1162,7 @@ bt_field_class_structure_borrow_member_by_name( (void *) fc, name, __func__); } +BT_EXPORT const char *bt_field_class_structure_member_get_name( const struct bt_field_class_structure_member *member) { @@ -1138,6 +1172,7 @@ const char *bt_field_class_structure_member_get_name( return named_fc->name->str; } +BT_EXPORT const struct bt_field_class * bt_field_class_structure_member_borrow_field_class_const( const struct bt_field_class_structure_member *member) @@ -1148,6 +1183,7 @@ bt_field_class_structure_member_borrow_field_class_const( return named_fc->fc; } +BT_EXPORT struct bt_field_class * bt_field_class_structure_member_borrow_field_class( struct bt_field_class_structure_member *member) @@ -1275,6 +1311,7 @@ end: return (void *) opt_fc; } +BT_EXPORT struct bt_field_class *bt_field_class_option_without_selector_create( struct bt_trace_class *trace_class, struct bt_field_class *content_fc) @@ -1284,6 +1321,7 @@ struct bt_field_class *bt_field_class_option_without_selector_create( content_fc, NULL, __func__); } +BT_EXPORT struct bt_field_class *bt_field_class_option_with_selector_field_bool_create( struct bt_trace_class *trace_class, struct bt_field_class *content_fc, @@ -1296,6 +1334,7 @@ struct bt_field_class *bt_field_class_option_with_selector_field_bool_create( content_fc, selector_fc, __func__); } +BT_EXPORT struct bt_field_class * bt_field_class_option_with_selector_field_integer_unsigned_create( struct bt_trace_class *trace_class, @@ -1326,6 +1365,7 @@ end: return (void *) fc; } +BT_EXPORT struct bt_field_class * bt_field_class_option_with_selector_field_integer_signed_create( struct bt_trace_class *trace_class, @@ -1356,6 +1396,7 @@ end: return (void *) fc; } +BT_EXPORT const struct bt_field_class *bt_field_class_option_borrow_field_class_const( const struct bt_field_class *fc) { @@ -1366,6 +1407,7 @@ const struct bt_field_class *bt_field_class_option_borrow_field_class_const( return opt_fc->content_fc; } +BT_EXPORT struct bt_field_class *bt_field_class_option_borrow_field_class( struct bt_field_class *fc) { @@ -1376,6 +1418,7 @@ struct bt_field_class *bt_field_class_option_borrow_field_class( return opt_fc->content_fc; } +BT_EXPORT const struct bt_field_path * bt_field_class_option_with_selector_field_borrow_selector_field_path_const( const struct bt_field_class *fc) @@ -1388,6 +1431,7 @@ bt_field_class_option_with_selector_field_borrow_selector_field_path_const( return opt_fc->selector_field_path; } +BT_EXPORT void bt_field_class_option_with_selector_field_bool_set_selector_is_reversed( struct bt_field_class *fc, bt_bool sel_is_reversed) { @@ -1402,6 +1446,7 @@ void bt_field_class_option_with_selector_field_bool_set_selector_is_reversed( opt_fc->sel_is_reversed = sel_is_reversed; } +BT_EXPORT bt_bool bt_field_class_option_with_selector_field_bool_selector_is_reversed( const struct bt_field_class *fc) { @@ -1415,6 +1460,7 @@ bt_bool bt_field_class_option_with_selector_field_bool_selector_is_reversed( return opt_fc->sel_is_reversed; } +BT_EXPORT const struct bt_integer_range_set_unsigned * bt_field_class_option_with_selector_field_integer_unsigned_borrow_selector_ranges_const( const struct bt_field_class *fc) @@ -1428,6 +1474,7 @@ bt_field_class_option_with_selector_field_integer_unsigned_borrow_selector_range return (const void *) opt_fc->range_set; } +BT_EXPORT const struct bt_integer_range_set_signed * bt_field_class_option_with_selector_field_integer_signed_borrow_selector_ranges_const( const struct bt_field_class *fc) @@ -1474,6 +1521,7 @@ void destroy_variant_with_selector_field_field_class(struct bt_object *obj) g_free(fc); } +BT_EXPORT struct bt_field_class *bt_field_class_variant_create( bt_trace_class *trace_class, bt_field_class *selector_fc) { @@ -1557,6 +1605,7 @@ end: #define VAR_FC_OPT_NAME_IS_UNIQUE_ID \ "variant-field-class-option-name-is-unique" +BT_EXPORT enum bt_field_class_variant_without_selector_append_option_status bt_field_class_variant_without_selector_append_option(struct bt_field_class *fc, const char *name, struct bt_field_class *option_fc) @@ -1733,6 +1782,7 @@ end: return status; } +BT_EXPORT enum bt_field_class_variant_with_selector_field_integer_append_option_status bt_field_class_variant_with_selector_field_integer_unsigned_append_option( struct bt_field_class *fc, const char *name, @@ -1751,6 +1801,7 @@ bt_field_class_variant_with_selector_field_integer_unsigned_append_option( __func__); } +BT_EXPORT enum bt_field_class_variant_with_selector_field_integer_append_option_status bt_field_class_variant_with_selector_field_integer_signed_append_option( struct bt_field_class *fc, const char *name, @@ -1769,6 +1820,7 @@ bt_field_class_variant_with_selector_field_integer_signed_append_option( __func__); } +BT_EXPORT uint64_t bt_field_class_variant_get_option_count(const struct bt_field_class *fc) { const struct bt_field_class_variant *var_fc = (const void *) fc; @@ -1778,6 +1830,7 @@ uint64_t bt_field_class_variant_get_option_count(const struct bt_field_class *fc return (uint64_t) var_fc->common.named_fcs->len; } +BT_EXPORT const struct bt_field_class_variant_option * bt_field_class_variant_borrow_option_by_name_const( const struct bt_field_class *fc, const char *name) @@ -1789,6 +1842,7 @@ bt_field_class_variant_borrow_option_by_name_const( (void *) fc, name, __func__); } +BT_EXPORT const struct bt_field_class_variant_option * bt_field_class_variant_borrow_option_by_index_const( const struct bt_field_class *fc, uint64_t index) @@ -1800,6 +1854,7 @@ bt_field_class_variant_borrow_option_by_index_const( (void *) fc, index, __func__); } +BT_EXPORT struct bt_field_class_variant_option * bt_field_class_variant_borrow_option_by_name( struct bt_field_class *fc, const char *name) @@ -1811,6 +1866,7 @@ bt_field_class_variant_borrow_option_by_name( (void *) fc, name, __func__); } +BT_EXPORT struct bt_field_class_variant_option * bt_field_class_variant_borrow_option_by_index( struct bt_field_class *fc, uint64_t index) @@ -1822,6 +1878,7 @@ bt_field_class_variant_borrow_option_by_index( (void *) fc, index, __func__); } +BT_EXPORT const struct bt_field_class_variant_with_selector_field_integer_unsigned_option * bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_name_const( const struct bt_field_class *fc, const char *name) @@ -1836,6 +1893,7 @@ bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_nam (void *) fc, name, __func__); } +BT_EXPORT const struct bt_field_class_variant_with_selector_field_integer_unsigned_option * bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_index_const( const struct bt_field_class *fc, uint64_t index) @@ -1850,6 +1908,7 @@ bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_ind (void *) fc, index, __func__); } +BT_EXPORT const struct bt_field_class_variant_with_selector_field_integer_signed_option * bt_field_class_variant_with_selector_field_integer_signed_borrow_option_by_name_const( const struct bt_field_class *fc, const char *name) @@ -1864,6 +1923,7 @@ bt_field_class_variant_with_selector_field_integer_signed_borrow_option_by_name_ (void *) fc, name, __func__); } +BT_EXPORT const struct bt_field_class_variant_with_selector_field_integer_signed_option * bt_field_class_variant_with_selector_field_integer_signed_borrow_option_by_index_const( const struct bt_field_class *fc, uint64_t index) @@ -1878,6 +1938,7 @@ bt_field_class_variant_with_selector_field_integer_signed_borrow_option_by_index (void *) fc, index, __func__); } +BT_EXPORT const char *bt_field_class_variant_option_get_name( const struct bt_field_class_variant_option *option) { @@ -1887,6 +1948,7 @@ const char *bt_field_class_variant_option_get_name( return named_fc->name->str; } +BT_EXPORT const struct bt_field_class * bt_field_class_variant_option_borrow_field_class_const( const struct bt_field_class_variant_option *option) @@ -1897,6 +1959,7 @@ bt_field_class_variant_option_borrow_field_class_const( return named_fc->fc; } +BT_EXPORT struct bt_field_class * bt_field_class_variant_option_borrow_field_class( struct bt_field_class_variant_option *option) @@ -1907,6 +1970,7 @@ bt_field_class_variant_option_borrow_field_class( return named_fc->fc; } +BT_EXPORT const struct bt_integer_range_set_unsigned * bt_field_class_variant_with_selector_field_integer_unsigned_option_borrow_ranges_const( const struct bt_field_class_variant_with_selector_field_integer_unsigned_option *option) @@ -1918,6 +1982,7 @@ bt_field_class_variant_with_selector_field_integer_unsigned_option_borrow_ranges return (const void *) opt->range_set; } +BT_EXPORT const struct bt_integer_range_set_signed * bt_field_class_variant_with_selector_field_integer_signed_option_borrow_ranges_const( const struct bt_field_class_variant_with_selector_field_integer_signed_option *option) @@ -1929,6 +1994,7 @@ bt_field_class_variant_with_selector_field_integer_signed_option_borrow_ranges_c return (const void *) opt->range_set; } +BT_EXPORT const struct bt_field_path * bt_field_class_variant_with_selector_field_borrow_selector_field_path_const( const struct bt_field_class *fc) @@ -1981,6 +2047,7 @@ void destroy_static_array_field_class(struct bt_object *obj) g_free(obj); } +BT_EXPORT struct bt_field_class * bt_field_class_array_static_create(bt_trace_class *trace_class, struct bt_field_class *element_fc, uint64_t length) @@ -2016,6 +2083,7 @@ end: return (void *) array_fc; } +BT_EXPORT const struct bt_field_class * bt_field_class_array_borrow_element_field_class_const( const struct bt_field_class *fc) @@ -2027,6 +2095,7 @@ bt_field_class_array_borrow_element_field_class_const( return array_fc->element_fc; } +BT_EXPORT struct bt_field_class * bt_field_class_array_borrow_element_field_class(struct bt_field_class *fc) { @@ -2037,6 +2106,7 @@ bt_field_class_array_borrow_element_field_class(struct bt_field_class *fc) return array_fc->element_fc; } +BT_EXPORT uint64_t bt_field_class_array_static_get_length(const struct bt_field_class *fc) { const struct bt_field_class_array_static *array_fc = (const void *) fc; @@ -2063,6 +2133,7 @@ void destroy_dynamic_array_field_class(struct bt_object *obj) g_free(fc); } +BT_EXPORT struct bt_field_class *bt_field_class_array_dynamic_create( struct bt_trace_class *trace_class, struct bt_field_class *element_fc, @@ -2108,6 +2179,7 @@ end: return (void *) array_fc; } +BT_EXPORT const struct bt_field_path * bt_field_class_array_dynamic_with_length_field_borrow_length_field_path_const( const struct bt_field_class *fc) @@ -2132,6 +2204,7 @@ void destroy_string_field_class(struct bt_object *obj) g_free(obj); } +BT_EXPORT struct bt_field_class *bt_field_class_string_create(bt_trace_class *trace_class) { struct bt_field_class_string *string_fc = NULL; @@ -2161,7 +2234,6 @@ end: return (void *) string_fc; } -BT_HIDDEN void _bt_field_class_freeze(const struct bt_field_class *c_fc) { struct bt_field_class *fc = (void *) c_fc; @@ -2188,7 +2260,6 @@ void _bt_field_class_freeze(const struct bt_field_class *c_fc) } } -BT_HIDDEN void _bt_named_field_class_freeze(const struct bt_named_field_class *named_fc) { BT_ASSERT(named_fc); @@ -2199,7 +2270,6 @@ void _bt_named_field_class_freeze(const struct bt_named_field_class *named_fc) ((struct bt_named_field_class *) named_fc)->frozen = true; } -BT_HIDDEN void bt_field_class_make_part_of_trace_class(const struct bt_field_class *c_fc) { struct bt_field_class *fc = (void *) c_fc; @@ -2231,6 +2301,7 @@ void bt_field_class_make_part_of_trace_class(const struct bt_field_class *c_fc) } } +BT_EXPORT const struct bt_value *bt_field_class_borrow_user_attributes_const( const struct bt_field_class *fc) { @@ -2238,6 +2309,7 @@ const struct bt_value *bt_field_class_borrow_user_attributes_const( return fc->user_attributes; } +BT_EXPORT struct bt_value *bt_field_class_borrow_user_attributes( struct bt_field_class *field_class) { @@ -2246,6 +2318,7 @@ struct bt_value *bt_field_class_borrow_user_attributes( } +BT_EXPORT void bt_field_class_set_user_attributes( struct bt_field_class *fc, const struct bt_value *user_attributes) @@ -2278,6 +2351,7 @@ void set_named_field_class_user_attributes( bt_object_get_ref_no_null_check(named_fc->user_attributes); } +BT_EXPORT const struct bt_value * bt_field_class_structure_member_borrow_user_attributes_const( const struct bt_field_class_structure_member *member) @@ -2287,6 +2361,7 @@ bt_field_class_structure_member_borrow_user_attributes_const( (const void *) member); } +BT_EXPORT struct bt_value * bt_field_class_structure_member_borrow_user_attributes( struct bt_field_class_structure_member *member) @@ -2296,6 +2371,7 @@ bt_field_class_structure_member_borrow_user_attributes( (void *) member); } +BT_EXPORT void bt_field_class_structure_member_set_user_attributes( struct bt_field_class_structure_member *member, const struct bt_value *user_attributes) @@ -2308,6 +2384,7 @@ void bt_field_class_structure_member_set_user_attributes( user_attributes, __func__); } +BT_EXPORT const struct bt_value *bt_field_class_variant_option_borrow_user_attributes_const( const struct bt_field_class_variant_option *option) { @@ -2316,6 +2393,7 @@ const struct bt_value *bt_field_class_variant_option_borrow_user_attributes_cons (const void *) option); } +BT_EXPORT struct bt_value *bt_field_class_variant_option_borrow_user_attributes( struct bt_field_class_variant_option *option) { @@ -2324,6 +2402,7 @@ struct bt_value *bt_field_class_variant_option_borrow_user_attributes( (void *) option); } +BT_EXPORT void bt_field_class_variant_option_set_user_attributes( struct bt_field_class_variant_option *option, const struct bt_value *user_attributes) @@ -2336,11 +2415,13 @@ void bt_field_class_variant_option_set_user_attributes( user_attributes, __func__); } +BT_EXPORT void bt_field_class_get_ref(const struct bt_field_class *field_class) { bt_object_get_ref(field_class); } +BT_EXPORT void bt_field_class_put_ref(const struct bt_field_class *field_class) { bt_object_put_ref(field_class); diff --git a/src/lib/trace-ir/field-class.h b/src/lib/trace-ir/field-class.h index 464dd286..77df5804 100644 --- a/src/lib/trace-ir/field-class.h +++ b/src/lib/trace-ir/field-class.h @@ -227,7 +227,6 @@ struct bt_field_class_variant_with_selector_field { struct bt_field_path *selector_field_path; }; -BT_HIDDEN void _bt_field_class_freeze(const struct bt_field_class *field_class); #ifdef BT_DEV_MODE @@ -236,7 +235,6 @@ void _bt_field_class_freeze(const struct bt_field_class *field_class); # define bt_field_class_freeze(_fc) ((void) _fc) #endif -BT_HIDDEN void _bt_named_field_class_freeze(const struct bt_named_field_class *named_fc); #ifdef BT_DEV_MODE @@ -251,7 +249,6 @@ void _bt_named_field_class_freeze(const struct bt_named_field_class *named_fc); * are used at a single location within trace objects even if they are * shared objects for other purposes. */ -BT_HIDDEN void bt_field_class_make_part_of_trace_class( const struct bt_field_class *field_class); diff --git a/src/lib/trace-ir/field-path.c b/src/lib/trace-ir/field-path.c index f7d7551b..ab3d04a4 100644 --- a/src/lib/trace-ir/field-path.c +++ b/src/lib/trace-ir/field-path.c @@ -32,7 +32,6 @@ void destroy_field_path(struct bt_object *obj) g_free(field_path); } -BT_HIDDEN struct bt_field_path *bt_field_path_create(void) { struct bt_field_path *field_path = NULL; @@ -63,6 +62,7 @@ end: return field_path; } +BT_EXPORT enum bt_field_path_scope bt_field_path_get_root_scope( const struct bt_field_path *field_path) { @@ -70,12 +70,14 @@ enum bt_field_path_scope bt_field_path_get_root_scope( return field_path->root; } +BT_EXPORT uint64_t bt_field_path_get_item_count(const struct bt_field_path *field_path) { BT_ASSERT_PRE_DEV_FP_NON_NULL(field_path); return (uint64_t) field_path->items->len; } +BT_EXPORT const struct bt_field_path_item *bt_field_path_borrow_item_by_index_const( const struct bt_field_path *field_path, uint64_t index) { @@ -84,6 +86,7 @@ const struct bt_field_path_item *bt_field_path_borrow_item_by_index_const( return bt_field_path_borrow_item_by_index_inline(field_path, index); } +BT_EXPORT enum bt_field_path_item_type bt_field_path_item_get_type( const struct bt_field_path_item *field_path_item) { @@ -92,6 +95,7 @@ enum bt_field_path_item_type bt_field_path_item_get_type( return field_path_item->type; } +BT_EXPORT uint64_t bt_field_path_item_index_get_index( const struct bt_field_path_item *field_path_item) { @@ -105,11 +109,13 @@ uint64_t bt_field_path_item_index_get_index( return field_path_item->index; } +BT_EXPORT void bt_field_path_get_ref(const struct bt_field_path *field_path) { bt_object_get_ref(field_path); } +BT_EXPORT void bt_field_path_put_ref(const struct bt_field_path *field_path) { bt_object_put_ref(field_path); diff --git a/src/lib/trace-ir/field-path.h b/src/lib/trace-ir/field-path.h index cae07b8c..fb07e11c 100644 --- a/src/lib/trace-ir/field-path.h +++ b/src/lib/trace-ir/field-path.h @@ -29,7 +29,6 @@ struct bt_field_path { GArray *items; }; -BT_HIDDEN struct bt_field_path *bt_field_path_create(void); static inline diff --git a/src/lib/trace-ir/field-wrapper.c b/src/lib/trace-ir/field-wrapper.c index a26958a7..99e99c5b 100644 --- a/src/lib/trace-ir/field-wrapper.c +++ b/src/lib/trace-ir/field-wrapper.c @@ -14,7 +14,6 @@ #include "field-wrapper.h" #include "field.h" -BT_HIDDEN struct bt_field_wrapper *bt_field_wrapper_new(void *data) { struct bt_field_wrapper *field_wrapper = @@ -36,7 +35,6 @@ end: return field_wrapper; } -BT_HIDDEN void bt_field_wrapper_destroy(struct bt_field_wrapper *field_wrapper) { BT_LOGD("Destroying field wrapper: addr=%p", field_wrapper); @@ -51,7 +49,6 @@ void bt_field_wrapper_destroy(struct bt_field_wrapper *field_wrapper) g_free(field_wrapper); } -BT_HIDDEN struct bt_field_wrapper *bt_field_wrapper_create( struct bt_object_pool *pool, struct bt_field_class *fc) { diff --git a/src/lib/trace-ir/field-wrapper.h b/src/lib/trace-ir/field-wrapper.h index f3fdee3c..afe5324e 100644 --- a/src/lib/trace-ir/field-wrapper.h +++ b/src/lib/trace-ir/field-wrapper.h @@ -20,13 +20,10 @@ struct bt_field_wrapper { struct bt_field *field; }; -BT_HIDDEN struct bt_field_wrapper *bt_field_wrapper_new(void *data); -BT_HIDDEN void bt_field_wrapper_destroy(struct bt_field_wrapper *field); -BT_HIDDEN struct bt_field_wrapper *bt_field_wrapper_create( struct bt_object_pool *pool, struct bt_field_class *fc); diff --git a/src/lib/trace-ir/field.c b/src/lib/trace-ir/field.c index 4d6db133..c07ab363 100644 --- a/src/lib/trace-ir/field.c +++ b/src/lib/trace-ir/field.c @@ -191,12 +191,14 @@ void destroy_option_field(struct bt_field *field); static void destroy_variant_field(struct bt_field *field); +BT_EXPORT struct bt_field_class *bt_field_borrow_class(struct bt_field *field) { BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field); return field->class; } +BT_EXPORT const struct bt_field_class *bt_field_borrow_class_const( const struct bt_field *field) { @@ -204,13 +206,13 @@ const struct bt_field_class *bt_field_borrow_class_const( return field->class; } +BT_EXPORT enum bt_field_class_type bt_field_get_class_type(const struct bt_field *field) { BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field); return field->class->type; } -BT_HIDDEN struct bt_field *bt_field_create(struct bt_field_class *fc) { struct bt_field *field = NULL; @@ -620,6 +622,7 @@ end: return (void *) array_field; } +BT_EXPORT bt_bool bt_field_bool_get_value(const struct bt_field *field) { const struct bt_field_bool *bool_field = (const void *) field; @@ -631,6 +634,7 @@ bt_bool bt_field_bool_get_value(const struct bt_field *field) return (bt_bool) bool_field->value; } +BT_EXPORT void bt_field_bool_set_value(struct bt_field *field, bt_bool value) { struct bt_field_bool *bool_field = (void *) field; @@ -643,6 +647,7 @@ void bt_field_bool_set_value(struct bt_field *field, bt_bool value) bt_field_set_single(field, true); } +BT_EXPORT uint64_t bt_field_bit_array_get_value_as_integer(const struct bt_field *field) { const struct bt_field_bit_array *ba_field = (const void *) field; @@ -654,6 +659,7 @@ uint64_t bt_field_bit_array_get_value_as_integer(const struct bt_field *field) return ba_field->value_as_int; } +BT_EXPORT void bt_field_bit_array_set_value_as_integer(struct bt_field *field, uint64_t value) { @@ -675,6 +681,7 @@ void bt_field_bit_array_set_value_as_integer(struct bt_field *field, bt_field_set_single(field, true); } +BT_EXPORT int64_t bt_field_integer_signed_get_value(const struct bt_field *field) { const struct bt_field_integer *int_field = (const void *) field; @@ -685,6 +692,7 @@ int64_t bt_field_integer_signed_get_value(const struct bt_field *field) return int_field->value.i; } +BT_EXPORT void bt_field_integer_signed_set_value(struct bt_field *field, int64_t value) { struct bt_field_integer *int_field = (void *) field; @@ -702,6 +710,7 @@ void bt_field_integer_signed_set_value(struct bt_field *field, int64_t value) bt_field_set_single(field, true); } +BT_EXPORT uint64_t bt_field_integer_unsigned_get_value(const struct bt_field *field) { const struct bt_field_integer *int_field = (const void *) field; @@ -712,6 +721,7 @@ uint64_t bt_field_integer_unsigned_get_value(const struct bt_field *field) return int_field->value.u; } +BT_EXPORT void bt_field_integer_unsigned_set_value(struct bt_field *field, uint64_t value) { struct bt_field_integer *int_field = (void *) field; @@ -729,6 +739,7 @@ void bt_field_integer_unsigned_set_value(struct bt_field *field, uint64_t value) bt_field_set_single(field, true); } +BT_EXPORT float bt_field_real_single_precision_get_value(const struct bt_field *field) { const struct bt_field_real *real_field = (const void *) field; @@ -741,6 +752,7 @@ float bt_field_real_single_precision_get_value(const struct bt_field *field) return (float) real_field->value; } +BT_EXPORT double bt_field_real_double_precision_get_value(const struct bt_field *field) { const struct bt_field_real *real_field = (const void *) field; @@ -753,6 +765,7 @@ double bt_field_real_double_precision_get_value(const struct bt_field *field) return real_field->value; } +BT_EXPORT void bt_field_real_single_precision_set_value(struct bt_field *field, float value) { @@ -768,6 +781,7 @@ void bt_field_real_single_precision_set_value(struct bt_field *field, bt_field_set_single(field, true); } +BT_EXPORT void bt_field_real_double_precision_set_value(struct bt_field *field, double value) { @@ -783,6 +797,7 @@ void bt_field_real_double_precision_set_value(struct bt_field *field, bt_field_set_single(field, true); } +BT_EXPORT enum bt_field_enumeration_get_mapping_labels_status bt_field_enumeration_unsigned_get_mapping_labels( const struct bt_field *field, @@ -805,6 +820,7 @@ bt_field_enumeration_unsigned_get_mapping_labels( field->class, int_field->value.u, label_array, count); } +BT_EXPORT enum bt_field_enumeration_get_mapping_labels_status bt_field_enumeration_signed_get_mapping_labels( const struct bt_field *field, @@ -827,6 +843,7 @@ bt_field_enumeration_signed_get_mapping_labels( field->class, int_field->value.i, label_array, count); } +BT_EXPORT const char *bt_field_string_get_value(const struct bt_field *field) { const struct bt_field_string *string_field = (const void *) field; @@ -838,6 +855,7 @@ const char *bt_field_string_get_value(const struct bt_field *field) return (const char *) string_field->buf->data; } +BT_EXPORT uint64_t bt_field_string_get_length(const struct bt_field *field) { const struct bt_field_string *string_field = (const void *) field; @@ -860,6 +878,7 @@ void clear_string_field(struct bt_field *field) bt_field_set_single(field, true); } +BT_EXPORT enum bt_field_string_set_value_status bt_field_string_set_value( struct bt_field *field, const char *value) { @@ -914,6 +933,7 @@ enum bt_field_string_append_status append_to_string_field_with_length( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_field_string_append_status bt_field_string_append_with_length( struct bt_field *field, const char *value, uint64_t length) { @@ -922,6 +942,7 @@ enum bt_field_string_append_status bt_field_string_append_with_length( return append_to_string_field_with_length(field, value, length); } +BT_EXPORT enum bt_field_string_append_status bt_field_string_append( struct bt_field *field, const char *value) { @@ -932,6 +953,7 @@ enum bt_field_string_append_status bt_field_string_append( return append_to_string_field_with_length(field, value, length); } +BT_EXPORT void bt_field_string_clear(struct bt_field *field) { BT_ASSERT_PRE_DEV_FIELD_NON_NULL(field); @@ -941,6 +963,7 @@ void bt_field_string_clear(struct bt_field *field) clear_string_field(field); } +BT_EXPORT uint64_t bt_field_array_get_length(const struct bt_field *field) { const struct bt_field_array *array_field = (const void *) field; @@ -950,6 +973,7 @@ uint64_t bt_field_array_get_length(const struct bt_field *field) return array_field->length; } +BT_EXPORT enum bt_field_array_dynamic_set_length_status bt_field_array_dynamic_set_length( struct bt_field *field, uint64_t length) { @@ -1009,6 +1033,7 @@ struct bt_field *borrow_array_field_element_field_by_index( return array_field->fields->pdata[index]; } +BT_EXPORT struct bt_field *bt_field_array_borrow_element_field_by_index( struct bt_field *field, uint64_t index) { @@ -1016,6 +1041,7 @@ struct bt_field *bt_field_array_borrow_element_field_by_index( __func__); } +BT_EXPORT const struct bt_field * bt_field_array_borrow_element_field_by_index_const( const struct bt_field *field, uint64_t index) @@ -1039,6 +1065,7 @@ struct bt_field *borrow_structure_field_member_field_by_index( return struct_field->fields->pdata[index]; } +BT_EXPORT struct bt_field *bt_field_structure_borrow_member_field_by_index( struct bt_field *field, uint64_t index) { @@ -1046,6 +1073,7 @@ struct bt_field *bt_field_structure_borrow_member_field_by_index( index, __func__); } +BT_EXPORT const struct bt_field * bt_field_structure_borrow_member_field_by_index_const( const struct bt_field *field, uint64_t index) @@ -1084,6 +1112,7 @@ end: return ret_field; } +BT_EXPORT struct bt_field *bt_field_structure_borrow_member_field_by_name( struct bt_field *field, const char *name) { @@ -1091,6 +1120,7 @@ struct bt_field *bt_field_structure_borrow_member_field_by_name( __func__); } +BT_EXPORT const struct bt_field *bt_field_structure_borrow_member_field_by_name_const( const struct bt_field *field, const char *name) { @@ -1098,6 +1128,7 @@ const struct bt_field *bt_field_structure_borrow_member_field_by_name_const( (void *) field, name, __func__); } +BT_EXPORT void bt_field_option_set_has_field(struct bt_field *field, bt_bool has_field) { struct bt_field_option *opt_field = (void *) field; @@ -1113,6 +1144,7 @@ void bt_field_option_set_has_field(struct bt_field *field, bt_bool has_field) } } +BT_EXPORT struct bt_field *bt_field_option_borrow_field(struct bt_field *field) { struct bt_field_option *opt_field = (void *) field; @@ -1122,6 +1154,7 @@ struct bt_field *bt_field_option_borrow_field(struct bt_field *field) return opt_field->selected_field; } +BT_EXPORT const struct bt_field *bt_field_option_borrow_field_const( const struct bt_field *field) { @@ -1150,6 +1183,7 @@ struct bt_field *borrow_variant_field_selected_option_field( return var_field->selected_field; } +BT_EXPORT struct bt_field *bt_field_variant_borrow_selected_option_field( struct bt_field *field) { @@ -1157,6 +1191,7 @@ struct bt_field *bt_field_variant_borrow_selected_option_field( return borrow_variant_field_selected_option_field(field); } +BT_EXPORT const struct bt_field *bt_field_variant_borrow_selected_option_field_const( const struct bt_field *field) { @@ -1185,6 +1220,7 @@ borrow_variant_field_selected_class_option(const struct bt_field *field) return container_fc->named_fcs->pdata[var_field->selected_index]; } +BT_EXPORT const struct bt_field_class_variant_option * bt_field_variant_borrow_selected_option_class_const( const struct bt_field *field) @@ -1195,6 +1231,7 @@ bt_field_variant_borrow_selected_option_class_const( return borrow_variant_field_selected_class_option(field); } +BT_EXPORT const struct bt_field_class_variant_with_selector_field_integer_unsigned_option * bt_field_variant_with_selector_field_integer_unsigned_borrow_selected_option_class_const( const struct bt_field *field) @@ -1208,6 +1245,7 @@ bt_field_variant_with_selector_field_integer_unsigned_borrow_selected_option_cla return (const void *) borrow_variant_field_selected_class_option(field); } +BT_EXPORT const struct bt_field_class_variant_with_selector_field_integer_signed_option * bt_field_variant_with_selector_field_integer_signed_borrow_selected_option_class_const( const struct bt_field *field) @@ -1221,6 +1259,7 @@ bt_field_variant_with_selector_field_integer_signed_borrow_selected_option_class return (const void *) borrow_variant_field_selected_class_option(field); } +BT_EXPORT enum bt_field_variant_select_option_by_index_status bt_field_variant_select_option_by_index( struct bt_field *field, uint64_t index) @@ -1237,6 +1276,7 @@ bt_field_variant_select_option_by_index( return BT_FUNC_STATUS_OK; } +BT_EXPORT uint64_t bt_field_variant_get_selected_option_index( const struct bt_field *field) { @@ -1377,7 +1417,6 @@ void destroy_string_field(struct bt_field *field) g_free(field); } -BT_HIDDEN void bt_field_destroy(struct bt_field *field) { BT_ASSERT(field); @@ -1562,7 +1601,6 @@ void set_array_field_is_frozen(struct bt_field *field, bool is_frozen) set_single_field_is_frozen(field, is_frozen); } -BT_HIDDEN void _bt_field_set_is_frozen(const struct bt_field *field, bool is_frozen) { diff --git a/src/lib/trace-ir/field.h b/src/lib/trace-ir/field.h index df303b66..402fa4c2 100644 --- a/src/lib/trace-ir/field.h +++ b/src/lib/trace-ir/field.h @@ -130,7 +130,6 @@ struct bt_field_string { # define bt_field_set_single(_field, _val) #endif -BT_HIDDEN void _bt_field_set_is_frozen(const struct bt_field *field, bool is_frozen); static inline @@ -164,10 +163,8 @@ end: return is_set; } -BT_HIDDEN struct bt_field *bt_field_create(struct bt_field_class *class); -BT_HIDDEN void bt_field_destroy(struct bt_field *field); #endif /* BABELTRACE_TRACE_IR_FIELDS_INTERNAL_H */ diff --git a/src/lib/trace-ir/packet.c b/src/lib/trace-ir/packet.c index 96cbae01..02b9f9c2 100644 --- a/src/lib/trace-ir/packet.c +++ b/src/lib/trace-ir/packet.c @@ -25,31 +25,34 @@ #include "trace.h" #include "lib/func-status.h" +BT_EXPORT struct bt_stream *bt_packet_borrow_stream(struct bt_packet *packet) { BT_ASSERT_PRE_DEV_PACKET_NON_NULL(packet); return packet->stream; } +BT_EXPORT const struct bt_stream *bt_packet_borrow_stream_const( const struct bt_packet *packet) { return bt_packet_borrow_stream((void *) packet); } +BT_EXPORT struct bt_field *bt_packet_borrow_context_field(struct bt_packet *packet) { BT_ASSERT_PRE_DEV_PACKET_NON_NULL(packet); return packet->context_field ? packet->context_field->field : NULL; } +BT_EXPORT const struct bt_field *bt_packet_borrow_context_field_const( const struct bt_packet *packet) { return bt_packet_borrow_context_field((void *) packet); } -BT_HIDDEN void _bt_packet_set_is_frozen(const struct bt_packet *packet, bool is_frozen) { if (!packet) { @@ -93,7 +96,6 @@ void recycle_context_field(struct bt_field_wrapper *context_field, context_field); } -BT_HIDDEN void bt_packet_recycle(struct bt_packet *packet) { struct bt_stream *stream; @@ -131,7 +133,6 @@ void bt_packet_recycle(struct bt_packet *packet) bt_object_put_ref_no_null_check(&stream->base); } -BT_HIDDEN void bt_packet_destroy(struct bt_packet *packet) { BT_LIB_LOGD("Destroying packet: %!+a", packet); @@ -153,7 +154,6 @@ void bt_packet_destroy(struct bt_packet *packet) g_free(packet); } -BT_HIDDEN struct bt_packet *bt_packet_new(struct bt_stream *stream) { struct bt_packet *packet = NULL; @@ -197,6 +197,7 @@ end: return packet; } +BT_EXPORT struct bt_packet *bt_packet_create(const struct bt_stream *c_stream) { struct bt_packet *packet = NULL; @@ -226,11 +227,13 @@ end: return (void *) packet; } +BT_EXPORT void bt_packet_get_ref(const struct bt_packet *packet) { bt_object_get_ref(packet); } +BT_EXPORT void bt_packet_put_ref(const struct bt_packet *packet) { bt_object_put_ref(packet); diff --git a/src/lib/trace-ir/packet.h b/src/lib/trace-ir/packet.h index 752611a0..ff75619f 100644 --- a/src/lib/trace-ir/packet.h +++ b/src/lib/trace-ir/packet.h @@ -26,7 +26,6 @@ struct bt_packet { bool frozen; }; -BT_HIDDEN void _bt_packet_set_is_frozen(const struct bt_packet *packet, bool is_frozen); #ifdef BT_DEV_MODE @@ -35,13 +34,10 @@ void _bt_packet_set_is_frozen(const struct bt_packet *packet, bool is_frozen); # define bt_packet_set_is_frozen(_packet, _is_frozen) #endif /* BT_DEV_MODE */ -BT_HIDDEN struct bt_packet *bt_packet_new(struct bt_stream *stream); -BT_HIDDEN void bt_packet_recycle(struct bt_packet *packet); -BT_HIDDEN void bt_packet_destroy(struct bt_packet *packet); #endif /* BABELTRACE_TRACE_IR_PACKET_INTERNAL_H */ diff --git a/src/lib/trace-ir/resolve-field-path.c b/src/lib/trace-ir/resolve-field-path.c index 51719387..cc734cee 100644 --- a/src/lib/trace-ir/resolve-field-path.c +++ b/src/lib/trace-ir/resolve-field-path.c @@ -506,7 +506,6 @@ struct bt_field_path *resolve_field_path(struct bt_field_class *src_fc, return find_field_class_in_ctx(tgt_fc, ctx); } -BT_HIDDEN int bt_resolve_field_paths(struct bt_field_class *fc, struct bt_resolve_field_path_context *ctx, const char *api_func) diff --git a/src/lib/trace-ir/resolve-field-path.h b/src/lib/trace-ir/resolve-field-path.h index 4cd436a3..3ccd9331 100644 --- a/src/lib/trace-ir/resolve-field-path.h +++ b/src/lib/trace-ir/resolve-field-path.h @@ -23,7 +23,6 @@ struct bt_resolve_field_path_context { struct bt_field_class *event_payload; }; -BT_HIDDEN int bt_resolve_field_paths(struct bt_field_class *field_class, struct bt_resolve_field_path_context *ctx, const char *api_func); diff --git a/src/lib/trace-ir/stream-class.c b/src/lib/trace-ir/stream-class.c index 73d96f0e..43551b71 100644 --- a/src/lib/trace-ir/stream-class.c +++ b/src/lib/trace-ir/stream-class.c @@ -161,6 +161,7 @@ end: return stream_class; } +BT_EXPORT struct bt_stream_class *bt_stream_class_create(struct bt_trace_class *tc) { BT_ASSERT_PRE_NO_ERROR(); @@ -173,6 +174,7 @@ struct bt_stream_class *bt_stream_class_create(struct bt_trace_class *tc) (uint64_t) tc->stream_classes->len); } +BT_EXPORT struct bt_stream_class *bt_stream_class_create_with_id( struct bt_trace_class *tc, uint64_t id) { @@ -186,6 +188,7 @@ struct bt_stream_class *bt_stream_class_create_with_id( return create_stream_class_with_id(tc, id); } +BT_EXPORT struct bt_trace_class *bt_stream_class_borrow_trace_class( struct bt_stream_class *stream_class) { @@ -193,18 +196,21 @@ struct bt_trace_class *bt_stream_class_borrow_trace_class( return bt_stream_class_borrow_trace_class_inline(stream_class); } +BT_EXPORT const struct bt_trace_class *bt_stream_class_borrow_trace_class_const( const struct bt_stream_class *stream_class) { return bt_stream_class_borrow_trace_class((void *) stream_class); } +BT_EXPORT const char *bt_stream_class_get_name(const struct bt_stream_class *stream_class) { BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class); return stream_class->name.value; } +BT_EXPORT enum bt_stream_class_set_name_status bt_stream_class_set_name( struct bt_stream_class *stream_class, const char *name) @@ -219,12 +225,14 @@ enum bt_stream_class_set_name_status bt_stream_class_set_name( return BT_FUNC_STATUS_OK; } +BT_EXPORT uint64_t bt_stream_class_get_id(const struct bt_stream_class *stream_class) { BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class); return stream_class->id; } +BT_EXPORT uint64_t bt_stream_class_get_event_class_count( const struct bt_stream_class *stream_class) { @@ -232,6 +240,7 @@ uint64_t bt_stream_class_get_event_class_count( return (uint64_t) stream_class->event_classes->len; } +BT_EXPORT struct bt_event_class *bt_stream_class_borrow_event_class_by_index( struct bt_stream_class *stream_class, uint64_t index) { @@ -240,6 +249,7 @@ struct bt_event_class *bt_stream_class_borrow_event_class_by_index( return g_ptr_array_index(stream_class->event_classes, index); } +BT_EXPORT const struct bt_event_class * bt_stream_class_borrow_event_class_by_index_const( const struct bt_stream_class *stream_class, uint64_t index) @@ -248,6 +258,7 @@ bt_stream_class_borrow_event_class_by_index_const( (void *) stream_class, index); } +BT_EXPORT struct bt_event_class *bt_stream_class_borrow_event_class_by_id( struct bt_stream_class *stream_class, uint64_t id) { @@ -270,6 +281,7 @@ end: return event_class; } +BT_EXPORT const struct bt_event_class * bt_stream_class_borrow_event_class_by_id_const( const struct bt_stream_class *stream_class, uint64_t id) @@ -278,6 +290,7 @@ bt_stream_class_borrow_event_class_by_id_const( (void *) stream_class, id); } +BT_EXPORT const struct bt_field_class * bt_stream_class_borrow_packet_context_field_class_const( const struct bt_stream_class *stream_class) @@ -286,6 +299,7 @@ bt_stream_class_borrow_packet_context_field_class_const( return stream_class->packet_context_fc; } +BT_EXPORT struct bt_field_class * bt_stream_class_borrow_packet_context_field_class( struct bt_stream_class *stream_class) @@ -294,6 +308,7 @@ bt_stream_class_borrow_packet_context_field_class( return stream_class->packet_context_fc; } +BT_EXPORT enum bt_stream_class_set_field_class_status bt_stream_class_set_packet_context_field_class( struct bt_stream_class *stream_class, @@ -340,6 +355,7 @@ end: return ret; } +BT_EXPORT const struct bt_field_class * bt_stream_class_borrow_event_common_context_field_class_const( const struct bt_stream_class *stream_class) @@ -348,6 +364,7 @@ bt_stream_class_borrow_event_common_context_field_class_const( return stream_class->event_common_context_fc; } +BT_EXPORT struct bt_field_class * bt_stream_class_borrow_event_common_context_field_class( struct bt_stream_class *stream_class) @@ -356,6 +373,7 @@ bt_stream_class_borrow_event_common_context_field_class( return stream_class->event_common_context_fc; } +BT_EXPORT enum bt_stream_class_set_field_class_status bt_stream_class_set_event_common_context_field_class( struct bt_stream_class *stream_class, @@ -399,7 +417,6 @@ end: return ret; } -BT_HIDDEN void _bt_stream_class_freeze(const struct bt_stream_class *stream_class) { /* The field classes and default clock class are already frozen */ @@ -411,6 +428,7 @@ void _bt_stream_class_freeze(const struct bt_stream_class *stream_class) ((struct bt_stream_class *) stream_class)->frozen = true; } +BT_EXPORT enum bt_stream_class_set_default_clock_class_status bt_stream_class_set_default_clock_class( struct bt_stream_class *stream_class, @@ -429,6 +447,7 @@ bt_stream_class_set_default_clock_class( return BT_FUNC_STATUS_OK; } +BT_EXPORT struct bt_clock_class *bt_stream_class_borrow_default_clock_class( struct bt_stream_class *stream_class) { @@ -436,6 +455,7 @@ struct bt_clock_class *bt_stream_class_borrow_default_clock_class( return stream_class->default_clock_class; } +BT_EXPORT const struct bt_clock_class *bt_stream_class_borrow_default_clock_class_const( const struct bt_stream_class *stream_class) { @@ -443,6 +463,7 @@ const struct bt_clock_class *bt_stream_class_borrow_default_clock_class_const( return stream_class->default_clock_class; } +BT_EXPORT bt_bool bt_stream_class_assigns_automatic_event_class_id( const struct bt_stream_class *stream_class) { @@ -450,6 +471,7 @@ bt_bool bt_stream_class_assigns_automatic_event_class_id( return (bt_bool) stream_class->assigns_automatic_event_class_id; } +BT_EXPORT void bt_stream_class_set_assigns_automatic_event_class_id( struct bt_stream_class *stream_class, bt_bool value) @@ -461,6 +483,7 @@ void bt_stream_class_set_assigns_automatic_event_class_id( "assignment property: %!+S", stream_class); } +BT_EXPORT bt_bool bt_stream_class_assigns_automatic_stream_id( const struct bt_stream_class *stream_class) { @@ -468,6 +491,7 @@ bt_bool bt_stream_class_assigns_automatic_stream_id( return (bt_bool) stream_class->assigns_automatic_stream_id; } +BT_EXPORT void bt_stream_class_set_supports_discarded_events( struct bt_stream_class *stream_class, bt_bool supports_discarded_events, @@ -492,6 +516,7 @@ void bt_stream_class_set_supports_discarded_events( "%!+S", stream_class); } +BT_EXPORT bt_bool bt_stream_class_supports_discarded_events( const struct bt_stream_class *stream_class) { @@ -499,6 +524,7 @@ bt_bool bt_stream_class_supports_discarded_events( return (bt_bool) stream_class->supports_discarded_events; } +BT_EXPORT bt_bool bt_stream_class_discarded_events_have_default_clock_snapshots( const struct bt_stream_class *stream_class) { @@ -506,6 +532,7 @@ bt_bool bt_stream_class_discarded_events_have_default_clock_snapshots( return (bt_bool) stream_class->discarded_events_have_default_clock_snapshots; } +BT_EXPORT void bt_stream_class_set_supports_discarded_packets( struct bt_stream_class *stream_class, bt_bool supports_discarded_packets, @@ -535,6 +562,7 @@ void bt_stream_class_set_supports_discarded_packets( "%!+S", stream_class); } +BT_EXPORT bt_bool bt_stream_class_supports_discarded_packets( const struct bt_stream_class *stream_class) { @@ -542,6 +570,7 @@ bt_bool bt_stream_class_supports_discarded_packets( return (bt_bool) stream_class->supports_discarded_packets; } +BT_EXPORT bt_bool bt_stream_class_discarded_packets_have_default_clock_snapshots( const struct bt_stream_class *stream_class) { @@ -549,6 +578,7 @@ bt_bool bt_stream_class_discarded_packets_have_default_clock_snapshots( return (bt_bool) stream_class->discarded_packets_have_default_clock_snapshots; } +BT_EXPORT void bt_stream_class_set_supports_packets( struct bt_stream_class *stream_class, bt_bool supports_packets, @@ -586,6 +616,7 @@ void bt_stream_class_set_supports_packets( stream_class); } +BT_EXPORT bt_bool bt_stream_class_supports_packets( const struct bt_stream_class *stream_class) { @@ -593,6 +624,7 @@ bt_bool bt_stream_class_supports_packets( return (bt_bool) stream_class->supports_packets; } +BT_EXPORT bt_bool bt_stream_class_packets_have_beginning_default_clock_snapshot( const struct bt_stream_class *stream_class) { @@ -600,6 +632,7 @@ bt_bool bt_stream_class_packets_have_beginning_default_clock_snapshot( return (bt_bool) stream_class->packets_have_beginning_default_clock_snapshot; } +BT_EXPORT bt_bool bt_stream_class_packets_have_end_default_clock_snapshot( const struct bt_stream_class *stream_class) { @@ -607,6 +640,7 @@ bt_bool bt_stream_class_packets_have_end_default_clock_snapshot( return (bt_bool) stream_class->packets_have_end_default_clock_snapshot; } +BT_EXPORT void bt_stream_class_set_assigns_automatic_stream_id( struct bt_stream_class *stream_class, bt_bool value) @@ -618,6 +652,7 @@ void bt_stream_class_set_assigns_automatic_stream_id( "assignment property: %!+S", stream_class); } +BT_EXPORT const struct bt_value *bt_stream_class_borrow_user_attributes_const( const struct bt_stream_class *stream_class) { @@ -625,6 +660,7 @@ const struct bt_value *bt_stream_class_borrow_user_attributes_const( return stream_class->user_attributes; } +BT_EXPORT struct bt_value *bt_stream_class_borrow_user_attributes( struct bt_stream_class *stream_class) { @@ -632,6 +668,7 @@ struct bt_value *bt_stream_class_borrow_user_attributes( (void *) stream_class); } +BT_EXPORT void bt_stream_class_set_user_attributes( struct bt_stream_class *stream_class, const struct bt_value *user_attributes) @@ -645,11 +682,13 @@ void bt_stream_class_set_user_attributes( bt_object_get_ref_no_null_check(stream_class->user_attributes); } +BT_EXPORT void bt_stream_class_get_ref(const struct bt_stream_class *stream_class) { bt_object_get_ref(stream_class); } +BT_EXPORT void bt_stream_class_put_ref(const struct bt_stream_class *stream_class) { bt_object_put_ref(stream_class); diff --git a/src/lib/trace-ir/stream-class.h b/src/lib/trace-ir/stream-class.h index 16573ff9..a7a9c3b6 100644 --- a/src/lib/trace-ir/stream-class.h +++ b/src/lib/trace-ir/stream-class.h @@ -57,7 +57,6 @@ struct bt_stream_class { bool frozen; }; -BT_HIDDEN void _bt_stream_class_freeze(const struct bt_stream_class *stream_class); #ifdef BT_DEV_MODE diff --git a/src/lib/trace-ir/stream.c b/src/lib/trace-ir/stream.c index fcfe3d4b..269fc72a 100644 --- a/src/lib/trace-ir/stream.c +++ b/src/lib/trace-ir/stream.c @@ -149,6 +149,7 @@ end: return stream; } +BT_EXPORT struct bt_stream *bt_stream_create(struct bt_stream_class *stream_class, struct bt_trace *trace) { @@ -165,6 +166,7 @@ struct bt_stream *bt_stream_create(struct bt_stream_class *stream_class, return create_stream_with_id(stream_class, trace, id, __func__); } +BT_EXPORT struct bt_stream *bt_stream_create_with_id(struct bt_stream_class *stream_class, struct bt_trace *trace, uint64_t id) { @@ -178,36 +180,42 @@ struct bt_stream *bt_stream_create_with_id(struct bt_stream_class *stream_class, return create_stream_with_id(stream_class, trace, id, __func__); } +BT_EXPORT struct bt_stream_class *bt_stream_borrow_class(struct bt_stream *stream) { BT_ASSERT_PRE_DEV_STREAM_NON_NULL(stream); return stream->class; } +BT_EXPORT const struct bt_stream_class *bt_stream_borrow_class_const( const struct bt_stream *stream) { return bt_stream_borrow_class((void *) stream); } +BT_EXPORT struct bt_trace *bt_stream_borrow_trace(struct bt_stream *stream) { BT_ASSERT_PRE_DEV_STREAM_NON_NULL(stream); return bt_stream_borrow_trace_inline(stream); } +BT_EXPORT const struct bt_trace *bt_stream_borrow_trace_const( const struct bt_stream *stream) { return bt_stream_borrow_trace((void *) stream); } +BT_EXPORT const char *bt_stream_get_name(const struct bt_stream *stream) { BT_ASSERT_PRE_DEV_STREAM_NON_NULL(stream); return stream->name.value; } +BT_EXPORT enum bt_stream_set_name_status bt_stream_set_name(struct bt_stream *stream, const char *name) { @@ -221,13 +229,13 @@ enum bt_stream_set_name_status bt_stream_set_name(struct bt_stream *stream, return BT_FUNC_STATUS_OK; } +BT_EXPORT uint64_t bt_stream_get_id(const struct bt_stream *stream) { BT_ASSERT_PRE_DEV_SC_NON_NULL(stream); return stream->id; } -BT_HIDDEN void _bt_stream_freeze(const struct bt_stream *stream) { BT_ASSERT(stream); @@ -238,6 +246,7 @@ void _bt_stream_freeze(const struct bt_stream *stream) ((struct bt_stream *) stream)->frozen = true; } +BT_EXPORT const struct bt_value *bt_stream_borrow_user_attributes_const( const struct bt_stream *stream) { @@ -245,11 +254,13 @@ const struct bt_value *bt_stream_borrow_user_attributes_const( return stream->user_attributes; } +BT_EXPORT struct bt_value *bt_stream_borrow_user_attributes(struct bt_stream *stream) { return (void *) bt_stream_borrow_user_attributes_const((void *) stream); } +BT_EXPORT void bt_stream_set_user_attributes(struct bt_stream *stream, const struct bt_value *user_attributes) { @@ -262,11 +273,13 @@ void bt_stream_set_user_attributes(struct bt_stream *stream, bt_object_get_ref_no_null_check(stream->user_attributes); } +BT_EXPORT void bt_stream_get_ref(const struct bt_stream *stream) { bt_object_get_ref(stream); } +BT_EXPORT void bt_stream_put_ref(const struct bt_stream *stream) { bt_object_put_ref(stream); diff --git a/src/lib/trace-ir/stream.h b/src/lib/trace-ir/stream.h index 68043887..ee120fe5 100644 --- a/src/lib/trace-ir/stream.h +++ b/src/lib/trace-ir/stream.h @@ -44,7 +44,6 @@ struct bt_stream { bool frozen; }; -BT_HIDDEN void _bt_stream_freeze(const struct bt_stream *stream); #ifdef BT_DEV_MODE diff --git a/src/lib/trace-ir/trace-class.c b/src/lib/trace-ir/trace-class.c index 642fa906..9f7068a7 100644 --- a/src/lib/trace-ir/trace-class.c +++ b/src/lib/trace-ir/trace-class.c @@ -121,6 +121,7 @@ void destroy_trace_class(struct bt_object *obj) g_free(tc); } +BT_EXPORT struct bt_trace_class *bt_trace_class_create(bt_self_component *self_comp) { struct bt_trace_class *tc = NULL; @@ -167,6 +168,7 @@ end: return tc; } +BT_EXPORT enum bt_trace_class_add_listener_status bt_trace_class_add_destruction_listener( const struct bt_trace_class *_tc, bt_trace_class_destruction_listener_func listener, @@ -218,6 +220,7 @@ bool has_listener_id(const struct bt_trace_class *tc, uint64_t listener_id) listener_id))->func; } +BT_EXPORT enum bt_trace_class_remove_listener_status bt_trace_class_remove_destruction_listener( const struct bt_trace_class *_tc, bt_listener_id listener_id) { @@ -243,12 +246,14 @@ enum bt_trace_class_remove_listener_status bt_trace_class_remove_destruction_lis return BT_FUNC_STATUS_OK; } +BT_EXPORT uint64_t bt_trace_class_get_stream_class_count(const struct bt_trace_class *tc) { BT_ASSERT_PRE_DEV_TC_NON_NULL(tc); return (uint64_t) tc->stream_classes->len; } +BT_EXPORT struct bt_stream_class *bt_trace_class_borrow_stream_class_by_index( struct bt_trace_class *tc, uint64_t index) { @@ -257,6 +262,7 @@ struct bt_stream_class *bt_trace_class_borrow_stream_class_by_index( return g_ptr_array_index(tc->stream_classes, index); } +BT_EXPORT const struct bt_stream_class * bt_trace_class_borrow_stream_class_by_index_const( const struct bt_trace_class *tc, uint64_t index) @@ -265,6 +271,7 @@ bt_trace_class_borrow_stream_class_by_index_const( (void *) tc, index); } +BT_EXPORT struct bt_stream_class *bt_trace_class_borrow_stream_class_by_id( struct bt_trace_class *tc, uint64_t id) { @@ -287,6 +294,7 @@ end: return stream_class; } +BT_EXPORT const struct bt_stream_class * bt_trace_class_borrow_stream_class_by_id_const( const struct bt_trace_class *tc, uint64_t id) @@ -294,7 +302,6 @@ bt_trace_class_borrow_stream_class_by_id_const( return bt_trace_class_borrow_stream_class_by_id((void *) tc, id); } -BT_HIDDEN void _bt_trace_class_freeze(const struct bt_trace_class *tc) { BT_ASSERT(tc); @@ -302,12 +309,14 @@ void _bt_trace_class_freeze(const struct bt_trace_class *tc) ((struct bt_trace_class *) tc)->frozen = true; } +BT_EXPORT bt_bool bt_trace_class_assigns_automatic_stream_class_id(const struct bt_trace_class *tc) { BT_ASSERT_PRE_DEV_TC_NON_NULL(tc); return (bt_bool) tc->assigns_automatic_stream_class_id; } +BT_EXPORT void bt_trace_class_set_assigns_automatic_stream_class_id(struct bt_trace_class *tc, bt_bool value) { @@ -318,6 +327,7 @@ void bt_trace_class_set_assigns_automatic_stream_class_id(struct bt_trace_class "assignment property: %!+T", tc); } +BT_EXPORT const struct bt_value *bt_trace_class_borrow_user_attributes_const( const struct bt_trace_class *trace_class) { @@ -325,6 +335,7 @@ const struct bt_value *bt_trace_class_borrow_user_attributes_const( return trace_class->user_attributes; } +BT_EXPORT struct bt_value *bt_trace_class_borrow_user_attributes( struct bt_trace_class *trace_class) { @@ -332,6 +343,7 @@ struct bt_value *bt_trace_class_borrow_user_attributes( (void *) trace_class); } +BT_EXPORT void bt_trace_class_set_user_attributes(struct bt_trace_class *trace_class, const struct bt_value *user_attributes) { @@ -344,11 +356,13 @@ void bt_trace_class_set_user_attributes(struct bt_trace_class *trace_class, bt_object_get_ref_no_null_check(trace_class->user_attributes); } +BT_EXPORT void bt_trace_class_get_ref(const struct bt_trace_class *trace_class) { bt_object_get_ref(trace_class); } +BT_EXPORT void bt_trace_class_put_ref(const struct bt_trace_class *trace_class) { bt_object_put_ref(trace_class); diff --git a/src/lib/trace-ir/trace-class.h b/src/lib/trace-ir/trace-class.h index 0a09dfbe..09b07e20 100644 --- a/src/lib/trace-ir/trace-class.h +++ b/src/lib/trace-ir/trace-class.h @@ -39,7 +39,6 @@ struct bt_trace_class { bool frozen; }; -BT_HIDDEN void _bt_trace_class_freeze(const struct bt_trace_class *trace_class); #ifdef BT_DEV_MODE diff --git a/src/lib/trace-ir/trace.c b/src/lib/trace-ir/trace.c index bd20f9fb..e2a462ec 100644 --- a/src/lib/trace-ir/trace.c +++ b/src/lib/trace-ir/trace.c @@ -143,6 +143,7 @@ void destroy_trace(struct bt_object *obj) g_free(trace); } +BT_EXPORT struct bt_trace *bt_trace_create(struct bt_trace_class *tc) { struct bt_trace *trace = NULL; @@ -209,12 +210,14 @@ end: return trace; } +BT_EXPORT const char *bt_trace_get_name(const struct bt_trace *trace) { BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace); return trace->name.value; } +BT_EXPORT enum bt_trace_set_name_status bt_trace_set_name(struct bt_trace *trace, const char *name) { @@ -228,12 +231,14 @@ enum bt_trace_set_name_status bt_trace_set_name(struct bt_trace *trace, return BT_FUNC_STATUS_OK; } +BT_EXPORT bt_uuid bt_trace_get_uuid(const struct bt_trace *trace) { BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace); return trace->uuid.value; } +BT_EXPORT void bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid) { BT_ASSERT_PRE_TRACE_NON_NULL(trace); @@ -284,6 +289,7 @@ enum bt_trace_set_environment_entry_status set_environment_entry( return ret; } +BT_EXPORT enum bt_trace_set_environment_entry_status bt_trace_set_environment_entry_string( struct bt_trace *trace, const char *name, const char *value) @@ -312,6 +318,7 @@ end: return ret; } +BT_EXPORT enum bt_trace_set_environment_entry_status bt_trace_set_environment_entry_integer( struct bt_trace *trace, const char *name, int64_t value) @@ -339,12 +346,14 @@ end: return ret; } +BT_EXPORT uint64_t bt_trace_get_environment_entry_count(const struct bt_trace *trace) { BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace); return bt_attributes_get_count(trace->environment); } +BT_EXPORT void bt_trace_borrow_environment_entry_by_index_const( const struct bt_trace *trace, uint64_t index, const char **name, const struct bt_value **value) @@ -361,6 +370,7 @@ void bt_trace_borrow_environment_entry_by_index_const( BT_ASSERT(*name); } +BT_EXPORT const struct bt_value *bt_trace_borrow_environment_entry_value_by_name_const( const struct bt_trace *trace, const char *name) { @@ -370,12 +380,14 @@ const struct bt_value *bt_trace_borrow_environment_entry_value_by_name_const( name); } +BT_EXPORT uint64_t bt_trace_get_stream_count(const struct bt_trace *trace) { BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace); return (uint64_t) trace->streams->len; } +BT_EXPORT struct bt_stream *bt_trace_borrow_stream_by_index( struct bt_trace *trace, uint64_t index) { @@ -384,12 +396,14 @@ struct bt_stream *bt_trace_borrow_stream_by_index( return g_ptr_array_index(trace->streams, index); } +BT_EXPORT const struct bt_stream *bt_trace_borrow_stream_by_index_const( const struct bt_trace *trace, uint64_t index) { return bt_trace_borrow_stream_by_index((void *) trace, index); } +BT_EXPORT struct bt_stream *bt_trace_borrow_stream_by_id(struct bt_trace *trace, uint64_t id) { @@ -412,12 +426,14 @@ end: return stream; } +BT_EXPORT const struct bt_stream *bt_trace_borrow_stream_by_id_const( const struct bt_trace *trace, uint64_t id) { return bt_trace_borrow_stream_by_id((void *) trace, id); } +BT_EXPORT enum bt_trace_add_listener_status bt_trace_add_destruction_listener( const struct bt_trace *c_trace, bt_trace_destruction_listener_func listener, @@ -469,6 +485,7 @@ bool has_listener_id(const struct bt_trace *trace, uint64_t listener_id) listener_id))->func; } +BT_EXPORT enum bt_trace_remove_listener_status bt_trace_remove_destruction_listener( const struct bt_trace *c_trace, bt_listener_id listener_id) { @@ -494,7 +511,6 @@ enum bt_trace_remove_listener_status bt_trace_remove_destruction_listener( return BT_FUNC_STATUS_OK; } -BT_HIDDEN void _bt_trace_freeze(const struct bt_trace *trace) { BT_ASSERT(trace); @@ -507,7 +523,6 @@ void _bt_trace_freeze(const struct bt_trace *trace) ((struct bt_trace *) trace)->frozen = true; } -BT_HIDDEN void bt_trace_add_stream(struct bt_trace *trace, struct bt_stream *stream) { guint count = 0; @@ -526,7 +541,6 @@ void bt_trace_add_stream(struct bt_trace *trace, struct bt_stream *stream) stream->class, GUINT_TO_POINTER(count + 1)); } -BT_HIDDEN uint64_t bt_trace_get_automatic_stream_id(const struct bt_trace *trace, const struct bt_stream_class *stream_class) { @@ -544,18 +558,21 @@ uint64_t bt_trace_get_automatic_stream_id(const struct bt_trace *trace, return id; } +BT_EXPORT struct bt_trace_class *bt_trace_borrow_class(struct bt_trace *trace) { BT_ASSERT_PRE_DEV_TRACE_NON_NULL(trace); return trace->class; } +BT_EXPORT const struct bt_trace_class *bt_trace_borrow_class_const( const struct bt_trace *trace) { return bt_trace_borrow_class((void *) trace); } +BT_EXPORT const struct bt_value *bt_trace_borrow_user_attributes_const( const struct bt_trace *trace) { @@ -563,11 +580,13 @@ const struct bt_value *bt_trace_borrow_user_attributes_const( return trace->user_attributes; } +BT_EXPORT struct bt_value *bt_trace_borrow_user_attributes(struct bt_trace *trace) { return (void *) bt_trace_borrow_user_attributes_const((void *) trace); } +BT_EXPORT void bt_trace_set_user_attributes( struct bt_trace *trace, const struct bt_value *user_attributes) @@ -581,11 +600,13 @@ void bt_trace_set_user_attributes( bt_object_get_ref_no_null_check(trace->user_attributes); } +BT_EXPORT void bt_trace_get_ref(const struct bt_trace *trace) { bt_object_get_ref(trace); } +BT_EXPORT void bt_trace_put_ref(const struct bt_trace *trace) { bt_object_put_ref(trace); diff --git a/src/lib/trace-ir/trace.h b/src/lib/trace-ir/trace.h index c6208778..9b6766db 100644 --- a/src/lib/trace-ir/trace.h +++ b/src/lib/trace-ir/trace.h @@ -66,7 +66,6 @@ struct bt_trace { bool frozen; }; -BT_HIDDEN void _bt_trace_freeze(const struct bt_trace *trace); #ifdef BT_DEV_MODE @@ -75,10 +74,8 @@ void _bt_trace_freeze(const struct bt_trace *trace); # define bt_trace_freeze(_trace) #endif -BT_HIDDEN void bt_trace_add_stream(struct bt_trace *trace, struct bt_stream *stream); -BT_HIDDEN uint64_t bt_trace_get_automatic_stream_id(const struct bt_trace *trace, const struct bt_stream_class *stream_class); diff --git a/src/lib/util.c b/src/lib/util.c index 49d39f0b..74a4dd58 100644 --- a/src/lib/util.c +++ b/src/lib/util.c @@ -15,6 +15,7 @@ #include #include "lib/trace-ir/utils.h" +BT_EXPORT bt_util_clock_cycles_to_ns_from_origin_status bt_util_clock_cycles_to_ns_from_origin(uint64_t cycles, uint64_t frequency, int64_t offset_seconds, diff --git a/src/lib/value.c b/src/lib/value.c index e570b005..12544939 100644 --- a/src/lib/value.c +++ b/src/lib/value.c @@ -56,6 +56,7 @@ struct bt_value bt_value_null_instance = { .frozen = BT_TRUE, }; +BT_EXPORT struct bt_value *const bt_value_null = &bt_value_null_instance; static @@ -521,7 +522,6 @@ void bt_value_destroy(struct bt_object *obj) g_free(value); } -BT_HIDDEN void _bt_value_freeze(const struct bt_value *c_object) { const struct bt_value *object = (void *) c_object; @@ -539,6 +539,7 @@ end: return; } +BT_EXPORT enum bt_value_type bt_value_get_type(const struct bt_value *object) { BT_ASSERT_PRE_DEV_VALUE_NON_NULL(object); @@ -556,6 +557,7 @@ struct bt_value bt_value_create_base(enum bt_value_type type) return value; } +BT_EXPORT struct bt_value *bt_value_bool_create_init(bt_bool val) { struct bt_value_bool *bool_obj; @@ -578,6 +580,7 @@ end: return (void *) bool_obj; } +BT_EXPORT struct bt_value *bt_value_bool_create(void) { BT_ASSERT_PRE_NO_ERROR(); @@ -619,6 +622,7 @@ end: return (void *) integer_obj; } +BT_EXPORT struct bt_value *bt_value_integer_unsigned_create_init(uint64_t val) { BT_ASSERT_PRE_NO_ERROR(); @@ -627,6 +631,7 @@ struct bt_value *bt_value_integer_unsigned_create_init(uint64_t val) val); } +BT_EXPORT struct bt_value *bt_value_integer_unsigned_create(void) { BT_ASSERT_PRE_NO_ERROR(); @@ -634,6 +639,7 @@ struct bt_value *bt_value_integer_unsigned_create(void) return bt_value_integer_unsigned_create_init(0); } +BT_EXPORT struct bt_value *bt_value_integer_signed_create_init(int64_t val) { BT_ASSERT_PRE_NO_ERROR(); @@ -642,6 +648,7 @@ struct bt_value *bt_value_integer_signed_create_init(int64_t val) (uint64_t) val); } +BT_EXPORT struct bt_value *bt_value_integer_signed_create(void) { BT_ASSERT_PRE_NO_ERROR(); @@ -649,6 +656,7 @@ struct bt_value *bt_value_integer_signed_create(void) return bt_value_integer_signed_create_init(0); } +BT_EXPORT struct bt_value *bt_value_real_create_init(double val) { struct bt_value_real *real_obj; @@ -672,6 +680,7 @@ end: return (void *) real_obj; } +BT_EXPORT struct bt_value *bt_value_real_create(void) { BT_ASSERT_PRE_NO_ERROR(); @@ -679,6 +688,7 @@ struct bt_value *bt_value_real_create(void) return bt_value_real_create_init(0.); } +BT_EXPORT struct bt_value *bt_value_string_create_init(const char *val) { struct bt_value_string *string_obj = NULL; @@ -711,6 +721,7 @@ end: return (void *) string_obj; } +BT_EXPORT struct bt_value *bt_value_string_create(void) { BT_ASSERT_PRE_NO_ERROR(); @@ -718,6 +729,7 @@ struct bt_value *bt_value_string_create(void) return bt_value_string_create_init(""); } +BT_EXPORT struct bt_value *bt_value_array_create(void) { struct bt_value_array *array_obj; @@ -749,6 +761,7 @@ end: return (void *) array_obj; } +BT_EXPORT struct bt_value *bt_value_map_create(void) { struct bt_value_map *map_obj; @@ -779,6 +792,7 @@ end: return (void *) map_obj; } +BT_EXPORT bt_bool bt_value_bool_get(const struct bt_value *bool_obj) { BT_ASSERT_PRE_DEV_VALUE_NON_NULL(bool_obj); @@ -786,6 +800,7 @@ bt_bool bt_value_bool_get(const struct bt_value *bool_obj) return BT_VALUE_TO_BOOL(bool_obj)->value; } +BT_EXPORT void bt_value_bool_set(struct bt_value *bool_obj, bt_bool val) { BT_ASSERT_PRE_VALUE_NON_NULL(bool_obj); @@ -795,6 +810,7 @@ void bt_value_bool_set(struct bt_value *bool_obj, bt_bool val) bool_obj, val); } +BT_EXPORT uint64_t bt_value_integer_unsigned_get(const struct bt_value *integer_obj) { BT_ASSERT_PRE_DEV_VALUE_NON_NULL(integer_obj); @@ -802,6 +818,7 @@ uint64_t bt_value_integer_unsigned_get(const struct bt_value *integer_obj) return BT_VALUE_TO_INTEGER(integer_obj)->value.u; } +BT_EXPORT int64_t bt_value_integer_signed_get(const struct bt_value *integer_obj) { BT_ASSERT_PRE_DEV_VALUE_NON_NULL(integer_obj); @@ -818,6 +835,7 @@ void set_integer_value(struct bt_value *integer_obj, BT_VALUE_TO_INTEGER(integer_obj)->value.u = uval; } +BT_EXPORT void bt_value_integer_unsigned_set(struct bt_value *integer_obj, uint64_t val) { @@ -829,6 +847,7 @@ void bt_value_integer_unsigned_set(struct bt_value *integer_obj, "value-addr=%p, value=%" PRIu64, integer_obj, val); } +BT_EXPORT void bt_value_integer_signed_set(struct bt_value *integer_obj, int64_t val) { @@ -840,6 +859,7 @@ void bt_value_integer_signed_set(struct bt_value *integer_obj, "value-addr=%p, value=%" PRId64, integer_obj, val); } +BT_EXPORT double bt_value_real_get(const struct bt_value *real_obj) { BT_ASSERT_PRE_DEV_VALUE_NON_NULL(real_obj); @@ -847,6 +867,7 @@ double bt_value_real_get(const struct bt_value *real_obj) return BT_VALUE_TO_REAL(real_obj)->value; } +BT_EXPORT void bt_value_real_set(struct bt_value *real_obj, double val) { BT_ASSERT_PRE_VALUE_NON_NULL(real_obj); @@ -857,6 +878,7 @@ void bt_value_real_set(struct bt_value *real_obj, double val) real_obj, val); } +BT_EXPORT const char *bt_value_string_get(const struct bt_value *string_obj) { BT_ASSERT_PRE_DEV_VALUE_NON_NULL(string_obj); @@ -864,6 +886,7 @@ const char *bt_value_string_get(const struct bt_value *string_obj) return BT_VALUE_TO_STRING(string_obj)->gstr->str; } +BT_EXPORT enum bt_value_string_set_status bt_value_string_set( struct bt_value *string_obj, const char *val) { @@ -877,6 +900,7 @@ enum bt_value_string_set_status bt_value_string_set( return BT_FUNC_STATUS_OK; } +BT_EXPORT uint64_t bt_value_array_get_length(const struct bt_value *array_obj) { BT_ASSERT_PRE_DEV_VALUE_NON_NULL(array_obj); @@ -884,6 +908,7 @@ uint64_t bt_value_array_get_length(const struct bt_value *array_obj) return (uint64_t) BT_VALUE_TO_ARRAY(array_obj)->garray->len; } +BT_EXPORT struct bt_value *bt_value_array_borrow_element_by_index( struct bt_value *array_obj, uint64_t index) { @@ -896,6 +921,7 @@ struct bt_value *bt_value_array_borrow_element_by_index( return g_ptr_array_index(typed_array_obj->garray, index); } +BT_EXPORT const struct bt_value *bt_value_array_borrow_element_by_index_const( const struct bt_value *array_obj, uint64_t index) @@ -928,6 +954,7 @@ enum bt_value_array_append_element_status append_array_element( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_value_array_append_element_status bt_value_array_append_element( struct bt_value *array_obj, struct bt_value *element_obj) @@ -935,6 +962,7 @@ enum bt_value_array_append_element_status bt_value_array_append_element( return append_array_element(array_obj, element_obj, __func__); } +BT_EXPORT enum bt_value_array_append_element_status bt_value_array_append_bool_element(struct bt_value *array_obj, bt_bool val) { @@ -950,6 +978,7 @@ bt_value_array_append_bool_element(struct bt_value *array_obj, bt_bool val) return ret; } +BT_EXPORT enum bt_value_array_append_element_status bt_value_array_append_unsigned_integer_element(struct bt_value *array_obj, uint64_t val) @@ -966,6 +995,7 @@ bt_value_array_append_unsigned_integer_element(struct bt_value *array_obj, return ret; } +BT_EXPORT enum bt_value_array_append_element_status bt_value_array_append_signed_integer_element(struct bt_value *array_obj, int64_t val) @@ -982,6 +1012,7 @@ bt_value_array_append_signed_integer_element(struct bt_value *array_obj, return ret; } +BT_EXPORT enum bt_value_array_append_element_status bt_value_array_append_real_element(struct bt_value *array_obj, double val) { @@ -997,6 +1028,7 @@ bt_value_array_append_real_element(struct bt_value *array_obj, double val) return ret; } +BT_EXPORT enum bt_value_array_append_element_status bt_value_array_append_string_element(struct bt_value *array_obj, const char *val) @@ -1013,6 +1045,7 @@ bt_value_array_append_string_element(struct bt_value *array_obj, return ret; } +BT_EXPORT enum bt_value_array_append_element_status bt_value_array_append_empty_array_element(struct bt_value *array_obj, struct bt_value **element_obj) @@ -1034,6 +1067,7 @@ bt_value_array_append_empty_array_element(struct bt_value *array_obj, return ret; } +BT_EXPORT enum bt_value_array_append_element_status bt_value_array_append_empty_map_element(struct bt_value *array_obj, struct bt_value **element_obj) @@ -1055,6 +1089,7 @@ bt_value_array_append_empty_map_element(struct bt_value *array_obj, return ret; } +BT_EXPORT enum bt_value_array_set_element_by_index_status bt_value_array_set_element_by_index(struct bt_value *array_obj, uint64_t index, struct bt_value *element_obj) @@ -1079,6 +1114,7 @@ bt_value_array_set_element_by_index(struct bt_value *array_obj, uint64_t index, return BT_FUNC_STATUS_OK; } +BT_EXPORT uint64_t bt_value_map_get_size(const struct bt_value *map_obj) { BT_ASSERT_PRE_DEV_VALUE_NON_NULL(map_obj); @@ -1086,6 +1122,7 @@ uint64_t bt_value_map_get_size(const struct bt_value *map_obj) return (uint64_t) g_hash_table_size(BT_VALUE_TO_MAP(map_obj)->ght); } +BT_EXPORT struct bt_value *bt_value_map_borrow_entry_value(struct bt_value *map_obj, const char *key) { @@ -1096,12 +1133,14 @@ struct bt_value *bt_value_map_borrow_entry_value(struct bt_value *map_obj, GUINT_TO_POINTER(g_quark_from_string(key))); } +BT_EXPORT const struct bt_value *bt_value_map_borrow_entry_value_const( const struct bt_value *map_obj, const char *key) { return bt_value_map_borrow_entry_value((void *) map_obj, key); } +BT_EXPORT bt_bool bt_value_map_has_entry(const struct bt_value *map_obj, const char *key) { BT_ASSERT_PRE_DEV_VALUE_NON_NULL(map_obj); @@ -1134,6 +1173,7 @@ enum bt_value_map_insert_entry_status insert_map_value_entry( return BT_FUNC_STATUS_OK; } +BT_EXPORT enum bt_value_map_insert_entry_status bt_value_map_insert_entry( struct bt_value *map_obj, const char *key, struct bt_value *element_obj) @@ -1141,6 +1181,7 @@ enum bt_value_map_insert_entry_status bt_value_map_insert_entry( return insert_map_value_entry(map_obj, key, element_obj, __func__); } +BT_EXPORT enum bt_value_map_insert_entry_status bt_value_map_insert_bool_entry( struct bt_value *map_obj, const char *key, bt_bool val) { @@ -1156,6 +1197,7 @@ enum bt_value_map_insert_entry_status bt_value_map_insert_bool_entry( return ret; } +BT_EXPORT enum bt_value_map_insert_entry_status bt_value_map_insert_unsigned_integer_entry(struct bt_value *map_obj, const char *key, uint64_t val) @@ -1172,6 +1214,7 @@ bt_value_map_insert_unsigned_integer_entry(struct bt_value *map_obj, return ret; } +BT_EXPORT enum bt_value_map_insert_entry_status bt_value_map_insert_signed_integer_entry(struct bt_value *map_obj, const char *key, int64_t val) @@ -1188,6 +1231,7 @@ bt_value_map_insert_signed_integer_entry(struct bt_value *map_obj, return ret; } +BT_EXPORT enum bt_value_map_insert_entry_status bt_value_map_insert_real_entry( struct bt_value *map_obj, const char *key, double val) { @@ -1203,6 +1247,7 @@ enum bt_value_map_insert_entry_status bt_value_map_insert_real_entry( return ret; } +BT_EXPORT enum bt_value_map_insert_entry_status bt_value_map_insert_string_entry( struct bt_value *map_obj, const char *key, const char *val) @@ -1219,6 +1264,7 @@ enum bt_value_map_insert_entry_status bt_value_map_insert_string_entry( return ret; } +BT_EXPORT enum bt_value_map_insert_entry_status bt_value_map_insert_empty_array_entry( struct bt_value *map_obj, const char *key, @@ -1241,6 +1287,7 @@ bt_value_map_insert_empty_array_entry( return ret; } +BT_EXPORT enum bt_value_map_insert_entry_status bt_value_map_insert_empty_map_entry(struct bt_value *map_obj, const char *key, bt_value **entry_obj) @@ -1321,6 +1368,7 @@ enum bt_value_map_foreach_entry_status foreach_map_entry( return status; } +BT_EXPORT enum bt_value_map_foreach_entry_status bt_value_map_foreach_entry( struct bt_value *map_obj, bt_value_map_foreach_entry_func func, void *data) @@ -1329,6 +1377,7 @@ enum bt_value_map_foreach_entry_status bt_value_map_foreach_entry( "bt_value_map_foreach_entry_func"); } +BT_EXPORT enum bt_value_map_foreach_entry_const_status bt_value_map_foreach_entry_const( const struct bt_value *map_obj, bt_value_map_foreach_entry_const_func func, void *data) @@ -1384,6 +1433,7 @@ end: return status; } +BT_EXPORT enum bt_value_map_extend_status bt_value_map_extend( struct bt_value *base_map_obj, const struct bt_value *extension_obj) @@ -1423,6 +1473,7 @@ enum bt_value_map_extend_status bt_value_map_extend( return status; } +BT_EXPORT enum bt_value_copy_status bt_value_copy(const struct bt_value *object, struct bt_value **copy_obj) { @@ -1446,6 +1497,7 @@ enum bt_value_copy_status bt_value_copy(const struct bt_value *object, return status; } +BT_EXPORT bt_bool bt_value_is_equal(const struct bt_value *object_a, const struct bt_value *object_b) { @@ -1472,11 +1524,13 @@ end: return ret; } +BT_EXPORT void bt_value_get_ref(const struct bt_value *value) { bt_object_get_ref(value); } +BT_EXPORT void bt_value_put_ref(const struct bt_value *value) { bt_object_put_ref(value); diff --git a/src/lib/value.h b/src/lib/value.h index 518012a5..76a480e8 100644 --- a/src/lib/value.h +++ b/src/lib/value.h @@ -52,7 +52,6 @@ struct bt_value_map { GHashTable *ght; }; -BT_HIDDEN void _bt_value_freeze(const struct bt_value *object); #ifdef BT_DEV_MODE diff --git a/src/logging/log.c b/src/logging/log.c index 613e0568..788c00c4 100644 --- a/src/logging/log.c +++ b/src/logging/log.c @@ -646,7 +646,6 @@ static INSTRUMENTED_CONST buffer_cb g_buffer_cb = buffer_callback; #define OUT_DEBUGSTRING OUT_DEBUGSTRING_MASK, 0, out_debugstring_callback #endif -BT_HIDDEN void bt_log_out_stderr_callback(const bt_log_message *const msg, void *arg) { VAR_UNUSED(arg); @@ -690,7 +689,6 @@ static const bt_log_output out_stderr = {BT_LOG_OUT_STDERR}; BT_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL = 0; #endif -BT_HIDDEN const bt_log_spec _bt_log_stderr_spec = { BT_LOG_GLOBAL_FORMAT, @@ -1252,25 +1250,21 @@ static void output_mem(const bt_log_spec *log, bt_log_message *const msg, } } -BT_HIDDEN void bt_log_set_tag_prefix(const char *const prefix) { _bt_log_tag_prefix = prefix; } -BT_HIDDEN void bt_log_set_mem_width(const unsigned w) { _bt_log_global_format.mem_width = w; } -BT_HIDDEN void bt_log_set_output_level(const int lvl) { _bt_log_global_output_lvl = lvl; } -BT_HIDDEN void bt_log_set_output_v(const unsigned mask, void *const arg, const bt_log_output_cb callback) { @@ -1340,7 +1334,6 @@ void _bt_log_write_imp( } } -BT_HIDDEN void _bt_log_write_d( const char *const func, const char *const file, const unsigned line, const int lvl, const char *const tag, @@ -1353,7 +1346,6 @@ void _bt_log_write_d( va_end(va); } -BT_HIDDEN void _bt_log_write_aux_d( const char *const func, const char *const file, const unsigned line, const bt_log_spec *const log, const int lvl, const char *const tag, @@ -1366,7 +1358,6 @@ void _bt_log_write_aux_d( va_end(va); } -BT_HIDDEN void _bt_log_write(const int lvl, const char *const tag, const char *const fmt, ...) { @@ -1376,7 +1367,6 @@ void _bt_log_write(const int lvl, const char *const tag, va_end(va); } -BT_HIDDEN void _bt_log_write_aux( const bt_log_spec *const log, const int lvl, const char *const tag, const char *const fmt, ...) @@ -1387,7 +1377,6 @@ void _bt_log_write_aux( va_end(va); } -BT_HIDDEN void _bt_log_write_mem_d( const char *const func, const char *const file, const unsigned line, const int lvl, const char *const tag, @@ -1402,7 +1391,6 @@ void _bt_log_write_mem_d( va_end(va); } -BT_HIDDEN void _bt_log_write_mem_aux_d( const char *const func, const char *const file, const unsigned line, const bt_log_spec *const log, const int lvl, const char *const tag, @@ -1417,7 +1405,6 @@ void _bt_log_write_mem_aux_d( va_end(va); } -BT_HIDDEN void _bt_log_write_mem(const int lvl, const char *const tag, const void *const d, const unsigned d_sz, const char *const fmt, ...) @@ -1429,7 +1416,6 @@ void _bt_log_write_mem(const int lvl, const char *const tag, va_end(va); } -BT_HIDDEN void _bt_log_write_mem_aux( const bt_log_spec *const log, const int lvl, const char *const tag, const void *const d, const unsigned d_sz, diff --git a/src/logging/log.h b/src/logging/log.h index 41370963..ce4299fb 100644 --- a/src/logging/log.h +++ b/src/logging/log.h @@ -340,10 +340,10 @@ * corresponding BT_LOG_DEFINE_XXX macro MUST be used exactly once somewhere. * Otherwise build will fail with link error (undefined symbol). */ -#define BT_LOG_DEFINE_TAG_PREFIX BT_HIDDEN const char *_bt_log_tag_prefix -#define BT_LOG_DEFINE_GLOBAL_FORMAT BT_HIDDEN bt_log_format _bt_log_global_format -#define BT_LOG_DEFINE_GLOBAL_OUTPUT BT_HIDDEN bt_log_output _bt_log_global_output -#define BT_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL BT_HIDDEN int _bt_log_global_output_lvl +#define BT_LOG_DEFINE_TAG_PREFIX const char *_bt_log_tag_prefix +#define BT_LOG_DEFINE_GLOBAL_FORMAT bt_log_format _bt_log_global_format +#define BT_LOG_DEFINE_GLOBAL_OUTPUT bt_log_output _bt_log_global_output +#define BT_LOG_DEFINE_GLOBAL_OUTPUT_LEVEL int _bt_log_global_output_lvl /* Pointer to global format options. Direct modification is not allowed. Use * bt_log_set_mem_width() instead. Could be used to initialize bt_log_spec @@ -664,49 +664,41 @@ extern bt_log_output _bt_log_global_output; extern int _bt_log_global_output_lvl; extern const bt_log_spec _bt_log_stderr_spec; -BT_HIDDEN void _bt_log_write_d( const char *const func, const char *const file, const unsigned line, const int lvl, const char *const tag, const char *const fmt, ...) _BT_LOG_PRINTFLIKE(6, 7); -BT_HIDDEN void _bt_log_write_aux_d( const char *const func, const char *const file, const unsigned line, const bt_log_spec *const log, const int lvl, const char *const tag, const char *const fmt, ...) _BT_LOG_PRINTFLIKE(7, 8); -BT_HIDDEN void _bt_log_write( const int lvl, const char *const tag, const char *const fmt, ...) _BT_LOG_PRINTFLIKE(3, 4); -BT_HIDDEN void _bt_log_write_aux( const bt_log_spec *const log, const int lvl, const char *const tag, const char *const fmt, ...) _BT_LOG_PRINTFLIKE(4, 5); -BT_HIDDEN void _bt_log_write_mem_d( const char *const func, const char *const file, const unsigned line, const int lvl, const char *const tag, const void *const d, const unsigned d_sz, const char *const fmt, ...) _BT_LOG_PRINTFLIKE(8, 9); -BT_HIDDEN void _bt_log_write_mem_aux_d( const char *const func, const char *const file, const unsigned line, const bt_log_spec *const log, const int lvl, const char *const tag, const void *const d, const unsigned d_sz, const char *const fmt, ...) _BT_LOG_PRINTFLIKE(9, 10); -BT_HIDDEN void _bt_log_write_mem( const int lvl, const char *const tag, const void *const d, const unsigned d_sz, const char *const fmt, ...) _BT_LOG_PRINTFLIKE(5, 6); -BT_HIDDEN void _bt_log_write_mem_aux( const bt_log_spec *const log, const int lvl, const char *const tag, const void *const d, const unsigned d_sz, @@ -996,7 +988,6 @@ extern "C" { */ enum { BT_LOG_OUT_STDERR_MASK = BT_LOG_PUT_STD }; -BT_HIDDEN void bt_log_out_stderr_callback(const bt_log_message *const msg, void *arg); #define BT_LOG_OUT_STDERR BT_LOG_OUT_STDERR_MASK, 0, bt_log_out_stderr_callback @@ -1125,7 +1116,7 @@ end: extern int _level_sym #define BT_LOG_INIT_LOG_LEVEL(_level_sym, _env_var) \ - BT_HIDDEN int _level_sym = BT_LOG_NONE; \ + int _level_sym = BT_LOG_NONE; \ static \ void __attribute__((constructor)) _bt_log_level_ctor(void) \ { \ diff --git a/src/param-parse/param-parse.c b/src/param-parse/param-parse.c index 6edb97f9..1a44d698 100644 --- a/src/param-parse/param-parse.c +++ b/src/param-parse/param-parse.c @@ -553,7 +553,6 @@ end: * * Return value is owned by the caller. */ -BT_HIDDEN bt_value *bt_param_parse(const char *arg, GString *ini_error) { /* Lexical scanner configuration */ diff --git a/src/param-parse/param-parse.h b/src/param-parse/param-parse.h index 046262fb..8ca0e3eb 100644 --- a/src/param-parse/param-parse.h +++ b/src/param-parse/param-parse.h @@ -13,7 +13,6 @@ #include "common/macros.h" -BT_HIDDEN bt_value *bt_param_parse(const char *arg, GString *ini_error); #endif /* SRC_VALUE_PARSE_VALUE_PARSE_H */ diff --git a/src/plugins/common/muxing/muxing.c b/src/plugins/common/muxing/muxing.c index 4675e6e0..b3df38ca 100644 --- a/src/plugins/common/muxing/muxing.c +++ b/src/plugins/common/muxing/muxing.c @@ -824,7 +824,6 @@ end: return ret; } -BT_HIDDEN int common_muxing_compare_messages(const bt_message *left_msg, const bt_message *right_msg) { diff --git a/src/plugins/common/muxing/muxing.h b/src/plugins/common/muxing/muxing.h index 07232ee2..d724f8a4 100644 --- a/src/plugins/common/muxing/muxing.h +++ b/src/plugins/common/muxing/muxing.h @@ -10,7 +10,7 @@ #include #include "common/macros.h" -BT_EXTERN_C BT_HIDDEN +BT_EXTERN_C int common_muxing_compare_messages(const bt_message *left_msg, const bt_message *right_msg); diff --git a/src/plugins/common/param-validation/param-validation.h b/src/plugins/common/param-validation/param-validation.h index e1110faa..40d57609 100644 --- a/src/plugins/common/param-validation/param-validation.h +++ b/src/plugins/common/param-validation/param-validation.h @@ -145,13 +145,13 @@ struct bt_param_validation_map_value_entry_descr { const struct bt_param_validation_value_descr value_descr; }; -BT_EXTERN_C BT_HIDDEN +BT_EXTERN_C enum bt_param_validation_status bt_param_validation_validate( const bt_value *params, const struct bt_param_validation_map_value_entry_descr *entries, gchar **error); -BT_EXTERN_C BT_HIDDEN __BT_ATTR_FORMAT_PRINTF(2, 3) +BT_EXTERN_C __BT_ATTR_FORMAT_PRINTF(2, 3) enum bt_param_validation_status bt_param_validation_error( struct bt_param_validation_context *ctx, const char *format, ...); diff --git a/src/plugins/ctf/common/bfcr/bfcr.cpp b/src/plugins/ctf/common/bfcr/bfcr.cpp index d1495a61..3c204b6a 100644 --- a/src/plugins/ctf/common/bfcr/bfcr.cpp +++ b/src/plugins/ctf/common/bfcr/bfcr.cpp @@ -1103,7 +1103,6 @@ static inline enum bt_bfcr_status handle_state(struct bt_bfcr *bfcr) return status; } -BT_HIDDEN struct bt_bfcr *bt_bfcr_create(struct bt_bfcr_cbs cbs, void *data, bt_logging_level log_level, bt_self_component *self_comp) { @@ -1137,7 +1136,6 @@ end: return bfcr; } -BT_HIDDEN void bt_bfcr_destroy(struct bt_bfcr *bfcr) { if (bfcr->stack) { @@ -1165,7 +1163,6 @@ static void update_packet_offset(struct bt_bfcr *bfcr) bfcr->buf.packet_offset += bfcr->buf.at; } -BT_HIDDEN size_t bt_bfcr_start(struct bt_bfcr *bfcr, struct ctf_field_class *cls, const uint8_t *buf, size_t offset, size_t packet_offset, size_t sz, enum bt_bfcr_status *status) { @@ -1232,7 +1229,6 @@ end: return bfcr->buf.at; } -BT_HIDDEN size_t bt_bfcr_continue(struct bt_bfcr *bfcr, const uint8_t *buf, size_t sz, enum bt_bfcr_status *status) { @@ -1263,7 +1259,6 @@ size_t bt_bfcr_continue(struct bt_bfcr *bfcr, const uint8_t *buf, size_t sz, return bfcr->buf.at; } -BT_HIDDEN void bt_bfcr_set_unsigned_int_cb(struct bt_bfcr *bfcr, bt_bfcr_unsigned_int_cb_func cb) { BT_ASSERT_DBG(bfcr); diff --git a/src/plugins/ctf/common/bfcr/bfcr.hpp b/src/plugins/ctf/common/bfcr/bfcr.hpp index b67d6bd3..d7af2e7e 100644 --- a/src/plugins/ctf/common/bfcr/bfcr.hpp +++ b/src/plugins/ctf/common/bfcr/bfcr.hpp @@ -257,7 +257,6 @@ struct bt_bfcr_cbs * @param data User data (passed to user callback functions) * @returns New binary class reader on success, or \c NULL on error */ -BT_HIDDEN struct bt_bfcr *bt_bfcr_create(struct bt_bfcr_cbs cbs, void *data, bt_logging_level log_level, bt_self_component *self_comp); @@ -266,7 +265,6 @@ struct bt_bfcr *bt_bfcr_create(struct bt_bfcr_cbs cbs, void *data, bt_logging_le * * @param bfcr Binary class reader */ -BT_HIDDEN void bt_bfcr_destroy(struct bt_bfcr *bfcr); /** @@ -300,7 +298,6 @@ void bt_bfcr_destroy(struct bt_bfcr *bfcr); * @param status Returned status (see description above) * @returns Number of consumed bits */ -BT_HIDDEN size_t bt_bfcr_start(struct bt_bfcr *bfcr, struct ctf_field_class *cls, const uint8_t *buf, size_t offset, size_t packet_offset, size_t sz, enum bt_bfcr_status *status); @@ -327,11 +324,9 @@ size_t bt_bfcr_start(struct bt_bfcr *bfcr, struct ctf_field_class *cls, const ui * @param status Returned status (see description above) * @returns Number of consumed bits */ -BT_HIDDEN size_t bt_bfcr_continue(struct bt_bfcr *bfcr, const uint8_t *buf, size_t sz, enum bt_bfcr_status *status); -BT_HIDDEN void bt_bfcr_set_unsigned_int_cb(struct bt_bfcr *bfcr, bt_bfcr_unsigned_int_cb_func cb); static inline const char *bt_bfcr_status_string(enum bt_bfcr_status status) diff --git a/src/plugins/ctf/common/metadata/ast.hpp b/src/plugins/ctf/common/metadata/ast.hpp index 1a70b566..7ac2618d 100644 --- a/src/plugins/ctf/common/metadata/ast.hpp +++ b/src/plugins/ctf/common/metadata/ast.hpp @@ -353,27 +353,21 @@ const char *node_type(struct ctf_node *node); struct meta_log_config; -BT_HIDDEN struct ctf_visitor_generate_ir * ctf_visitor_generate_ir_create(const struct ctf_metadata_decoder_config *config); void ctf_visitor_generate_ir_destroy(struct ctf_visitor_generate_ir *visitor); -BT_HIDDEN bt_trace_class *ctf_visitor_generate_ir_get_ir_trace_class(struct ctf_visitor_generate_ir *visitor); -BT_HIDDEN struct ctf_trace_class * ctf_visitor_generate_ir_borrow_ctf_trace_class(struct ctf_visitor_generate_ir *visitor); -BT_HIDDEN int ctf_visitor_generate_ir_visit_node(struct ctf_visitor_generate_ir *visitor, struct ctf_node *node); -BT_HIDDEN int ctf_visitor_semantic_check(int depth, struct ctf_node *node, struct meta_log_config *log_cfg); -BT_HIDDEN int ctf_visitor_parent_links(int depth, struct ctf_node *node, struct meta_log_config *log_cfg); static inline char *ctf_ast_concatenate_unary_strings(struct bt_list_head *head) diff --git a/src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.cpp b/src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.cpp index fbda3d73..fc89c6ce 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.cpp @@ -8,7 +8,6 @@ #include "ctf-meta-configure-ir-trace.hpp" -BT_HIDDEN int ctf_trace_class_configure_ir_trace(struct ctf_trace_class *tc, bt_trace *ir_trace) { int ret = 0; diff --git a/src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.hpp b/src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.hpp index af84fc8a..23f8d260 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.hpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.hpp @@ -11,7 +11,6 @@ #include "ctf-meta.hpp" -BT_HIDDEN int ctf_trace_class_configure_ir_trace(struct ctf_trace_class *tc, bt_trace *ir_trace); #endif /* _CTF_META_CONFIGURE_IR_TRACE_H */ diff --git a/src/plugins/ctf/common/metadata/ctf-meta-resolve.cpp b/src/plugins/ctf/common/metadata/ctf-meta-resolve.cpp index fee1dda9..7042ec3a 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-resolve.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-resolve.cpp @@ -1207,7 +1207,6 @@ end: return ret; } -BT_HIDDEN int ctf_trace_class_resolve_field_classes(struct ctf_trace_class *tc, struct meta_log_config *log_cfg) { diff --git a/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp b/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp index c39948ee..6f066b77 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-translate.cpp @@ -618,7 +618,6 @@ end: return ret; } -BT_HIDDEN int ctf_trace_class_translate(bt_self_component *self_comp, bt_trace_class *ir_tc, struct ctf_trace_class *tc) { diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-alignments.cpp b/src/plugins/ctf/common/metadata/ctf-meta-update-alignments.cpp index b4c9a266..21360d9d 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-update-alignments.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-update-alignments.cpp @@ -110,7 +110,6 @@ end: return ret; } -BT_HIDDEN int ctf_trace_class_update_alignments(struct ctf_trace_class *ctf_tc) { int ret = 0; diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-default-clock-classes.cpp b/src/plugins/ctf/common/metadata/ctf-meta-update-default-clock-classes.cpp index a1e1ecfc..a59d854e 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-update-default-clock-classes.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-update-default-clock-classes.cpp @@ -151,7 +151,6 @@ end: return ret; } -BT_HIDDEN int ctf_trace_class_update_default_clock_classes(struct ctf_trace_class *ctf_tc, struct meta_log_config *log_cfg) { diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-in-ir.cpp b/src/plugins/ctf/common/metadata/ctf-meta-update-in-ir.cpp index 6967c441..4a4ea8fa 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-update-in-ir.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-update-in-ir.cpp @@ -223,7 +223,6 @@ end: * variant field classes) when we reach it. Dependents can only be located * after the length/tag field class in the metadata tree. */ -BT_HIDDEN int ctf_trace_class_update_in_ir(struct ctf_trace_class *ctf_tc) { int ret = 0; diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-meanings.cpp b/src/plugins/ctf/common/metadata/ctf-meta-update-meanings.cpp index 2a4c1fd5..c032f085 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-update-meanings.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-update-meanings.cpp @@ -162,7 +162,6 @@ end: return ret; } -BT_HIDDEN int ctf_trace_class_update_meanings(struct ctf_trace_class *ctf_tc) { int ret = 0; diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-stream-class-config.cpp b/src/plugins/ctf/common/metadata/ctf-meta-update-stream-class-config.cpp index f783a7e3..40cd1bbd 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-update-stream-class-config.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-update-stream-class-config.cpp @@ -14,7 +14,6 @@ #include "ctf-meta-visitors.hpp" -BT_HIDDEN int ctf_trace_class_update_stream_class_config(struct ctf_trace_class *ctf_tc) { struct ctf_field_class_int *int_fc; diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-text-array-sequence.cpp b/src/plugins/ctf/common/metadata/ctf-meta-update-text-array-sequence.cpp index 55dd27ad..8f6280e1 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-update-text-array-sequence.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-update-text-array-sequence.cpp @@ -95,7 +95,6 @@ end: return ret; } -BT_HIDDEN int ctf_trace_class_update_text_array_sequence(struct ctf_trace_class *ctf_tc) { int ret = 0; diff --git a/src/plugins/ctf/common/metadata/ctf-meta-update-value-storing-indexes.cpp b/src/plugins/ctf/common/metadata/ctf-meta-update-value-storing-indexes.cpp index 5962ae2e..274cdcc9 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-update-value-storing-indexes.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-update-value-storing-indexes.cpp @@ -120,7 +120,6 @@ end: return ret; } -BT_HIDDEN int ctf_trace_class_update_value_storing_indexes(struct ctf_trace_class *ctf_tc) { uint64_t i; diff --git a/src/plugins/ctf/common/metadata/ctf-meta-validate.cpp b/src/plugins/ctf/common/metadata/ctf-meta-validate.cpp index 4d531ebb..29f5471a 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-validate.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-validate.cpp @@ -179,7 +179,6 @@ end: return ret; } -BT_HIDDEN int ctf_trace_class_validate(struct ctf_trace_class *ctf_tc, struct meta_log_config *log_cfg) { int ret = 0; diff --git a/src/plugins/ctf/common/metadata/ctf-meta-visitors.hpp b/src/plugins/ctf/common/metadata/ctf-meta-visitors.hpp index a5d27dbd..91dd62fa 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-visitors.hpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-visitors.hpp @@ -14,40 +14,29 @@ struct meta_log_config; -BT_HIDDEN int ctf_trace_class_resolve_field_classes(struct ctf_trace_class *tc, struct meta_log_config *log_cfg); -BT_HIDDEN int ctf_trace_class_translate(bt_self_component *self_comp, bt_trace_class *ir_tc, struct ctf_trace_class *tc); -BT_HIDDEN int ctf_trace_class_update_default_clock_classes(struct ctf_trace_class *ctf_tc, struct meta_log_config *log_cfg); -BT_HIDDEN int ctf_trace_class_update_in_ir(struct ctf_trace_class *ctf_tc); -BT_HIDDEN int ctf_trace_class_update_meanings(struct ctf_trace_class *ctf_tc); -BT_HIDDEN int ctf_trace_class_update_text_array_sequence(struct ctf_trace_class *ctf_tc); -BT_HIDDEN int ctf_trace_class_update_alignments(struct ctf_trace_class *ctf_tc); -BT_HIDDEN int ctf_trace_class_update_value_storing_indexes(struct ctf_trace_class *ctf_tc); -BT_HIDDEN int ctf_trace_class_update_stream_class_config(struct ctf_trace_class *ctf_tc); -BT_HIDDEN int ctf_trace_class_validate(struct ctf_trace_class *ctf_tc, struct meta_log_config *log_cfg); -BT_HIDDEN void ctf_trace_class_warn_meaningless_header_fields(struct ctf_trace_class *ctf_tc, struct meta_log_config *log_cfg); diff --git a/src/plugins/ctf/common/metadata/ctf-meta-warn-meaningless-header-fields.cpp b/src/plugins/ctf/common/metadata/ctf-meta-warn-meaningless-header-fields.cpp index ccad81cf..0e6f776b 100644 --- a/src/plugins/ctf/common/metadata/ctf-meta-warn-meaningless-header-fields.cpp +++ b/src/plugins/ctf/common/metadata/ctf-meta-warn-meaningless-header-fields.cpp @@ -107,7 +107,6 @@ end: return; } -BT_HIDDEN void ctf_trace_class_warn_meaningless_header_fields(struct ctf_trace_class *ctf_tc, struct meta_log_config *log_cfg) { diff --git a/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.cpp b/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.cpp index 3b7224ab..4cc964ae 100644 --- a/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.cpp +++ b/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.cpp @@ -195,7 +195,6 @@ end: return ret; } -BT_HIDDEN int ctf_metadata_decoder_packetized_file_stream_to_buf(FILE *fp, char **buf, int byte_order, bool *is_uuid_set, uint8_t *uuid, bt_logging_level log_level, diff --git a/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.hpp b/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.hpp index 9d175967..a279e453 100644 --- a/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.hpp +++ b/src/plugins/ctf/common/metadata/decoder-packetized-file-stream-to-buf.hpp @@ -12,7 +12,6 @@ #include -BT_HIDDEN int ctf_metadata_decoder_packetized_file_stream_to_buf(FILE *fp, char **buf, int byte_order, bool *is_uuid_set, uint8_t *uuid, bt_logging_level log_level, diff --git a/src/plugins/ctf/common/metadata/decoder.cpp b/src/plugins/ctf/common/metadata/decoder.cpp index 740cbf05..d1f1c2de 100644 --- a/src/plugins/ctf/common/metadata/decoder.cpp +++ b/src/plugins/ctf/common/metadata/decoder.cpp @@ -58,7 +58,6 @@ struct packet_header uint8_t minor; } __attribute__((__packed__)); -BT_HIDDEN int ctf_metadata_decoder_is_packetized(FILE *fp, bool *is_packetized, int *byte_order, bt_logging_level log_level, bt_self_component *self_comp) { @@ -92,7 +91,6 @@ end: return ret; } -BT_HIDDEN struct ctf_metadata_decoder * ctf_metadata_decoder_create(const struct ctf_metadata_decoder_config *config) { @@ -154,7 +152,6 @@ end: return mdec; } -BT_HIDDEN void ctf_metadata_decoder_destroy(struct ctf_metadata_decoder *mdec) { if (!mdec) { @@ -174,7 +171,6 @@ void ctf_metadata_decoder_destroy(struct ctf_metadata_decoder *mdec) g_free(mdec); } -BT_HIDDEN enum ctf_metadata_decoder_status ctf_metadata_decoder_append_content(struct ctf_metadata_decoder *mdec, FILE *fp) { @@ -362,7 +358,6 @@ end: return status; } -BT_HIDDEN bt_trace_class *ctf_metadata_decoder_get_ir_trace_class(struct ctf_metadata_decoder *mdec) { BT_ASSERT_DBG(mdec); @@ -370,7 +365,6 @@ bt_trace_class *ctf_metadata_decoder_get_ir_trace_class(struct ctf_metadata_deco return ctf_visitor_generate_ir_get_ir_trace_class(mdec->visitor); } -BT_HIDDEN struct ctf_trace_class * ctf_metadata_decoder_borrow_ctf_trace_class(struct ctf_metadata_decoder *mdec) { @@ -379,7 +373,6 @@ ctf_metadata_decoder_borrow_ctf_trace_class(struct ctf_metadata_decoder *mdec) return ctf_visitor_generate_ir_borrow_ctf_trace_class(mdec->visitor); } -BT_HIDDEN const char *ctf_metadata_decoder_get_text(struct ctf_metadata_decoder *mdec) { BT_ASSERT_DBG(mdec); @@ -387,14 +380,12 @@ const char *ctf_metadata_decoder_get_text(struct ctf_metadata_decoder *mdec) return mdec->text->str; } -BT_HIDDEN int ctf_metadata_decoder_get_byte_order(struct ctf_metadata_decoder *mdec) { BT_ASSERT_DBG(mdec); return mdec->bo; } -BT_HIDDEN int ctf_metadata_decoder_get_uuid(struct ctf_metadata_decoder *mdec, bt_uuid_t uuid) { int ret = 0; @@ -456,7 +447,6 @@ end: return status; } -BT_HIDDEN enum ctf_metadata_decoder_status ctf_metadata_decoder_get_trace_class_uuid(struct ctf_metadata_decoder *mdec, bt_uuid_t uuid) { diff --git a/src/plugins/ctf/common/metadata/decoder.hpp b/src/plugins/ctf/common/metadata/decoder.hpp index f96fc9de..33caebef 100644 --- a/src/plugins/ctf/common/metadata/decoder.hpp +++ b/src/plugins/ctf/common/metadata/decoder.hpp @@ -65,7 +65,6 @@ struct ctf_metadata_decoder_config * * Returns `NULL` on error. */ -BT_HIDDEN struct ctf_metadata_decoder * ctf_metadata_decoder_create(const struct ctf_metadata_decoder_config *config); @@ -73,7 +72,6 @@ ctf_metadata_decoder_create(const struct ctf_metadata_decoder_config *config); * Destroys a CTF metadata decoder that you created with * ctf_metadata_decoder_create(). */ -BT_HIDDEN void ctf_metadata_decoder_destroy(struct ctf_metadata_decoder *metadata_decoder); /* @@ -97,7 +95,6 @@ void ctf_metadata_decoder_destroy(struct ctf_metadata_decoder *metadata_decoder) * If everything goes as expected, this function returns * `CTF_METADATA_DECODER_STATUS_OK`. */ -BT_HIDDEN enum ctf_metadata_decoder_status ctf_metadata_decoder_append_content(struct ctf_metadata_decoder *metadata_decoder, FILE *fp); @@ -108,7 +105,6 @@ ctf_metadata_decoder_append_content(struct ctf_metadata_decoder *metadata_decode * Returns `NULL` if there's none yet or if the metadata decoder is not * configured to create trace classes. */ -BT_HIDDEN bt_trace_class *ctf_metadata_decoder_get_ir_trace_class(struct ctf_metadata_decoder *mdec); /* @@ -117,7 +113,6 @@ bt_trace_class *ctf_metadata_decoder_get_ir_trace_class(struct ctf_metadata_deco * Returns `NULL` if there's none yet or if the metadata decoder is not * configured to create trace classes. */ -BT_HIDDEN struct ctf_trace_class * ctf_metadata_decoder_borrow_ctf_trace_class(struct ctf_metadata_decoder *mdec); @@ -130,7 +125,6 @@ ctf_metadata_decoder_borrow_ctf_trace_class(struct ctf_metadata_decoder *mdec); * This function uses `log_level` and `self_comp` for logging purposes. * `self_comp` can be `NULL` if not available. */ -BT_HIDDEN int ctf_metadata_decoder_is_packetized(FILE *fp, bool *is_packetized, int *byte_order, bt_logging_level log_level, bt_self_component *self_comp); @@ -140,14 +134,12 @@ int ctf_metadata_decoder_is_packetized(FILE *fp, bool *is_packetized, int *byte_ * * Returns -1 if unknown (plain text content). */ -BT_HIDDEN int ctf_metadata_decoder_get_byte_order(struct ctf_metadata_decoder *mdec); /* * Returns the UUID of the decoder's metadata stream as set by the last * call to ctf_metadata_decoder_append_content(). */ -BT_HIDDEN int ctf_metadata_decoder_get_uuid(struct ctf_metadata_decoder *mdec, bt_uuid_t uuid); /* @@ -159,14 +151,12 @@ int ctf_metadata_decoder_get_uuid(struct ctf_metadata_decoder *mdec, bt_uuid_t u * * `CTF_METADATA_DECODER_STATUS_NONE`: no UUID. * * `CTF_METADATA_DECODER_STATUS_INCOMPLETE`: missing metadata content. */ -BT_HIDDEN enum ctf_metadata_decoder_status ctf_metadata_decoder_get_trace_class_uuid(struct ctf_metadata_decoder *mdec, bt_uuid_t uuid); /* * Returns the metadata decoder's current metadata text. */ -BT_HIDDEN const char *ctf_metadata_decoder_get_text(struct ctf_metadata_decoder *mdec); static inline bool ctf_metadata_decoder_is_packet_version_valid(unsigned int major, diff --git a/src/plugins/ctf/common/metadata/objstack.cpp b/src/plugins/ctf/common/metadata/objstack.cpp index 4828de9a..1d808384 100644 --- a/src/plugins/ctf/common/metadata/objstack.cpp +++ b/src/plugins/ctf/common/metadata/objstack.cpp @@ -34,7 +34,6 @@ struct objstack_node char __attribute__((aligned(OBJSTACK_ALIGN))) data[]; }; -BT_HIDDEN struct objstack *objstack_create(void) { struct objstack *objstack; @@ -71,7 +70,6 @@ static void objstack_node_free(struct objstack_node *node) free(node); } -BT_HIDDEN void objstack_destroy(struct objstack *objstack) { struct objstack_node *node, *p; @@ -104,7 +102,6 @@ static struct objstack_node *objstack_append_node(struct objstack *objstack) return new_node; } -BT_HIDDEN void *objstack_alloc(struct objstack *objstack, size_t len) { struct objstack_node *last_node; diff --git a/src/plugins/ctf/common/metadata/objstack.hpp b/src/plugins/ctf/common/metadata/objstack.hpp index f6c655f8..52bcd796 100644 --- a/src/plugins/ctf/common/metadata/objstack.hpp +++ b/src/plugins/ctf/common/metadata/objstack.hpp @@ -13,16 +13,13 @@ struct objstack; -BT_HIDDEN struct objstack *objstack_create(void); -BT_HIDDEN void objstack_destroy(struct objstack *objstack); /* * Allocate len bytes of zeroed memory. * Return NULL on error. */ -BT_HIDDEN void *objstack_alloc(struct objstack *objstack, size_t len); #endif /* _OBJSTACK_H */ diff --git a/src/plugins/ctf/common/metadata/parser.ypp b/src/plugins/ctf/common/metadata/parser.ypp index e475436e..55a8c9ef 100644 --- a/src/plugins/ctf/common/metadata/parser.ypp +++ b/src/plugins/ctf/common/metadata/parser.ypp @@ -47,17 +47,11 @@ _bt_list_splice_tail (struct bt_list_head *add, struct bt_list_head *head) } } -BT_HIDDEN int yylex(union YYSTYPE *yyval, yyscan_t yyscanner); -BT_HIDDEN int yylex_init_extra(struct ctf_scanner *scanner, yyscan_t * ptr_yy_globals); -BT_HIDDEN int yylex_destroy(yyscan_t yyscanner); -BT_HIDDEN void yyrestart(FILE * in_str, yyscan_t yyscanner); -BT_HIDDEN int yyget_lineno(yyscan_t yyscanner); -BT_HIDDEN char *yyget_text(yyscan_t yyscanner); /* @@ -74,7 +68,6 @@ static struct ctf_node error_node = { .type = NODE_ERROR, }; -BT_HIDDEN const char *node_type(struct ctf_node *node) { switch (node->type) { @@ -327,7 +320,6 @@ static int lookup_type(struct ctf_scanner_scope *s, const char *id) return ret; } -BT_HIDDEN int is_type(struct ctf_scanner *scanner, const char *id) { struct ctf_scanner_scope *it; @@ -1059,10 +1051,8 @@ void ctf_scanner_free(struct ctf_scanner *scanner) } %code provides { - BT_HIDDEN void setstring(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src); - BT_HIDDEN int import_string(struct ctf_scanner *scanner, YYSTYPE *lvalp, const char *src, char delim); } diff --git a/src/plugins/ctf/common/metadata/scanner.hpp b/src/plugins/ctf/common/metadata/scanner.hpp index d924ec53..8869f21c 100644 --- a/src/plugins/ctf/common/metadata/scanner.hpp +++ b/src/plugins/ctf/common/metadata/scanner.hpp @@ -32,13 +32,10 @@ struct ctf_scanner struct objstack *objstack; }; -BT_HIDDEN struct ctf_scanner *ctf_scanner_alloc(void); -BT_HIDDEN void ctf_scanner_free(struct ctf_scanner *scanner); -BT_HIDDEN int ctf_scanner_append_ast(struct ctf_scanner *scanner, FILE *input); static inline struct ctf_ast *ctf_scanner_get_ast(struct ctf_scanner *scanner) @@ -46,7 +43,6 @@ static inline struct ctf_ast *ctf_scanner_get_ast(struct ctf_scanner *scanner) return scanner->ast; } -BT_HIDDEN int is_type(struct ctf_scanner *scanner, const char *id); #endif /* _CTF_SCANNER_H */ diff --git a/src/plugins/ctf/common/metadata/visitor-generate-ir.cpp b/src/plugins/ctf/common/metadata/visitor-generate-ir.cpp index df757406..3a26d229 100644 --- a/src/plugins/ctf/common/metadata/visitor-generate-ir.cpp +++ b/src/plugins/ctf/common/metadata/visitor-generate-ir.cpp @@ -4481,7 +4481,6 @@ end: return ret; } -BT_HIDDEN struct ctf_visitor_generate_ir * ctf_visitor_generate_ir_create(const struct ctf_metadata_decoder_config *decoder_config) { @@ -4505,13 +4504,11 @@ end: return ctx; } -BT_HIDDEN void ctf_visitor_generate_ir_destroy(struct ctf_visitor_generate_ir *visitor) { ctx_destroy(visitor); } -BT_HIDDEN bt_trace_class *ctf_visitor_generate_ir_get_ir_trace_class(struct ctf_visitor_generate_ir *ctx) { BT_ASSERT_DBG(ctx); @@ -4523,7 +4520,6 @@ bt_trace_class *ctf_visitor_generate_ir_get_ir_trace_class(struct ctf_visitor_ge return ctx->trace_class; } -BT_HIDDEN struct ctf_trace_class * ctf_visitor_generate_ir_borrow_ctf_trace_class(struct ctf_visitor_generate_ir *ctx) { @@ -4532,7 +4528,6 @@ ctf_visitor_generate_ir_borrow_ctf_trace_class(struct ctf_visitor_generate_ir *c return ctx->ctf_tc; } -BT_HIDDEN int ctf_visitor_generate_ir_visit_node(struct ctf_visitor_generate_ir *ctx, struct ctf_node *node) { int ret = 0; diff --git a/src/plugins/ctf/common/msg-iter/msg-iter.cpp b/src/plugins/ctf/common/msg-iter/msg-iter.cpp index 7b507ef3..eed75853 100644 --- a/src/plugins/ctf/common/msg-iter/msg-iter.cpp +++ b/src/plugins/ctf/common/msg-iter/msg-iter.cpp @@ -1672,7 +1672,6 @@ static inline enum ctf_msg_iter_status handle_state(struct ctf_msg_iter *msg_it) return status; } -BT_HIDDEN void ctf_msg_iter_reset_for_next_stream_file(struct ctf_msg_iter *msg_it) { BT_ASSERT(msg_it); @@ -1703,7 +1702,6 @@ void ctf_msg_iter_reset_for_next_stream_file(struct ctf_msg_iter *msg_it) /** * Resets the internal state of a CTF message iterator. */ -BT_HIDDEN void ctf_msg_iter_reset(struct ctf_msg_iter *msg_it) { ctf_msg_iter_reset_for_next_stream_file(msg_it); @@ -2579,7 +2577,6 @@ end: return msg; } -BT_HIDDEN struct ctf_msg_iter *ctf_msg_iter_create(struct ctf_trace_class *tc, size_t max_request_sz, struct ctf_msg_iter_medium_ops medops, void *data, bt_logging_level log_level, bt_self_component *self_comp, @@ -2905,7 +2902,6 @@ end: return status; } -BT_HIDDEN enum ctf_msg_iter_status ctf_msg_iter_seek(struct ctf_msg_iter *msg_it, off_t offset) { enum ctf_msg_iter_status status = CTF_MSG_ITER_STATUS_OK; @@ -2951,7 +2947,6 @@ end: return status; } -BT_HIDDEN enum ctf_msg_iter_status ctf_msg_iter_curr_packet_first_event_clock_snapshot(struct ctf_msg_iter *msg_it, uint64_t *first_clock_snapshot) @@ -2960,7 +2955,6 @@ ctf_msg_iter_curr_packet_first_event_clock_snapshot(struct ctf_msg_iter *msg_it, first_clock_snapshot); } -BT_HIDDEN enum ctf_msg_iter_status ctf_msg_iter_curr_packet_last_event_clock_snapshot(struct ctf_msg_iter *msg_it, uint64_t *last_clock_snapshot) @@ -2969,7 +2963,6 @@ ctf_msg_iter_curr_packet_last_event_clock_snapshot(struct ctf_msg_iter *msg_it, STATE_EMIT_MSG_PACKET_END_MULTI, last_clock_snapshot); } -BT_HIDDEN enum ctf_msg_iter_status ctf_msg_iter_get_packet_properties(struct ctf_msg_iter *msg_it, struct ctf_msg_iter_packet_properties *props) @@ -2996,7 +2989,6 @@ end: return status; } -BT_HIDDEN void ctf_msg_iter_set_dry_run(struct ctf_msg_iter *msg_it, bool val) { msg_it->dry_run = val; diff --git a/src/plugins/ctf/common/msg-iter/msg-iter.hpp b/src/plugins/ctf/common/msg-iter/msg-iter.hpp index 669cfe3d..15a952d2 100644 --- a/src/plugins/ctf/common/msg-iter/msg-iter.hpp +++ b/src/plugins/ctf/common/msg-iter/msg-iter.hpp @@ -226,7 +226,6 @@ struct ctf_msg_iter; * @returns New CTF message iterator on * success, or \c NULL on error */ -BT_HIDDEN struct ctf_msg_iter *ctf_msg_iter_create(struct ctf_trace_class *tc, size_t max_request_sz, struct ctf_msg_iter_medium_ops medops, void *medops_data, bt_logging_level log_level, bt_self_component *self_comp, @@ -239,7 +238,6 @@ struct ctf_msg_iter *ctf_msg_iter_create(struct ctf_trace_class *tc, size_t max_ * * @param msg_iter CTF message iterator */ -BT_HIDDEN void ctf_msg_iter_destroy(struct ctf_msg_iter *msg_iter); /** @@ -259,7 +257,6 @@ void ctf_msg_iter_destroy(struct ctf_msg_iter *msg_iter); * return value is #CTF_MSG_ITER_STATUS_OK * @returns One of #ctf_msg_iter_status values */ -BT_HIDDEN enum ctf_msg_iter_status ctf_msg_iter_get_next_message(struct ctf_msg_iter *msg_it, const bt_message **message); @@ -279,22 +276,18 @@ struct ctf_msg_iter_packet_properties } snapshots; }; -BT_HIDDEN enum ctf_msg_iter_status ctf_msg_iter_get_packet_properties(struct ctf_msg_iter *msg_it, struct ctf_msg_iter_packet_properties *props); -BT_HIDDEN enum ctf_msg_iter_status ctf_msg_iter_curr_packet_first_event_clock_snapshot(struct ctf_msg_iter *msg_it, uint64_t *first_event_cs); -BT_HIDDEN enum ctf_msg_iter_status ctf_msg_iter_curr_packet_last_event_clock_snapshot(struct ctf_msg_iter *msg_it, uint64_t *last_event_cs); -BT_HIDDEN enum ctf_msg_iter_status ctf_msg_iter_seek(struct ctf_msg_iter *msg_it, off_t offset); /* @@ -304,16 +297,13 @@ enum ctf_msg_iter_status ctf_msg_iter_seek(struct ctf_msg_iter *msg_it, off_t of * which this iterator emits after calling ctf_msg_iter_reset() is of * type `CTF_MESSAGE_TYPE_STREAM_BEGINNING`. */ -BT_HIDDEN void ctf_msg_iter_reset(struct ctf_msg_iter *msg_it); /* * Like ctf_msg_iter_reset(), but preserves stream-dependent state. */ -BT_HIDDEN void ctf_msg_iter_reset_for_next_stream_file(struct ctf_msg_iter *msg_it); -BT_HIDDEN void ctf_msg_iter_set_dry_run(struct ctf_msg_iter *msg_it, bool val); static inline const char *ctf_msg_iter_medium_status_string(enum ctf_msg_iter_medium_status status) diff --git a/src/plugins/ctf/fs-sink/fs-sink-stream.cpp b/src/plugins/ctf/fs-sink/fs-sink-stream.cpp index a90d587b..6e3bfb36 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-stream.cpp +++ b/src/plugins/ctf/fs-sink/fs-sink-stream.cpp @@ -22,7 +22,6 @@ #include "fs-sink-stream.hpp" #include "translate-trace-ir-to-ctf-ir.hpp" -BT_HIDDEN void fs_sink_stream_destroy(struct fs_sink_stream *stream) { if (!stream) { @@ -120,7 +119,6 @@ static void set_stream_file_name(struct fs_sink_stream *stream) stream->file_name = make_unique_stream_file_name(stream->trace, base_name); } -BT_HIDDEN struct fs_sink_stream *fs_sink_stream_create(struct fs_sink_trace *trace, const bt_stream *ir_stream) { @@ -430,7 +428,6 @@ end: return ret; } -BT_HIDDEN int fs_sink_stream_write_event(struct fs_sink_stream *stream, const bt_clock_snapshot *cs, const bt_event *event, struct fs_sink_ctf_event_class *ec) { @@ -552,7 +549,6 @@ end: return ret; } -BT_HIDDEN int fs_sink_stream_open_packet(struct fs_sink_stream *stream, const bt_clock_snapshot *cs, const bt_packet *packet) { @@ -630,7 +626,6 @@ end: return ret; } -BT_HIDDEN int fs_sink_stream_close_packet(struct fs_sink_stream *stream, const bt_clock_snapshot *cs) { int ret; diff --git a/src/plugins/ctf/fs-sink/fs-sink-stream.hpp b/src/plugins/ctf/fs-sink/fs-sink-stream.hpp index 54657fe7..cb95c08f 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-stream.hpp +++ b/src/plugins/ctf/fs-sink/fs-sink-stream.hpp @@ -161,22 +161,17 @@ struct fs_sink_stream } discarded_packets_state; }; -BT_HIDDEN struct fs_sink_stream *fs_sink_stream_create(struct fs_sink_trace *trace, const bt_stream *ir_stream); -BT_HIDDEN void fs_sink_stream_destroy(struct fs_sink_stream *stream); -BT_HIDDEN int fs_sink_stream_write_event(struct fs_sink_stream *stream, const bt_clock_snapshot *cs, const bt_event *event, struct fs_sink_ctf_event_class *ec); -BT_HIDDEN int fs_sink_stream_open_packet(struct fs_sink_stream *stream, const bt_clock_snapshot *cs, const bt_packet *packet); -BT_HIDDEN int fs_sink_stream_close_packet(struct fs_sink_stream *stream, const bt_clock_snapshot *cs); #endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_STREAM_H */ diff --git a/src/plugins/ctf/fs-sink/fs-sink-trace.cpp b/src/plugins/ctf/fs-sink/fs-sink-trace.cpp index e9dddc7b..1fad4a48 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-trace.cpp +++ b/src/plugins/ctf/fs-sink/fs-sink-trace.cpp @@ -454,7 +454,6 @@ end: return unique_full_path; } -BT_HIDDEN void fs_sink_trace_destroy(struct fs_sink_trace *trace) { GString *tsdl = NULL; @@ -547,7 +546,6 @@ static void ir_trace_destruction_listener(const bt_trace *ir_trace, void *data) g_hash_table_remove(trace->fs_sink->traces, ir_trace); } -BT_HIDDEN struct fs_sink_trace *fs_sink_trace_create(struct fs_sink_comp *fs_sink, const bt_trace *ir_trace) { int ret; diff --git a/src/plugins/ctf/fs-sink/fs-sink-trace.hpp b/src/plugins/ctf/fs-sink/fs-sink-trace.hpp index 9fe48d08..0f2bdb4c 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-trace.hpp +++ b/src/plugins/ctf/fs-sink/fs-sink-trace.hpp @@ -54,10 +54,8 @@ struct fs_sink_trace GHashTable *streams; }; -BT_HIDDEN struct fs_sink_trace *fs_sink_trace_create(struct fs_sink_comp *fs_sink, const bt_trace *ir_trace); -BT_HIDDEN void fs_sink_trace_destroy(struct fs_sink_trace *trace); #endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_TRACE_H */ diff --git a/src/plugins/ctf/fs-sink/fs-sink.cpp b/src/plugins/ctf/fs-sink/fs-sink.cpp index 13264660..cab1fbaa 100644 --- a/src/plugins/ctf/fs-sink/fs-sink.cpp +++ b/src/plugins/ctf/fs-sink/fs-sink.cpp @@ -131,7 +131,6 @@ end: return; } -BT_HIDDEN bt_component_class_initialize_method_status ctf_fs_sink_init(bt_self_component_sink *self_comp_sink, bt_self_component_sink_configuration *config, const bt_value *params, @@ -913,7 +912,6 @@ static inline void put_messages(bt_message_array_const msgs, uint64_t count) } } -BT_HIDDEN bt_component_class_sink_consume_method_status ctf_fs_sink_consume(bt_self_component_sink *self_comp) { bt_component_class_sink_consume_method_status status = @@ -1012,7 +1010,6 @@ end: return status; } -BT_HIDDEN bt_component_class_sink_graph_is_configured_method_status ctf_fs_sink_graph_is_configured(bt_self_component_sink *self_comp) { @@ -1035,7 +1032,6 @@ end: return status; } -BT_HIDDEN void ctf_fs_sink_finalize(bt_self_component_sink *self_comp) { fs_sink_comp *fs_sink = (fs_sink_comp *) bt_self_component_get_data( diff --git a/src/plugins/ctf/fs-sink/fs-sink.hpp b/src/plugins/ctf/fs-sink/fs-sink.hpp index d026cb29..d853ccb6 100644 --- a/src/plugins/ctf/fs-sink/fs-sink.hpp +++ b/src/plugins/ctf/fs-sink/fs-sink.hpp @@ -50,20 +50,16 @@ struct fs_sink_comp GHashTable *traces; }; -BT_HIDDEN bt_component_class_initialize_method_status ctf_fs_sink_init(bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); -BT_HIDDEN bt_component_class_sink_consume_method_status ctf_fs_sink_consume(bt_self_component_sink *component); -BT_HIDDEN bt_component_class_sink_graph_is_configured_method_status ctf_fs_sink_graph_is_configured(bt_self_component_sink *component); -BT_HIDDEN void ctf_fs_sink_finalize(bt_self_component_sink *component); #endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_FS_SINK_H */ diff --git a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp index 1d673820..aa85ec4e 100644 --- a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp +++ b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp @@ -776,7 +776,6 @@ static void append_stream_class(struct ctx *ctx, struct fs_sink_ctf_stream_class } } -BT_HIDDEN void translate_trace_ctf_ir_to_tsdl(struct fs_sink_ctf_trace *trace, GString *tsdl) { struct ctx ctx = { diff --git a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.hpp b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.hpp index c980e9f9..b9ddec72 100644 --- a/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.hpp +++ b/src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.hpp @@ -12,7 +12,6 @@ #include "common/macros.h" #include "fs-sink-ctf-meta.hpp" -BT_HIDDEN void translate_trace_ctf_ir_to_tsdl(struct fs_sink_ctf_trace *trace, GString *tsdl); #endif /* BABELTRACE_PLUGIN_CTF_FS_SINK_TRANSLATE_CTF_IR_TO_TSDL_H */ diff --git a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.cpp b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.cpp index ec7e566d..4030d7d2 100644 --- a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.cpp +++ b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.cpp @@ -1513,7 +1513,6 @@ end: return ret; } -BT_HIDDEN int try_translate_event_class_trace_ir_to_ctf_ir(struct fs_sink_comp *fs_sink, struct fs_sink_ctf_stream_class *sc, const bt_event_class *ir_ec, @@ -1646,7 +1645,6 @@ end: return ret; } -BT_HIDDEN int try_translate_stream_class_trace_ir_to_ctf_ir(struct fs_sink_comp *fs_sink, struct fs_sink_ctf_trace *trace, const bt_stream_class *ir_sc, @@ -1672,7 +1670,6 @@ end: return ret; } -BT_HIDDEN struct fs_sink_ctf_trace *translate_trace_trace_ir_to_ctf_ir(struct fs_sink_comp *fs_sink, const bt_trace *ir_trace) { diff --git a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.hpp b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.hpp index a1c7312a..c56d3abe 100644 --- a/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.hpp +++ b/src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.hpp @@ -13,19 +13,16 @@ #include "fs-sink.hpp" #include "fs-sink-ctf-meta.hpp" -BT_HIDDEN int try_translate_event_class_trace_ir_to_ctf_ir(struct fs_sink_comp *fs_sink, struct fs_sink_ctf_stream_class *sc, const bt_event_class *ir_ec, struct fs_sink_ctf_event_class **out_ec); -BT_HIDDEN int try_translate_stream_class_trace_ir_to_ctf_ir(struct fs_sink_comp *fs_sink, struct fs_sink_ctf_trace *trace, const bt_stream_class *ir_sc, struct fs_sink_ctf_stream_class **out_sc); -BT_HIDDEN struct fs_sink_ctf_trace *translate_trace_trace_ir_to_ctf_ir(struct fs_sink_comp *fs_sink, const bt_trace *ir_trace); diff --git a/src/plugins/ctf/fs-src/data-stream-file.cpp b/src/plugins/ctf/fs-src/data-stream-file.cpp index 9a49fd99..3c28721f 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.cpp +++ b/src/plugins/ctf/fs-src/data-stream-file.cpp @@ -261,7 +261,6 @@ static enum ctf_msg_iter_medium_status medop_seek(off_t offset, void *data) return ds_file_mmap(ds_file, offset); } -BT_HIDDEN struct ctf_msg_iter_medium_ops ctf_fs_ds_file_medops = { medop_request_bytes, medop_seek, @@ -390,7 +389,6 @@ end: return status; } -BT_HIDDEN void ctf_fs_ds_group_medops_data_destroy(struct ctf_fs_ds_group_medops_data *data) { if (!data) { @@ -849,7 +847,6 @@ error: goto end; } -BT_HIDDEN struct ctf_fs_ds_file *ctf_fs_ds_file_create(struct ctf_fs_trace *ctf_fs_trace, bt_stream *stream, const char *path, bt_logging_level log_level) { @@ -890,7 +887,6 @@ end: return ds_file; } -BT_HIDDEN struct ctf_fs_ds_index *ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_info *file_info, struct ctf_msg_iter *msg_iter) @@ -911,7 +907,6 @@ end: return index; } -BT_HIDDEN struct ctf_fs_ds_index *ctf_fs_ds_index_create(bt_logging_level log_level, bt_self_component *self_comp) { @@ -938,7 +933,6 @@ end: return index; } -BT_HIDDEN void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *ds_file) { if (!ds_file) { @@ -955,7 +949,6 @@ void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *ds_file) g_free(ds_file); } -BT_HIDDEN void ctf_fs_ds_index_destroy(struct ctf_fs_ds_index *index) { if (!index) { diff --git a/src/plugins/ctf/fs-src/data-stream-file.hpp b/src/plugins/ctf/fs-src/data-stream-file.hpp index 5723d760..a163f1dc 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.hpp +++ b/src/plugins/ctf/fs-src/data-stream-file.hpp @@ -71,23 +71,18 @@ struct ctf_fs_ds_file off_t request_offset_in_mapping; }; -BT_HIDDEN struct ctf_fs_ds_file *ctf_fs_ds_file_create(struct ctf_fs_trace *ctf_fs_trace, bt_stream *stream, const char *path, bt_logging_level log_level); -BT_HIDDEN void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *stream); -BT_HIDDEN struct ctf_fs_ds_index *ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_info *ds_file_info, struct ctf_msg_iter *msg_iter); -BT_HIDDEN struct ctf_fs_ds_index *ctf_fs_ds_index_create(bt_logging_level log_level, bt_self_component *self_comp); -BT_HIDDEN void ctf_fs_ds_index_destroy(struct ctf_fs_ds_index *index); /* @@ -105,18 +100,14 @@ extern struct ctf_msg_iter_medium_ops ctf_fs_ds_file_medops; * The data pointer when using these medops must be a pointer to a ctf_fs_ds * group_medops_data structure. */ -BT_HIDDEN extern struct ctf_msg_iter_medium_ops ctf_fs_ds_group_medops; -BT_HIDDEN enum ctf_msg_iter_medium_status ctf_fs_ds_group_medops_data_create( struct ctf_fs_ds_file_group *ds_file_group, bt_self_message_iterator *self_msg_iter, bt_logging_level log_level, struct ctf_fs_ds_group_medops_data **out); -BT_HIDDEN void ctf_fs_ds_group_medops_data_reset(struct ctf_fs_ds_group_medops_data *data); -BT_HIDDEN void ctf_fs_ds_group_medops_data_destroy(struct ctf_fs_ds_group_medops_data *data); #endif /* CTF_FS_DS_FILE_H */ diff --git a/src/plugins/ctf/fs-src/file.cpp b/src/plugins/ctf/fs-src/file.cpp index 6361123c..45bdd301 100644 --- a/src/plugins/ctf/fs-src/file.cpp +++ b/src/plugins/ctf/fs-src/file.cpp @@ -16,7 +16,6 @@ #include #include "file.hpp" -BT_HIDDEN void ctf_fs_file_destroy(struct ctf_fs_file *file) { if (!file) { @@ -39,7 +38,6 @@ void ctf_fs_file_destroy(struct ctf_fs_file *file) g_free(file); } -BT_HIDDEN struct ctf_fs_file *ctf_fs_file_create(bt_logging_level log_level, bt_self_component *self_comp) { struct ctf_fs_file *file = g_new0(struct ctf_fs_file, 1); @@ -65,7 +63,6 @@ end: return file; } -BT_HIDDEN int ctf_fs_file_open(struct ctf_fs_file *file, const char *mode) { int ret = 0; diff --git a/src/plugins/ctf/fs-src/file.hpp b/src/plugins/ctf/fs-src/file.hpp index 59fdd487..79242e75 100644 --- a/src/plugins/ctf/fs-src/file.hpp +++ b/src/plugins/ctf/fs-src/file.hpp @@ -12,13 +12,10 @@ #include "common/macros.h" #include "fs.hpp" -BT_HIDDEN void ctf_fs_file_destroy(struct ctf_fs_file *file); -BT_HIDDEN struct ctf_fs_file *ctf_fs_file_create(bt_logging_level log_level, bt_self_component *self_comp); -BT_HIDDEN int ctf_fs_file_open(struct ctf_fs_file *file, const char *mode); #endif /* CTF_FS_FILE_H */ diff --git a/src/plugins/ctf/fs-src/fs.cpp b/src/plugins/ctf/fs-src/fs.cpp index d26bbdfb..04ae6d2b 100644 --- a/src/plugins/ctf/fs-src/fs.cpp +++ b/src/plugins/ctf/fs-src/fs.cpp @@ -100,7 +100,6 @@ ctf_fs_iterator_next_one(struct ctf_fs_msg_iter_data *msg_iter_data, const bt_me return status; } -BT_HIDDEN bt_message_iterator_class_next_method_status ctf_fs_iterator_next(bt_self_message_iterator *iterator, bt_message_array_const msgs, uint64_t capacity, uint64_t *count) @@ -160,7 +159,6 @@ end: return status; } -BT_HIDDEN bt_message_iterator_class_seek_beginning_method_status ctf_fs_iterator_seek_beginning(bt_self_message_iterator *it) { @@ -175,7 +173,6 @@ ctf_fs_iterator_seek_beginning(bt_self_message_iterator *it) return BT_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHOD_STATUS_OK; } -BT_HIDDEN void ctf_fs_iterator_finalize(bt_self_message_iterator *it) { ctf_fs_msg_iter_data_destroy( @@ -199,7 +196,6 @@ ctf_msg_iter_medium_status_to_msg_iter_initialize_status(enum ctf_msg_iter_mediu bt_common_abort(); } -BT_HIDDEN bt_message_iterator_class_initialize_method_status ctf_fs_iterator_init(bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, @@ -295,7 +291,6 @@ static void ctf_fs_trace_destroy(struct ctf_fs_trace *ctf_fs_trace) g_free(ctf_fs_trace); } -BT_HIDDEN void ctf_fs_destroy(struct ctf_fs_component *ctf_fs) { if (!ctf_fs) { @@ -2299,7 +2294,6 @@ end: return ctf_fs; } -BT_HIDDEN bt_component_class_initialize_method_status ctf_fs_init(bt_self_component_source *self_comp_src, bt_self_component_source_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) @@ -2316,7 +2310,6 @@ ctf_fs_init(bt_self_component_source *self_comp_src, bt_self_component_source_co return ret; } -BT_HIDDEN bt_component_class_query_method_status ctf_fs_query(bt_self_component_class_source *comp_class, bt_private_query_executor *priv_query_exec, const char *object, const bt_value *params, diff --git a/src/plugins/ctf/fs-src/fs.hpp b/src/plugins/ctf/fs-src/fs.hpp index fe8f0507..83df0510 100644 --- a/src/plugins/ctf/fs-src/fs.hpp +++ b/src/plugins/ctf/fs-src/fs.hpp @@ -17,7 +17,6 @@ #include "metadata.hpp" #include "../common/metadata/decoder.hpp" -BT_HIDDEN extern bool ctf_fs_debug; struct ctf_fs_file @@ -196,41 +195,33 @@ struct ctf_fs_msg_iter_data struct ctf_fs_ds_group_medops_data *msg_iter_medops_data; }; -BT_HIDDEN bt_component_class_initialize_method_status ctf_fs_init(bt_self_component_source *source, bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data); -BT_HIDDEN void ctf_fs_finalize(bt_self_component_source *component); -BT_HIDDEN bt_component_class_query_method_status ctf_fs_query(bt_self_component_class_source *comp_class, bt_private_query_executor *priv_query_exec, const char *object, const bt_value *params, void *method_data, const bt_value **result); -BT_HIDDEN bt_message_iterator_class_initialize_method_status ctf_fs_iterator_init(bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_port_output *self_port); -BT_HIDDEN void ctf_fs_iterator_finalize(bt_self_message_iterator *it); -BT_HIDDEN bt_message_iterator_class_next_method_status ctf_fs_iterator_next(bt_self_message_iterator *iterator, bt_message_array_const msgs, uint64_t capacity, uint64_t *count); -BT_HIDDEN bt_message_iterator_class_seek_beginning_method_status ctf_fs_iterator_seek_beginning(bt_self_message_iterator *message_iterator); /* Create and initialize a new, empty ctf_fs_component. */ -BT_HIDDEN struct ctf_fs_component *ctf_fs_component_create(bt_logging_level log_level, bt_self_component *self_comp); @@ -246,7 +237,6 @@ struct ctf_fs_component *ctf_fs_component_create(bt_logging_level log_level, * should be set. */ -BT_HIDDEN int ctf_fs_component_create_ctf_fs_trace(struct ctf_fs_component *ctf_fs, const bt_value *paths_value, const bt_value *trace_name_value, @@ -255,7 +245,6 @@ int ctf_fs_component_create_ctf_fs_trace(struct ctf_fs_component *ctf_fs, /* Free `ctf_fs` and everything it owns. */ -BT_HIDDEN void ctf_fs_destroy(struct ctf_fs_component *ctf_fs); /* @@ -273,7 +262,6 @@ void ctf_fs_destroy(struct ctf_fs_component *ctf_fs); * Return true on success, false if any parameter didn't pass validation. */ -BT_HIDDEN bool read_src_fs_parameters(const bt_value *params, const bt_value **paths, const bt_value **trace_name, struct ctf_fs_component *ctf_fs, bt_self_component *self_comp, bt_self_component_class *self_comp_class); @@ -284,7 +272,6 @@ bool read_src_fs_parameters(const bt_value *params, const bt_value **paths, * The result must be freed using g_free by the caller. */ -BT_HIDDEN gchar *ctf_fs_make_port_name(struct ctf_fs_ds_file_group *ds_file_group); #endif /* BABELTRACE_PLUGIN_CTF_FS_H */ diff --git a/src/plugins/ctf/fs-src/metadata.cpp b/src/plugins/ctf/fs-src/metadata.cpp index d7c89e5e..f428c5e0 100644 --- a/src/plugins/ctf/fs-src/metadata.cpp +++ b/src/plugins/ctf/fs-src/metadata.cpp @@ -24,7 +24,6 @@ #include "metadata.hpp" #include "../common/metadata/decoder.hpp" -BT_HIDDEN FILE *ctf_fs_metadata_open_file(const char *trace_path) { GString *metadata_path; @@ -70,7 +69,6 @@ end: return file; } -BT_HIDDEN int ctf_fs_metadata_set_trace_class(bt_self_component *self_comp, struct ctf_fs_trace *ctf_fs_trace, struct ctf_fs_metadata_config *config) { @@ -118,14 +116,12 @@ end: return ret; } -BT_HIDDEN int ctf_fs_metadata_init(struct ctf_fs_metadata *metadata) { /* Nothing to initialize for the moment. */ return 0; } -BT_HIDDEN void ctf_fs_metadata_fini(struct ctf_fs_metadata *metadata) { free(metadata->text); diff --git a/src/plugins/ctf/fs-src/metadata.hpp b/src/plugins/ctf/fs-src/metadata.hpp index c04628f0..fd72e157 100644 --- a/src/plugins/ctf/fs-src/metadata.hpp +++ b/src/plugins/ctf/fs-src/metadata.hpp @@ -25,20 +25,15 @@ struct ctf_fs_metadata_config int64_t clock_class_offset_ns; }; -BT_HIDDEN int ctf_fs_metadata_init(struct ctf_fs_metadata *metadata); -BT_HIDDEN void ctf_fs_metadata_fini(struct ctf_fs_metadata *metadata); -BT_HIDDEN int ctf_fs_metadata_set_trace_class(bt_self_component *self_comp, struct ctf_fs_trace *ctf_fs_trace, struct ctf_fs_metadata_config *config); -BT_HIDDEN FILE *ctf_fs_metadata_open_file(const char *trace_path); -BT_HIDDEN bool ctf_metadata_is_packetized(FILE *fp, int *byte_order); #endif /* CTF_FS_METADATA_H */ diff --git a/src/plugins/ctf/fs-src/query.cpp b/src/plugins/ctf/fs-src/query.cpp index 846dde6b..5685ce79 100644 --- a/src/plugins/ctf/fs-src/query.cpp +++ b/src/plugins/ctf/fs-src/query.cpp @@ -35,7 +35,6 @@ struct range bool set = false; }; -BT_HIDDEN bt_component_class_query_method_status metadata_info_query(bt_self_component_class_source *self_comp_class_src, const bt_value *params, bt_logging_level log_level, const bt_value **user_result) @@ -296,7 +295,6 @@ end: return ret; } -BT_HIDDEN bt_component_class_query_method_status trace_infos_query(bt_self_component_class_source *self_comp_class_src, const bt_value *params, bt_logging_level log_level, const bt_value **user_result) @@ -373,7 +371,6 @@ end: return status; } -BT_HIDDEN bt_component_class_query_method_status support_info_query(bt_self_component_class_source *comp_class, const bt_value *params, bt_logging_level log_level, const bt_value **user_result) diff --git a/src/plugins/ctf/fs-src/query.hpp b/src/plugins/ctf/fs-src/query.hpp index 7bdca136..cadf83db 100644 --- a/src/plugins/ctf/fs-src/query.hpp +++ b/src/plugins/ctf/fs-src/query.hpp @@ -12,18 +12,15 @@ #include "common/macros.h" #include -BT_HIDDEN bt_component_class_query_method_status metadata_info_query(bt_self_component_class_source *comp_class, const bt_value *params, bt_logging_level log_level, const bt_value **result); -BT_HIDDEN bt_component_class_query_method_status trace_infos_query(bt_self_component_class_source *comp_class, const bt_value *params, bt_logging_level log_level, const bt_value **result); -BT_HIDDEN bt_component_class_query_method_status support_info_query(bt_self_component_class_source *comp_class, const bt_value *params, bt_logging_level log_level, const bt_value **result); diff --git a/src/plugins/ctf/lttng-live/data-stream.cpp b/src/plugins/ctf/lttng-live/data-stream.cpp index 7dd29dfc..a9502156 100644 --- a/src/plugins/ctf/lttng-live/data-stream.cpp +++ b/src/plugins/ctf/lttng-live/data-stream.cpp @@ -113,7 +113,6 @@ static struct ctf_msg_iter_medium_ops medops = { medop_borrow_stream, }; -BT_HIDDEN enum lttng_live_iterator_status lttng_live_lazy_msg_init(struct lttng_live_session *session, bt_self_message_iterator *self_msg_iter) { @@ -167,7 +166,6 @@ error: return LTTNG_LIVE_ITERATOR_STATUS_ERROR; } -BT_HIDDEN struct lttng_live_stream_iterator * lttng_live_stream_iterator_create(struct lttng_live_session *session, uint64_t ctf_trace_id, uint64_t stream_id, bt_self_message_iterator *self_msg_iter) @@ -251,7 +249,6 @@ end: return stream_iter; } -BT_HIDDEN void lttng_live_stream_iterator_destroy(struct lttng_live_stream_iterator *stream_iter) { if (!stream_iter) { diff --git a/src/plugins/ctf/lttng-live/lttng-live.cpp b/src/plugins/ctf/lttng-live/lttng-live.cpp index b3e19d9c..be6d7ba9 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.cpp +++ b/src/plugins/ctf/lttng-live/lttng-live.cpp @@ -108,7 +108,6 @@ void lttng_live_stream_iterator_set_state(struct lttng_live_stream_iterator *str live_stream_iter->current_inactivity_ts); \ } while (0); -BT_HIDDEN bool lttng_live_graph_is_canceled(struct lttng_live_msg_iter *msg_iter) { bool ret; @@ -195,7 +194,6 @@ end: return trace; } -BT_HIDDEN struct lttng_live_trace * lttng_live_session_borrow_or_create_trace_by_id(struct lttng_live_session *session, uint64_t trace_id) @@ -214,7 +212,6 @@ end: return trace; } -BT_HIDDEN int lttng_live_add_session(struct lttng_live_msg_iter *lttng_live_msg_iter, uint64_t session_id, const char *hostname, const char *session_name) { @@ -321,7 +318,6 @@ end: return; } -BT_HIDDEN void lttng_live_msg_iter_finalize(bt_self_message_iterator *self_msg_iter) { struct lttng_live_msg_iter *lttng_live_msg_iter; @@ -1507,7 +1503,6 @@ static inline void put_messages(bt_message_array_const msgs, uint64_t count) } } -BT_HIDDEN bt_message_iterator_class_next_method_status lttng_live_msg_iter_next(bt_self_message_iterator *self_msg_it, bt_message_array_const msgs, uint64_t capacity, uint64_t *count) @@ -1784,7 +1779,6 @@ end: return lttng_live_msg_iter; } -BT_HIDDEN bt_message_iterator_class_initialize_method_status lttng_live_msg_iter_init(bt_self_message_iterator *self_msg_it, bt_self_message_iterator_configuration *config, @@ -2028,7 +2022,6 @@ end: return status; } -BT_HIDDEN bt_component_class_query_method_status lttng_live_query(bt_self_component_class_source *comp_class, bt_private_query_executor *priv_query_exec, const char *object, const bt_value *params, @@ -2067,7 +2060,6 @@ static void lttng_live_component_destroy_data(struct lttng_live_component *lttng g_free(lttng_live); } -BT_HIDDEN void lttng_live_component_finalize(bt_self_component_source *component) { lttng_live_component *data = (lttng_live_component *) bt_self_component_get_data( @@ -2179,7 +2171,6 @@ end: return status; } -BT_HIDDEN bt_component_class_initialize_method_status lttng_live_component_init(bt_self_component_source *self_comp_src, bt_self_component_source_configuration *config, const bt_value *params, diff --git a/src/plugins/ctf/lttng-live/lttng-live.hpp b/src/plugins/ctf/lttng-live/lttng-live.hpp index 4a4faf41..5e2e3686 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.hpp +++ b/src/plugins/ctf/lttng-live/lttng-live.hpp @@ -341,7 +341,6 @@ lttng_live_get_stream_bytes(struct lttng_live_msg_iter *lttng_live_msg_iter, bool lttng_live_graph_is_canceled(struct lttng_live_msg_iter *msg_iter); -BT_HIDDEN void lttng_live_stream_iterator_set_state(struct lttng_live_stream_iterator *stream_iter, enum lttng_live_stream_state new_state); diff --git a/src/plugins/ctf/lttng-live/metadata.cpp b/src/plugins/ctf/lttng-live/metadata.cpp index 775396ee..5c66d10f 100644 --- a/src/plugins/ctf/lttng-live/metadata.cpp +++ b/src/plugins/ctf/lttng-live/metadata.cpp @@ -94,7 +94,6 @@ end: return cc; } -BT_HIDDEN enum lttng_live_iterator_status lttng_live_metadata_update(struct lttng_live_trace *trace) { struct lttng_live_session *session = trace->session; @@ -288,7 +287,6 @@ end: return status; } -BT_HIDDEN int lttng_live_metadata_create_stream(struct lttng_live_session *session, uint64_t ctf_trace_id, uint64_t stream_id, const char *trace_name) { @@ -331,7 +329,6 @@ error: return -1; } -BT_HIDDEN void lttng_live_metadata_fini(struct lttng_live_trace *trace) { struct lttng_live_metadata *metadata = trace->metadata; diff --git a/src/plugins/ctf/lttng-live/viewer-connection.cpp b/src/plugins/ctf/lttng-live/viewer-connection.cpp index 7960b50e..8706493b 100644 --- a/src/plugins/ctf/lttng-live/viewer-connection.cpp +++ b/src/plugins/ctf/lttng-live/viewer-connection.cpp @@ -793,7 +793,6 @@ end: * } */ -BT_HIDDEN bt_component_class_query_method_status live_viewer_connection_list_sessions(struct live_viewer_connection *viewer_connection, const bt_value **user_result) @@ -937,7 +936,6 @@ end: return status; } -BT_HIDDEN enum lttng_live_viewer_status lttng_live_create_viewer_session(struct lttng_live_msg_iter *lttng_live_msg_iter) { @@ -1040,7 +1038,6 @@ end: return status; } -BT_HIDDEN enum lttng_live_viewer_status lttng_live_session_attach(struct lttng_live_session *session, bt_self_message_iterator *self_msg_iter) { @@ -1136,7 +1133,6 @@ end: return status; } -BT_HIDDEN enum lttng_live_viewer_status lttng_live_session_detach(struct lttng_live_session *session) { struct lttng_viewer_cmd cmd; @@ -1213,7 +1209,6 @@ end: return status; } -BT_HIDDEN enum lttng_live_get_one_metadata_status lttng_live_get_one_metadata_packet(struct lttng_live_trace *trace, FILE *fp, size_t *reply_len) { @@ -1371,7 +1366,6 @@ static void lttng_live_need_new_streams(struct lttng_live_msg_iter *lttng_live_m } } -BT_HIDDEN enum lttng_live_iterator_status lttng_live_get_next_index(struct lttng_live_msg_iter *lttng_live_msg_iter, struct lttng_live_stream_iterator *stream, struct packet_index *index) @@ -1506,7 +1500,6 @@ end: return status; } -BT_HIDDEN enum ctf_msg_iter_medium_status lttng_live_get_stream_bytes(struct lttng_live_msg_iter *lttng_live_msg_iter, struct lttng_live_stream_iterator *stream, uint8_t *buf, @@ -1629,7 +1622,6 @@ end: /* * Request new streams for a session. */ -BT_HIDDEN enum lttng_live_iterator_status lttng_live_session_get_new_streams(struct lttng_live_session *session, bt_self_message_iterator *self_msg_iter) @@ -1723,7 +1715,6 @@ end: return status; } -BT_HIDDEN enum lttng_live_viewer_status live_viewer_connection_create( bt_self_component *self_comp, bt_self_component_class *self_comp_class, bt_logging_level log_level, const char *url, bool in_query, @@ -1789,7 +1780,6 @@ end: return status; } -BT_HIDDEN void live_viewer_connection_destroy(struct live_viewer_connection *viewer_connection) { bt_self_component *self_comp = viewer_connection->self_comp; diff --git a/src/plugins/lttng-utils/debug-info/bin-info.c b/src/plugins/lttng-utils/debug-info/bin-info.c index b5afb0ff..5b579bc9 100644 --- a/src/plugins/lttng-utils/debug-info/bin-info.c +++ b/src/plugins/lttng-utils/debug-info/bin-info.c @@ -41,7 +41,6 @@ #define ADDR_STR_LEN 20 #define BUILD_ID_NOTE_NAME "GNU" -BT_HIDDEN int bin_info_init(bt_logging_level log_level, bt_self_component *self_comp) { int ret = 0; @@ -56,7 +55,6 @@ int bin_info_init(bt_logging_level log_level, bt_self_component *self_comp) return ret; } -BT_HIDDEN struct bin_info *bin_info_create(struct bt_fd_cache *fdc, const char *path, uint64_t low_addr, uint64_t memsz, bool is_pic, const char *debug_info_dir, const char *target_prefix, @@ -110,7 +108,6 @@ error: return NULL; } -BT_HIDDEN void bin_info_destroy(struct bin_info *bin) { if (!bin) { @@ -349,7 +346,6 @@ error: return is_matching; } -BT_HIDDEN int bin_info_set_build_id(struct bin_info *bin, uint8_t *build_id, size_t build_id_len) { @@ -393,7 +389,6 @@ error: return -1; } -BT_HIDDEN int bin_info_set_debug_link(struct bin_info *bin, const char *filename, uint32_t crc) { @@ -719,7 +714,6 @@ end: return ret; } -BT_HIDDEN void source_location_destroy(struct source_location *src_loc) { if (!src_loc) { @@ -1091,7 +1085,6 @@ error: return -1; } -BT_HIDDEN int bin_info_lookup_function_name(struct bin_info *bin, uint64_t addr, char **func_name) { @@ -1156,7 +1149,6 @@ error: return -1; } -BT_HIDDEN int bin_info_get_bin_loc(struct bin_info *bin, uint64_t addr, char **bin_loc) { gchar *_bin_loc = NULL; @@ -1506,7 +1498,6 @@ error: return -1; } -BT_HIDDEN int bin_info_lookup_source_location(struct bin_info *bin, uint64_t addr, struct source_location **src_loc) { diff --git a/src/plugins/lttng-utils/debug-info/bin-info.h b/src/plugins/lttng-utils/debug-info/bin-info.h index 37d44167..cd9b9d61 100644 --- a/src/plugins/lttng-utils/debug-info/bin-info.h +++ b/src/plugins/lttng-utils/debug-info/bin-info.h @@ -77,7 +77,6 @@ struct source_location { * * @returns 0 on success, -1 on failure */ -BT_HIDDEN int bin_info_init(bt_logging_level log_level, bt_self_component *self_comp); @@ -96,7 +95,6 @@ int bin_info_init(bt_logging_level log_level, * @returns Pointer to the new bin_info on success, * NULL on failure. */ -BT_HIDDEN struct bin_info *bin_info_create(struct bt_fd_cache *fdc, const char *path, uint64_t low_addr, uint64_t memsz, bool is_pic, const char *debug_info_dir, const char *target_prefix, @@ -107,7 +105,6 @@ struct bin_info *bin_info_create(struct bt_fd_cache *fdc, const char *path, * * @param bin bin_info instance to destroy */ -BT_HIDDEN void bin_info_destroy(struct bin_info *bin); /** @@ -119,7 +116,6 @@ void bin_info_destroy(struct bin_info *bin); * @param build_id_len Length in bytes of the build_id * @returns 0 on success, -1 on failure */ -BT_HIDDEN int bin_info_set_build_id(struct bin_info *bin, uint8_t *build_id, size_t build_id_len); @@ -132,7 +128,6 @@ int bin_info_set_build_id(struct bin_info *bin, uint8_t *build_id, * @param crc Checksum for the debug info file * @returns 0 on success, -1 on failure */ -BT_HIDDEN int bin_info_set_debug_link(struct bin_info *bin, const char *filename, uint32_t crc); @@ -174,7 +169,6 @@ int bin_info_has_address(struct bin_info *bin, uint64_t addr) * @param func_name Out parameter, the function name. * @returns 0 on success, -1 on failure */ -BT_HIDDEN int bin_info_lookup_function_name(struct bin_info *bin, uint64_t addr, char **func_name); @@ -196,7 +190,6 @@ int bin_info_lookup_function_name(struct bin_info *bin, uint64_t addr, * @param src_loc Out parameter, the source location * @returns 0 on success, -1 on failure */ -BT_HIDDEN int bin_info_lookup_source_location(struct bin_info *bin, uint64_t addr, struct source_location **src_loc); /** @@ -216,7 +209,6 @@ int bin_info_lookup_source_location(struct bin_info *bin, uint64_t addr, * @param bin_loc Out parameter, the binary location * @returns 0 on success, -1 on failure */ -BT_HIDDEN int bin_info_get_bin_loc(struct bin_info *bin, uint64_t addr, char **bin_loc); /** @@ -224,7 +216,6 @@ int bin_info_get_bin_loc(struct bin_info *bin, uint64_t addr, char **bin_loc); * * @param src_loc source_location instance to destroy */ -BT_HIDDEN void source_location_destroy(struct source_location *src_loc); #endif /* _BABELTRACE_BIN_INFO_H */ diff --git a/src/plugins/lttng-utils/debug-info/crc32.h b/src/plugins/lttng-utils/debug-info/crc32.h index e193caeb..7e1e254c 100644 --- a/src/plugins/lttng-utils/debug-info/crc32.h +++ b/src/plugins/lttng-utils/debug-info/crc32.h @@ -22,7 +22,6 @@ * @param crc Out parameter, the computed checksum * @returns 0 on success, -1 on failure. */ -BT_HIDDEN int crc32(int fd, uint32_t *crc); #endif /* _BABELTRACE_CRC32_H */ diff --git a/src/plugins/lttng-utils/debug-info/debug-info.c b/src/plugins/lttng-utils/debug-info/debug-info.c index aa791ddd..c1b5ff22 100644 --- a/src/plugins/lttng-utils/debug-info/debug-info.c +++ b/src/plugins/lttng-utils/debug-info/debug-info.c @@ -1756,7 +1756,6 @@ end: return status; } -BT_HIDDEN bt_component_class_initialize_method_status debug_info_comp_init( bt_self_component_filter *self_comp_flt, bt_self_component_filter_configuration *config, @@ -1822,7 +1821,6 @@ end: return status; } -BT_HIDDEN void debug_info_comp_finalize(bt_self_component_filter *self_comp_flt) { struct debug_info_component *debug_info = @@ -1838,7 +1836,6 @@ void debug_info_comp_finalize(bt_self_component_filter *self_comp_flt) destroy_debug_info_comp(debug_info); } -BT_HIDDEN bt_message_iterator_class_next_method_status debug_info_msg_iter_next( bt_self_message_iterator *self_msg_iter, const bt_message_array_const msgs, uint64_t capacity, @@ -1955,7 +1952,6 @@ end: return; } -BT_HIDDEN bt_message_iterator_class_initialize_method_status debug_info_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, @@ -2048,7 +2044,6 @@ end: return status; } -BT_HIDDEN bt_message_iterator_class_can_seek_beginning_method_status debug_info_msg_iter_can_seek_beginning(bt_self_message_iterator *self_msg_iter, bt_bool *can_seek) @@ -2061,7 +2056,6 @@ debug_info_msg_iter_can_seek_beginning(bt_self_message_iterator *self_msg_iter, debug_info_msg_iter->msg_iter, can_seek); } -BT_HIDDEN bt_message_iterator_class_seek_beginning_method_status debug_info_msg_iter_seek_beginning(bt_self_message_iterator *self_msg_iter) { @@ -2089,7 +2083,6 @@ end: return status; } -BT_HIDDEN void debug_info_msg_iter_finalize(bt_self_message_iterator *it) { struct debug_info_msg_iter *debug_info_msg_iter; diff --git a/src/plugins/lttng-utils/debug-info/debug-info.h b/src/plugins/lttng-utils/debug-info/debug-info.h index 5d544ecf..8a7e8ea0 100644 --- a/src/plugins/lttng-utils/debug-info/debug-info.h +++ b/src/plugins/lttng-utils/debug-info/debug-info.h @@ -28,38 +28,31 @@ #define MEMSZ_FIELD_NAME "memsz" #define PATH_FIELD_NAME "path" -BT_HIDDEN bt_component_class_initialize_method_status debug_info_comp_init( bt_self_component_filter *self_comp, bt_self_component_filter_configuration *config, const bt_value *params, void *init_method_data); -BT_HIDDEN void debug_info_comp_finalize(bt_self_component_filter *self_comp); -BT_HIDDEN bt_message_iterator_class_initialize_method_status debug_info_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_port_output *self_port); -BT_HIDDEN bt_message_iterator_class_next_method_status debug_info_msg_iter_next( bt_self_message_iterator *self_msg_iter, const bt_message_array_const msgs, uint64_t capacity, uint64_t *count); -BT_HIDDEN bt_message_iterator_class_can_seek_beginning_method_status debug_info_msg_iter_can_seek_beginning( bt_self_message_iterator *message_iterator, bt_bool *can_seek); -BT_HIDDEN bt_message_iterator_class_seek_beginning_method_status debug_info_msg_iter_seek_beginning( bt_self_message_iterator *message_iterator); -BT_HIDDEN void debug_info_msg_iter_finalize(bt_self_message_iterator *it); #endif /* BABELTRACE_PLUGIN_DEBUG_INFO_H */ diff --git a/src/plugins/lttng-utils/debug-info/dwarf.c b/src/plugins/lttng-utils/debug-info/dwarf.c index d4777ab7..20c605c8 100644 --- a/src/plugins/lttng-utils/debug-info/dwarf.c +++ b/src/plugins/lttng-utils/debug-info/dwarf.c @@ -12,7 +12,6 @@ #include "dwarf.h" -BT_HIDDEN struct bt_dwarf_cu *bt_dwarf_cu_create(Dwarf *dwarf_info) { struct bt_dwarf_cu *cu; @@ -32,13 +31,11 @@ error: return NULL; } -BT_HIDDEN void bt_dwarf_cu_destroy(struct bt_dwarf_cu *cu) { g_free(cu); } -BT_HIDDEN int bt_dwarf_cu_next(struct bt_dwarf_cu *cu) { int ret; @@ -65,7 +62,6 @@ end: return ret; } -BT_HIDDEN struct bt_dwarf_die *bt_dwarf_die_create(struct bt_dwarf_cu *cu) { Dwarf_Die *dwarf_die = NULL; @@ -103,7 +99,6 @@ error: return NULL; } -BT_HIDDEN void bt_dwarf_die_destroy(struct bt_dwarf_die *die) { if (!die) { @@ -114,13 +109,11 @@ void bt_dwarf_die_destroy(struct bt_dwarf_die *die) g_free(die); } -BT_HIDDEN int bt_dwarf_die_has_children(struct bt_dwarf_die *die) { return dwarf_haschildren(die->dwarf_die); } -BT_HIDDEN int bt_dwarf_die_child(struct bt_dwarf_die *die) { int ret; @@ -153,7 +146,6 @@ error: return ret; } -BT_HIDDEN int bt_dwarf_die_next(struct bt_dwarf_die *die) { int ret; @@ -196,7 +188,6 @@ error: return ret; } -BT_HIDDEN int bt_dwarf_die_get_tag(struct bt_dwarf_die *die, int *tag) { int _tag; @@ -217,7 +208,6 @@ error: return -1; } -BT_HIDDEN int bt_dwarf_die_get_name(struct bt_dwarf_die *die, char **name) { const char *_name; @@ -242,7 +232,6 @@ error: return -1; } -BT_HIDDEN int bt_dwarf_die_get_call_file(struct bt_dwarf_die *die, char **filename) { int ret; @@ -300,7 +289,6 @@ error: return -1; } -BT_HIDDEN int bt_dwarf_die_get_call_line(struct bt_dwarf_die *die, uint64_t *line_no) { @@ -338,7 +326,6 @@ error: return -1; } -BT_HIDDEN int bt_dwarf_die_contains_addr(struct bt_dwarf_die *die, uint64_t addr, bool *contains) { diff --git a/src/plugins/lttng-utils/debug-info/dwarf.h b/src/plugins/lttng-utils/debug-info/dwarf.h index eb2adc1a..1482cdf2 100644 --- a/src/plugins/lttng-utils/debug-info/dwarf.h +++ b/src/plugins/lttng-utils/debug-info/dwarf.h @@ -58,7 +58,6 @@ struct bt_dwarf_die { * @returns Pointer to the new bt_dwarf_cu on success, * NULL on failure. */ -BT_HIDDEN struct bt_dwarf_cu *bt_dwarf_cu_create(Dwarf *dwarf_info); /** @@ -66,7 +65,6 @@ struct bt_dwarf_cu *bt_dwarf_cu_create(Dwarf *dwarf_info); * * @param cu bt_dwarf_cu instance */ -BT_HIDDEN void bt_dwarf_cu_destroy(struct bt_dwarf_cu *cu); /** @@ -79,7 +77,6 @@ void bt_dwarf_cu_destroy(struct bt_dwarf_cu *cu); * @returns 0 on success, 1 if no next CU is available, * -1 on failure */ -BT_HIDDEN int bt_dwarf_cu_next(struct bt_dwarf_cu *cu); /** @@ -90,7 +87,6 @@ int bt_dwarf_cu_next(struct bt_dwarf_cu *cu); * @returns Pointer to the new bt_dwarf_die on success, * NULL on failure. */ -BT_HIDDEN struct bt_dwarf_die *bt_dwarf_die_create(struct bt_dwarf_cu *cu); /** @@ -98,7 +94,6 @@ struct bt_dwarf_die *bt_dwarf_die_create(struct bt_dwarf_cu *cu); * * @param die bt_dwarf_die instance */ -BT_HIDDEN void bt_dwarf_die_destroy(struct bt_dwarf_die *die); /** @@ -107,7 +102,6 @@ void bt_dwarf_die_destroy(struct bt_dwarf_die *die); * @param die bt_dwarf_die instance * @returns 0 if the die no child, 1 otherwise */ -BT_HIDDEN int bt_dwarf_die_has_children(struct bt_dwarf_die *die); /** @@ -118,7 +112,6 @@ int bt_dwarf_die_has_children(struct bt_dwarf_die *die); * @returns 0 on success, 1 if no child DIE is available, * -1 on failure */ -BT_HIDDEN int bt_dwarf_die_child(struct bt_dwarf_die *die); /** @@ -138,7 +131,6 @@ int bt_dwarf_die_child(struct bt_dwarf_die *die); * @returns 0 on success, 1 if no other siblings are available, -1 on * failure */ -BT_HIDDEN int bt_dwarf_die_next(struct bt_dwarf_die *die); /** @@ -151,7 +143,6 @@ int bt_dwarf_die_next(struct bt_dwarf_die *die); * @param tag Out parameter, the DIE's tag value * @returns 0 on success, -1 on failure. */ -BT_HIDDEN int bt_dwarf_die_get_tag(struct bt_dwarf_die *die, int *tag); /** @@ -164,7 +155,6 @@ int bt_dwarf_die_get_tag(struct bt_dwarf_die *die, int *tag); * @param name Out parameter, the DIE's name * @returns 0 on success, -1 on failure */ -BT_HIDDEN int bt_dwarf_die_get_name(struct bt_dwarf_die *die, char **name); /** @@ -178,7 +168,6 @@ int bt_dwarf_die_get_name(struct bt_dwarf_die *die, char **name); * callsite * @returns 0 on success, -1 on failure */ -BT_HIDDEN int bt_dwarf_die_get_call_file(struct bt_dwarf_die *die, char **filename); /** @@ -192,7 +181,6 @@ int bt_dwarf_die_get_call_file(struct bt_dwarf_die *die, char **filename); * subroutine's callsite * @returns 0 on success, -1 on failure */ -BT_HIDDEN int bt_dwarf_die_get_call_line(struct bt_dwarf_die *die, uint64_t *line_no); @@ -210,7 +198,6 @@ int bt_dwarf_die_get_call_line(struct bt_dwarf_die *die, * false if not * @returns 0 on succes, -1 on failure */ -BT_HIDDEN int bt_dwarf_die_contains_addr(struct bt_dwarf_die *die, uint64_t addr, bool *contains); diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c b/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c index 6cac787f..ee210269 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c +++ b/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c @@ -20,7 +20,6 @@ #include "trace-ir-data-copy.h" -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_trace_content( const bt_trace *in_trace, bt_trace *out_trace, bt_logging_level log_level, bt_self_component *self_comp) @@ -108,7 +107,6 @@ end: return status; } -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_stream_content( const bt_stream *in_stream, bt_stream *out_stream, bt_logging_level log_level, bt_self_component *self_comp) @@ -147,7 +145,6 @@ end: return status; } -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_packet_content( const bt_packet *in_packet, bt_packet *out_packet, bt_logging_level log_level, bt_self_component *self_comp) @@ -181,7 +178,6 @@ end: return status; } -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_event_content( const bt_event *in_event, bt_event *out_event, bt_logging_level log_level, bt_self_component *self_comp) @@ -250,7 +246,6 @@ end: return status; } -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_field_content( const bt_field *in_field, bt_field *out_field, bt_logging_level log_level, bt_self_component *self_comp) diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.h b/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.h index 2628b77e..319d366b 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.h +++ b/src/plugins/lttng-utils/debug-info/trace-ir-data-copy.h @@ -15,23 +15,18 @@ #include "common/macros.h" #include "trace-ir-mapping.h" -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_trace_content( const bt_trace *in_trace, bt_trace *out_trace, bt_logging_level log_level, bt_self_component *self_comp); -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_stream_content( const bt_stream *in_stream, bt_stream *out_stream, bt_logging_level log_level, bt_self_component *self_comp); -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_packet_content( const bt_packet *in_packet, bt_packet *out_packet, bt_logging_level log_level, bt_self_component *self_comp); -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_event_content( const bt_event *in_event, bt_event *out_event, bt_logging_level log_level, bt_self_component *self_comp); -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_field_content( const bt_field *in_field, bt_field *out_field, bt_logging_level log_level, bt_self_component *self_comp); diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-mapping.c b/src/plugins/lttng-utils/debug-info/trace-ir-mapping.c index 1f891566..7ddf9f14 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-mapping.c +++ b/src/plugins/lttng-utils/debug-info/trace-ir-mapping.c @@ -133,7 +133,6 @@ end: return out_trace; } -BT_HIDDEN bt_stream_class *trace_ir_mapping_borrow_mapped_stream_class( struct trace_ir_maps *ir_maps, const bt_stream_class *in_stream_class) @@ -148,7 +147,6 @@ bt_stream_class *trace_ir_mapping_borrow_mapped_stream_class( (gpointer) in_stream_class); } -BT_HIDDEN bt_stream_class *trace_ir_mapping_create_new_mapped_stream_class( struct trace_ir_maps *ir_maps, const bt_stream_class *in_stream_class) @@ -217,7 +215,6 @@ bt_stream *borrow_mapped_stream(struct trace_ir_data_maps *d_maps, return g_hash_table_lookup(d_maps->stream_map, (gpointer) in_stream); } -BT_HIDDEN bt_stream *trace_ir_mapping_create_new_mapped_stream( struct trace_ir_maps *ir_maps, const bt_stream *in_stream) { @@ -298,7 +295,6 @@ end: return out_stream; } -BT_HIDDEN bt_stream *trace_ir_mapping_borrow_mapped_stream(struct trace_ir_maps *ir_maps, const bt_stream *in_stream) { @@ -320,7 +316,6 @@ bt_event_class *borrow_mapped_event_class(struct trace_ir_metadata_maps *md_maps (gpointer) in_event_class); } -BT_HIDDEN bt_event_class *trace_ir_mapping_create_new_mapped_event_class( struct trace_ir_maps *ir_maps, const bt_event_class *in_event_class) @@ -387,7 +382,6 @@ end: return out_event_class; } -BT_HIDDEN bt_event_class *trace_ir_mapping_borrow_mapped_event_class( struct trace_ir_maps *ir_maps, const bt_event_class *in_event_class) @@ -414,7 +408,6 @@ bt_packet *borrow_mapped_packet(struct trace_ir_data_maps *d_maps, return g_hash_table_lookup(d_maps->packet_map, (gpointer) in_packet); } -BT_HIDDEN bt_packet *trace_ir_mapping_create_new_mapped_packet( struct trace_ir_maps *ir_maps, const bt_packet *in_packet) @@ -473,7 +466,6 @@ end: return out_packet; } -BT_HIDDEN bt_packet *trace_ir_mapping_borrow_mapped_packet(struct trace_ir_maps *ir_maps, const bt_packet *in_packet) { @@ -486,7 +478,6 @@ bt_packet *trace_ir_mapping_borrow_mapped_packet(struct trace_ir_maps *ir_maps, return borrow_mapped_packet(d_maps, in_packet); } -BT_HIDDEN void trace_ir_mapping_remove_mapped_packet(struct trace_ir_maps *ir_maps, const bt_packet *in_packet) { @@ -503,7 +494,6 @@ void trace_ir_mapping_remove_mapped_packet(struct trace_ir_maps *ir_maps, BT_ASSERT(ret); } -BT_HIDDEN void trace_ir_mapping_remove_mapped_stream(struct trace_ir_maps *ir_maps, const bt_stream *in_stream) { @@ -626,7 +616,6 @@ error: return md_maps; } -BT_HIDDEN void trace_ir_data_maps_destroy(struct trace_ir_data_maps *maps) { bt_trace_remove_listener_status status; @@ -659,7 +648,6 @@ void trace_ir_data_maps_destroy(struct trace_ir_data_maps *maps) g_free(maps); } -BT_HIDDEN void trace_ir_metadata_maps_destroy(struct trace_ir_metadata_maps *maps) { bt_trace_class_remove_listener_status status; @@ -713,7 +701,6 @@ void trace_ir_maps_clear(struct trace_ir_maps *maps) } } -BT_HIDDEN void trace_ir_maps_destroy(struct trace_ir_maps *maps) { if (!maps) { @@ -735,7 +722,6 @@ void trace_ir_maps_destroy(struct trace_ir_maps *maps) g_free(maps); } -BT_HIDDEN struct trace_ir_maps *trace_ir_maps_create(bt_self_component *self_comp, const char *debug_info_field_name, bt_logging_level log_level) { diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-mapping.h b/src/plugins/lttng-utils/debug-info/trace-ir-mapping.h index 500201c1..37da3bcf 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-mapping.h +++ b/src/plugins/lttng-utils/debug-info/trace-ir-mapping.h @@ -121,78 +121,61 @@ struct trace_ir_maps { bt_self_component *self_comp; }; -BT_HIDDEN struct trace_ir_maps *trace_ir_maps_create(bt_self_component *self_comp, const char *debug_info_field_name, bt_logging_level log_level); -BT_HIDDEN void trace_ir_maps_clear(struct trace_ir_maps *maps); -BT_HIDDEN void trace_ir_maps_destroy(struct trace_ir_maps *maps); -BT_HIDDEN struct trace_ir_data_maps *trace_ir_data_maps_create( struct trace_ir_maps *ir_maps, const bt_trace *in_trace); -BT_HIDDEN void trace_ir_data_maps_destroy(struct trace_ir_data_maps *d_maps); -BT_HIDDEN struct trace_ir_metadata_maps *trace_ir_metadata_maps_create( struct trace_ir_maps *ir_maps, const bt_trace_class *in_trace_class); -BT_HIDDEN void trace_ir_metadata_maps_destroy(struct trace_ir_metadata_maps *md_maps); -BT_HIDDEN bt_stream_class *trace_ir_mapping_create_new_mapped_stream_class( struct trace_ir_maps *ir_maps, const bt_stream_class *in_stream_class); -BT_HIDDEN bt_stream_class *trace_ir_mapping_borrow_mapped_stream_class( struct trace_ir_maps *ir_maps, const bt_stream_class *in_stream_class); -BT_HIDDEN bt_stream *trace_ir_mapping_create_new_mapped_stream( struct trace_ir_maps *ir_maps, const bt_stream *in_stream); -BT_HIDDEN bt_stream *trace_ir_mapping_borrow_mapped_stream( struct trace_ir_maps *ir_maps, const bt_stream *in_stream); -BT_HIDDEN void trace_ir_mapping_remove_mapped_stream( struct trace_ir_maps *ir_maps, const bt_stream *in_stream); -BT_HIDDEN bt_event_class *trace_ir_mapping_create_new_mapped_event_class( struct trace_ir_maps *ir_maps, const bt_event_class *in_event_class); -BT_HIDDEN bt_event_class *trace_ir_mapping_borrow_mapped_event_class( struct trace_ir_maps *ir_maps, const bt_event_class *in_event_class); -BT_HIDDEN bt_packet *trace_ir_mapping_create_new_mapped_packet( struct trace_ir_maps *ir_maps, const bt_packet *in_packet); -BT_HIDDEN bt_packet *trace_ir_mapping_borrow_mapped_packet( struct trace_ir_maps *ir_maps, const bt_packet *in_packet); -BT_HIDDEN void trace_ir_mapping_remove_mapped_packet( struct trace_ir_maps *ir_maps, const bt_packet *in_packet); diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.c b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.c index d06e722a..67f52845 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.c +++ b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.c @@ -22,7 +22,6 @@ #include "trace-ir-metadata-field-class-copy.h" #include "utils.h" -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_trace_class_content( struct trace_ir_maps *ir_maps, const bt_trace_class *in_trace_class, @@ -202,7 +201,6 @@ end: return out_clock_class; } -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_stream_class_content( struct trace_ir_maps *ir_maps, const bt_stream_class *in_stream_class, @@ -400,7 +398,6 @@ end: return status; } -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_event_class_content( struct trace_ir_maps *ir_maps, const bt_event_class *in_event_class, @@ -549,7 +546,6 @@ end: return status; } -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_event_common_context_field_class_content( struct trace_ir_metadata_maps *md_maps, @@ -697,14 +693,12 @@ end: return status; } -BT_HIDDEN bt_field_class *create_field_class_copy(struct trace_ir_metadata_maps *md_maps, const bt_field_class *in_field_class) { return create_field_class_copy_internal(md_maps, in_field_class); } -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_field_class_content( struct trace_ir_metadata_maps *md_maps, const bt_field_class *in_field_class, diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.h b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.h index 8d4bd494..b853ada9 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.h +++ b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-copy.h @@ -15,7 +15,6 @@ #include "common/macros.h" #include "trace-ir-mapping.h" -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_trace_class_content( struct trace_ir_maps *trace_ir_maps, const bt_trace_class *in_trace_class, @@ -23,32 +22,27 @@ enum debug_info_trace_ir_mapping_status copy_trace_class_content( bt_logging_level log_level, bt_self_component *self_comp); -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_stream_class_content( struct trace_ir_maps *trace_ir_maps, const bt_stream_class *in_stream_class, bt_stream_class *out_stream_class); -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_event_class_content( struct trace_ir_maps *trace_ir_maps, const bt_event_class *in_event_class, bt_event_class *out_event_class); -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_field_class_content( struct trace_ir_metadata_maps *trace_ir_metadata_maps, const bt_field_class *in_field_class, bt_field_class *out_field_class); -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_event_common_context_field_class_content( struct trace_ir_metadata_maps *trace_ir_metadata_maps, const char *debug_info_field_class_name, const bt_field_class *in_field_class, bt_field_class *out_field_class); -BT_HIDDEN bt_field_class *create_field_class_copy( struct trace_ir_metadata_maps *trace_ir_metadata_maps, const bt_field_class *in_field_class); diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c index 0b75bb6f..68504d2b 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c +++ b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c @@ -652,7 +652,6 @@ end: return out_elem_fc; } -BT_HIDDEN bt_field_class *create_field_class_copy_internal( struct trace_ir_metadata_maps *md_maps, const bt_field_class *in_field_class) @@ -883,7 +882,6 @@ error: return out_field_class; } -BT_HIDDEN enum debug_info_trace_ir_mapping_status copy_field_class_content_internal( struct trace_ir_metadata_maps *md_maps, const bt_field_class *in_field_class, diff --git a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h index 85abef71..0cbcaa18 100644 --- a/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h +++ b/src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.h @@ -14,12 +14,10 @@ #include "common/macros.h" #include "trace-ir-mapping.h" -BT_HIDDEN int copy_field_class_content_internal(struct trace_ir_metadata_maps *trace_ir_metadata_maps, const bt_field_class *in_field_class, bt_field_class *out_field_class); -BT_HIDDEN bt_field_class *create_field_class_copy_internal( struct trace_ir_metadata_maps *trace_ir_metadata_maps, const bt_field_class *in_field_class); diff --git a/src/plugins/lttng-utils/debug-info/utils.c b/src/plugins/lttng-utils/debug-info/utils.c index 6b7b4c7a..3c160bc4 100644 --- a/src/plugins/lttng-utils/debug-info/utils.c +++ b/src/plugins/lttng-utils/debug-info/utils.c @@ -14,7 +14,6 @@ #include "debug-info.h" #include "utils.h" -BT_HIDDEN const char *get_filename_from_path(const char *path) { size_t i = strlen(path); @@ -41,7 +40,6 @@ end: return path; } -BT_HIDDEN bool is_event_common_ctx_dbg_info_compatible(const bt_field_class *in_field_class, const char *debug_info_field_class_name) { diff --git a/src/plugins/lttng-utils/debug-info/utils.h b/src/plugins/lttng-utils/debug-info/utils.h index c9000e9d..27cf93ec 100644 --- a/src/plugins/lttng-utils/debug-info/utils.h +++ b/src/plugins/lttng-utils/debug-info/utils.h @@ -19,10 +19,8 @@ * Return the location of a path's file (the last element of the path). * Returns the original path on error. */ -BT_HIDDEN const char *get_filename_from_path(const char *path); -BT_HIDDEN bool is_event_common_ctx_dbg_info_compatible( const bt_field_class *in_field_class, const char *debug_info_field_class_name); diff --git a/src/plugins/text/details/details.c b/src/plugins/text/details/details.c index f64a1e1e..32ddd824 100644 --- a/src/plugins/text/details/details.c +++ b/src/plugins/text/details/details.c @@ -30,7 +30,6 @@ #define WITH_UUID_PARAM_NAME "with-uuid" #define COMPACT_PARAM_NAME "compact" -BT_HIDDEN void details_destroy_details_trace_class_meta( struct details_trace_class_meta *details_tc_meta) { @@ -49,7 +48,6 @@ end: return; } -BT_HIDDEN struct details_trace_class_meta *details_create_details_trace_class_meta(void) { struct details_trace_class_meta *details_tc_meta = @@ -188,7 +186,6 @@ end: return details_comp; } -BT_HIDDEN void details_finalize(bt_self_component_sink *comp) { struct details_comp *details_comp; @@ -334,7 +331,6 @@ void log_configuration(bt_self_component_sink *comp, BT_COMP_LOGI(" With UUID: %d", details_comp->cfg.with_uuid); } -BT_HIDDEN bt_component_class_initialize_method_status details_init( bt_self_component_sink *comp, bt_self_component_sink_configuration *config, @@ -390,7 +386,6 @@ end: return status; } -BT_HIDDEN bt_component_class_sink_graph_is_configured_method_status details_graph_is_configured(bt_self_component_sink *comp) { @@ -433,7 +428,6 @@ end: return status; } -BT_HIDDEN bt_component_class_sink_consume_method_status details_consume(bt_self_component_sink *comp) { diff --git a/src/plugins/text/details/details.h b/src/plugins/text/details/details.h index d9290c1f..05f470cd 100644 --- a/src/plugins/text/details/details.h +++ b/src/plugins/text/details/details.h @@ -144,27 +144,21 @@ struct details_comp { GString *str; }; -BT_HIDDEN bt_component_class_initialize_method_status details_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); -BT_HIDDEN void details_finalize(bt_self_component_sink *component); -BT_HIDDEN bt_component_class_sink_graph_is_configured_method_status details_graph_is_configured( bt_self_component_sink *comp); -BT_HIDDEN bt_component_class_sink_consume_method_status details_consume(bt_self_component_sink *component); -BT_HIDDEN void details_destroy_details_trace_class_meta( struct details_trace_class_meta *details_trace_class_meta); -BT_HIDDEN struct details_trace_class_meta *details_create_details_trace_class_meta(void); #endif /* BABELTRACE_PLUGINS_TEXT_DETAILS_DETAILS_H */ diff --git a/src/plugins/text/details/obj-lifetime-mgmt.c b/src/plugins/text/details/obj-lifetime-mgmt.c index 97849a97..7d670361 100644 --- a/src/plugins/text/details/obj-lifetime-mgmt.c +++ b/src/plugins/text/details/obj-lifetime-mgmt.c @@ -67,7 +67,6 @@ end: return details_tc_meta; } -BT_HIDDEN bool details_need_to_write_meta_object(struct details_write_ctx *ctx, const bt_trace_class *tc, const void *obj) { @@ -89,7 +88,6 @@ end: return need_to_write; } -BT_HIDDEN void details_did_write_meta_object(struct details_write_ctx *ctx, const bt_trace_class *tc, const void *obj) { @@ -102,7 +100,6 @@ void details_did_write_meta_object(struct details_write_ctx *ctx, GUINT_TO_POINTER(1)); } -BT_HIDDEN bool details_need_to_write_trace_class(struct details_write_ctx *ctx, const bt_trace_class *tc) { @@ -122,7 +119,6 @@ end: return need_to_write; } -BT_HIDDEN int details_did_write_trace_class(struct details_write_ctx *ctx, const bt_trace_class *tc) { @@ -169,7 +165,6 @@ end: } -BT_HIDDEN int details_trace_unique_id(struct details_write_ctx *ctx, const bt_trace *trace, uint64_t *unique_id) { diff --git a/src/plugins/text/details/obj-lifetime-mgmt.h b/src/plugins/text/details/obj-lifetime-mgmt.h index 18d83cf0..eaf95c10 100644 --- a/src/plugins/text/details/obj-lifetime-mgmt.h +++ b/src/plugins/text/details/obj-lifetime-mgmt.h @@ -18,7 +18,6 @@ * Returns whether or not stream class or event class `obj`, which * belongs to `tc`, needs to be written. */ -BT_HIDDEN bool details_need_to_write_meta_object(struct details_write_ctx *ctx, const bt_trace_class *tc, const void *obj); @@ -26,21 +25,18 @@ bool details_need_to_write_meta_object(struct details_write_ctx *ctx, * Marks stream class or event class `obj`, which belongs to `tc`, as * written. */ -BT_HIDDEN void details_did_write_meta_object(struct details_write_ctx *ctx, const bt_trace_class *tc, const void *obj); /* * Returns whether or not trace class `tc` needs to be written. */ -BT_HIDDEN bool details_need_to_write_trace_class(struct details_write_ctx *ctx, const bt_trace_class *tc); /* * Marks trace class `tc` as written. */ -BT_HIDDEN int details_did_write_trace_class(struct details_write_ctx *ctx, const bt_trace_class *tc); @@ -48,7 +44,6 @@ int details_did_write_trace_class(struct details_write_ctx *ctx, * Writes the unique trace ID of `trace` to `*unique_id`, allocating a * new unique ID if none exists. */ -BT_HIDDEN int details_trace_unique_id(struct details_write_ctx *ctx, const bt_trace *trace, uint64_t *unique_id); diff --git a/src/plugins/text/details/write.c b/src/plugins/text/details/write.c index fbefd809..a98de988 100644 --- a/src/plugins/text/details/write.c +++ b/src/plugins/text/details/write.c @@ -2530,7 +2530,6 @@ end: return ret; } -BT_HIDDEN int details_write_message(struct details_comp *details_comp, const bt_message *msg) { diff --git a/src/plugins/text/details/write.h b/src/plugins/text/details/write.h index 45bc27b5..dbfeea5e 100644 --- a/src/plugins/text/details/write.h +++ b/src/plugins/text/details/write.h @@ -29,7 +29,6 @@ struct details_write_ctx { * Writes the message `msg` to the component's output buffer * (`details_comp->str`). */ -BT_HIDDEN int details_write_message(struct details_comp *details_comp, const bt_message *msg); diff --git a/src/plugins/text/dmesg/dmesg.c b/src/plugins/text/dmesg/dmesg.c index f2a575a1..d52ddb21 100644 --- a/src/plugins/text/dmesg/dmesg.c +++ b/src/plugins/text/dmesg/dmesg.c @@ -359,7 +359,6 @@ void destroy_dmesg_component(struct dmesg_component *dmesg_comp) g_free(dmesg_comp); } -BT_HIDDEN bt_component_class_initialize_method_status dmesg_init( bt_self_component_source *self_comp_src, bt_self_component_source_configuration *config, @@ -437,7 +436,6 @@ end: return status; } -BT_HIDDEN void dmesg_finalize(bt_self_component_source *self_comp) { destroy_dmesg_component(bt_self_component_get_data( @@ -650,7 +648,6 @@ void destroy_dmesg_msg_iter(struct dmesg_msg_iter *dmesg_msg_iter) -BT_HIDDEN bt_message_iterator_class_initialize_method_status dmesg_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, @@ -701,7 +698,6 @@ end: return status; } -BT_HIDDEN void dmesg_msg_iter_finalize( bt_self_message_iterator *priv_msg_iter) { @@ -823,7 +819,6 @@ end: return status; } -BT_HIDDEN bt_message_iterator_class_next_method_status dmesg_msg_iter_next( bt_self_message_iterator *self_msg_iter, bt_message_array_const msgs, uint64_t capacity, @@ -868,7 +863,6 @@ bt_message_iterator_class_next_method_status dmesg_msg_iter_next( return status; } -BT_HIDDEN bt_message_iterator_class_can_seek_beginning_method_status dmesg_msg_iter_can_seek_beginning( bt_self_message_iterator *self_msg_iter, bt_bool *can_seek) @@ -882,7 +876,6 @@ dmesg_msg_iter_can_seek_beginning( return BT_MESSAGE_ITERATOR_CLASS_CAN_SEEK_BEGINNING_METHOD_STATUS_OK; } -BT_HIDDEN bt_message_iterator_class_seek_beginning_method_status dmesg_msg_iter_seek_beginning( bt_self_message_iterator *self_msg_iter) diff --git a/src/plugins/text/dmesg/dmesg.h b/src/plugins/text/dmesg/dmesg.h index 5faae740..f4cb3dc1 100644 --- a/src/plugins/text/dmesg/dmesg.h +++ b/src/plugins/text/dmesg/dmesg.h @@ -11,37 +11,30 @@ #include "common/macros.h" #include -BT_HIDDEN bt_component_class_initialize_method_status dmesg_init( bt_self_component_source *self_comp, bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data); -BT_HIDDEN void dmesg_finalize(bt_self_component_source *self_comp); -BT_HIDDEN bt_message_iterator_class_initialize_method_status dmesg_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_port_output *self_port); -BT_HIDDEN void dmesg_msg_iter_finalize( bt_self_message_iterator *self_msg_iter); -BT_HIDDEN bt_message_iterator_class_next_method_status dmesg_msg_iter_next( bt_self_message_iterator *self_msg_iter, bt_message_array_const msgs, uint64_t capacity, uint64_t *count); -BT_HIDDEN bt_message_iterator_class_can_seek_beginning_method_status dmesg_msg_iter_can_seek_beginning( bt_self_message_iterator *message_iterator, bt_bool *can_seek); -BT_HIDDEN bt_message_iterator_class_seek_beginning_method_status dmesg_msg_iter_seek_beginning( bt_self_message_iterator *message_iterator); diff --git a/src/plugins/text/pretty/pretty.c b/src/plugins/text/pretty/pretty.c index cad27514..510ed24e 100644 --- a/src/plugins/text/pretty/pretty.c +++ b/src/plugins/text/pretty/pretty.c @@ -90,7 +90,6 @@ error: return NULL; } -BT_HIDDEN void pretty_finalize(bt_self_component_sink *comp) { destroy_pretty_data( @@ -131,7 +130,6 @@ bt_message_iterator_class_next_method_status handle_message( return ret; } -BT_HIDDEN bt_component_class_sink_graph_is_configured_method_status pretty_graph_is_configured(bt_self_component_sink *self_comp_sink) { @@ -170,7 +168,6 @@ end: return status; } -BT_HIDDEN bt_component_class_sink_consume_method_status pretty_consume( bt_self_component_sink *comp) { @@ -543,7 +540,6 @@ void set_use_colors(struct pretty_component *pretty) } } -BT_HIDDEN bt_component_class_initialize_method_status pretty_init( bt_self_component_sink *self_comp_sink, bt_self_component_sink_configuration *config, diff --git a/src/plugins/text/pretty/pretty.h b/src/plugins/text/pretty/pretty.h index abf19296..d9f383b1 100644 --- a/src/plugins/text/pretty/pretty.h +++ b/src/plugins/text/pretty/pretty.h @@ -95,33 +95,26 @@ struct pretty_component { bt_self_component *self_comp; }; -BT_HIDDEN bt_component_class_initialize_method_status pretty_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); -BT_HIDDEN bt_component_class_sink_consume_method_status pretty_consume( bt_self_component_sink *component); -BT_HIDDEN bt_component_class_sink_graph_is_configured_method_status pretty_graph_is_configured( bt_self_component_sink *component); -BT_HIDDEN void pretty_finalize(bt_self_component_sink *component); -BT_HIDDEN int pretty_print_event(struct pretty_component *pretty, const bt_message *event_msg); -BT_HIDDEN int pretty_print_discarded_items(struct pretty_component *pretty, const bt_message *msg); -BT_HIDDEN void pretty_print_init(void); #endif /* BABELTRACE_PLUGIN_TEXT_PRETTY_PRETTY_H */ diff --git a/src/plugins/text/pretty/print.c b/src/plugins/text/pretty/print.c index 61d79cdb..4a2fee57 100644 --- a/src/plugins/text/pretty/print.c +++ b/src/plugins/text/pretty/print.c @@ -1440,7 +1440,6 @@ end: return ret; } -BT_HIDDEN int pretty_print_event(struct pretty_component *pretty, const bt_message *event_msg) { @@ -1599,7 +1598,6 @@ int print_discarded_elements_msg(struct pretty_component *pretty, return ret; } -BT_HIDDEN int pretty_print_discarded_items(struct pretty_component *pretty, const bt_message *msg) { @@ -1668,7 +1666,6 @@ int pretty_print_discarded_items(struct pretty_component *pretty, return 0; } -BT_HIDDEN void pretty_print_init(void) { strcpy(color_name, bt_common_color_bold()); diff --git a/src/plugins/utils/counter/counter.c b/src/plugins/utils/counter/counter.c index be03014d..be20f895 100644 --- a/src/plugins/utils/counter/counter.c +++ b/src/plugins/utils/counter/counter.c @@ -108,7 +108,6 @@ void destroy_private_counter_data(struct counter *counter) } } -BT_HIDDEN void counter_finalize(bt_self_component_sink *comp) { struct counter *counter; @@ -129,7 +128,6 @@ struct bt_param_validation_map_value_entry_descr counter_params[] = { BT_PARAM_VALIDATION_MAP_VALUE_ENTRY_END }; -BT_HIDDEN bt_component_class_initialize_method_status counter_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, @@ -199,7 +197,6 @@ end: return status; } -BT_HIDDEN bt_component_class_sink_graph_is_configured_method_status counter_graph_is_configured( bt_self_component_sink *comp) @@ -230,7 +227,6 @@ end: return status; } -BT_HIDDEN bt_component_class_sink_consume_method_status counter_consume( bt_self_component_sink *comp) { diff --git a/src/plugins/utils/counter/counter.h b/src/plugins/utils/counter/counter.h index 28800909..39b9a29a 100644 --- a/src/plugins/utils/counter/counter.h +++ b/src/plugins/utils/counter/counter.h @@ -34,20 +34,16 @@ struct counter { bt_self_component *self_comp; }; -BT_HIDDEN bt_component_class_initialize_method_status counter_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); -BT_HIDDEN void counter_finalize(bt_self_component_sink *component); -BT_HIDDEN bt_component_class_sink_graph_is_configured_method_status counter_graph_is_configured( bt_self_component_sink *component); -BT_HIDDEN bt_component_class_sink_consume_method_status counter_consume(bt_self_component_sink *component); #endif /* BABELTRACE_PLUGINS_UTILS_COUNTER_H */ diff --git a/src/plugins/utils/dummy/dummy.c b/src/plugins/utils/dummy/dummy.c index 8138aa6e..93394029 100644 --- a/src/plugins/utils/dummy/dummy.c +++ b/src/plugins/utils/dummy/dummy.c @@ -26,7 +26,6 @@ void destroy_private_dummy_data(struct dummy *dummy) } -BT_HIDDEN void dummy_finalize(bt_self_component_sink *comp) { struct dummy *dummy; @@ -43,7 +42,6 @@ struct bt_param_validation_map_value_entry_descr dummy_params[] = { BT_PARAM_VALIDATION_MAP_VALUE_ENTRY_END }; -BT_HIDDEN bt_component_class_initialize_method_status dummy_init( bt_self_component_sink *self_comp_sink, bt_self_component_sink_configuration *config, @@ -97,7 +95,6 @@ end: return status; } -BT_HIDDEN bt_component_class_sink_graph_is_configured_method_status dummy_graph_is_configured( bt_self_component_sink *comp) { @@ -127,7 +124,6 @@ end: return status; } -BT_HIDDEN bt_component_class_sink_consume_method_status dummy_consume( bt_self_component_sink *component) { diff --git a/src/plugins/utils/dummy/dummy.h b/src/plugins/utils/dummy/dummy.h index d2ab18a7..a5e3eb9f 100644 --- a/src/plugins/utils/dummy/dummy.h +++ b/src/plugins/utils/dummy/dummy.h @@ -15,20 +15,16 @@ struct dummy { bt_message_iterator *msg_iter; }; -BT_HIDDEN bt_component_class_initialize_method_status dummy_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); -BT_HIDDEN void dummy_finalize(bt_self_component_sink *component); -BT_HIDDEN bt_component_class_sink_graph_is_configured_method_status dummy_graph_is_configured( bt_self_component_sink *comp); -BT_HIDDEN bt_component_class_sink_consume_method_status dummy_consume( bt_self_component_sink *component); diff --git a/src/plugins/utils/muxer/muxer.c b/src/plugins/utils/muxer/muxer.c index fa049cf0..49c6940f 100644 --- a/src/plugins/utils/muxer/muxer.c +++ b/src/plugins/utils/muxer/muxer.c @@ -248,7 +248,6 @@ struct bt_param_validation_map_value_entry_descr muxer_params[] = { BT_PARAM_VALIDATION_MAP_VALUE_ENTRY_END }; -BT_HIDDEN bt_component_class_initialize_method_status muxer_init( bt_self_component_filter *self_comp_flt, bt_self_component_filter_configuration *config, @@ -333,7 +332,6 @@ end: return status; } -BT_HIDDEN void muxer_finalize(bt_self_component_filter *self_comp) { struct muxer_comp *muxer_comp = bt_self_component_get_data( @@ -1290,7 +1288,6 @@ end: return status; } -BT_HIDDEN bt_message_iterator_class_initialize_method_status muxer_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, @@ -1380,7 +1377,6 @@ end: return status; } -BT_HIDDEN void muxer_msg_iter_finalize(bt_self_message_iterator *self_msg_iter) { struct muxer_msg_iter *muxer_msg_iter = @@ -1402,7 +1398,6 @@ void muxer_msg_iter_finalize(bt_self_message_iterator *self_msg_iter) } } -BT_HIDDEN bt_message_iterator_class_next_method_status muxer_msg_iter_next( bt_self_message_iterator *self_msg_iter, bt_message_array_const msgs, uint64_t capacity, @@ -1443,7 +1438,6 @@ bt_message_iterator_class_next_method_status muxer_msg_iter_next( return status; } -BT_HIDDEN bt_component_class_port_connected_method_status muxer_input_port_connected( bt_self_component_filter *self_comp, bt_self_component_port_input *self_port, @@ -1508,7 +1502,6 @@ end: return status; } -BT_HIDDEN bt_message_iterator_class_can_seek_beginning_method_status muxer_msg_iter_can_seek_beginning( bt_self_message_iterator *self_msg_iter, bt_bool *can_seek) @@ -1536,7 +1529,6 @@ end: return status; } -BT_HIDDEN bt_message_iterator_class_seek_beginning_method_status muxer_msg_iter_seek_beginning( bt_self_message_iterator *self_msg_iter) { diff --git a/src/plugins/utils/muxer/muxer.h b/src/plugins/utils/muxer/muxer.h index 23a4c8aa..9abb851d 100644 --- a/src/plugins/utils/muxer/muxer.h +++ b/src/plugins/utils/muxer/muxer.h @@ -12,43 +12,35 @@ #include #include "common/macros.h" -BT_HIDDEN bt_component_class_initialize_method_status muxer_init( bt_self_component_filter *self_comp, bt_self_component_filter_configuration *config, const bt_value *params, void *init_data); -BT_HIDDEN void muxer_finalize(bt_self_component_filter *self_comp); -BT_HIDDEN bt_message_iterator_class_initialize_method_status muxer_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_port_output *self_port); -BT_HIDDEN void muxer_msg_iter_finalize( bt_self_message_iterator *self_msg_iter); -BT_HIDDEN bt_message_iterator_class_next_method_status muxer_msg_iter_next( bt_self_message_iterator *self_msg_iter, bt_message_array_const msgs, uint64_t capacity, uint64_t *count); -BT_HIDDEN bt_component_class_port_connected_method_status muxer_input_port_connected( bt_self_component_filter *comp, bt_self_component_port_input *self_port, const bt_port_output *other_port); -BT_HIDDEN bt_message_iterator_class_can_seek_beginning_method_status muxer_msg_iter_can_seek_beginning( bt_self_message_iterator *message_iterator, bt_bool *can_seek); -BT_HIDDEN bt_message_iterator_class_seek_beginning_method_status muxer_msg_iter_seek_beginning( bt_self_message_iterator *message_iterator); diff --git a/src/plugins/utils/trimmer/trimmer.c b/src/plugins/utils/trimmer/trimmer.c index 68230d5e..31cad1c4 100644 --- a/src/plugins/utils/trimmer/trimmer.c +++ b/src/plugins/utils/trimmer/trimmer.c @@ -140,7 +140,6 @@ struct trimmer_comp *create_trimmer_comp(void) return g_new0(struct trimmer_comp, 1); } -BT_HIDDEN void trimmer_finalize(bt_self_component_filter *self_comp) { struct trimmer_comp *trimmer_comp = @@ -679,7 +678,6 @@ void destroy_trimmer_iterator_stream_state( g_free(sstate); } -BT_HIDDEN bt_message_iterator_class_initialize_method_status trimmer_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, @@ -1875,7 +1873,6 @@ end: return status; } -BT_HIDDEN bt_message_iterator_class_next_method_status trimmer_msg_iter_next( bt_self_message_iterator *self_msg_iter, bt_message_array_const msgs, uint64_t capacity, @@ -1944,7 +1941,6 @@ end: return status; } -BT_HIDDEN void trimmer_msg_iter_finalize(bt_self_message_iterator *self_msg_iter) { struct trimmer_iterator *trimmer_it = diff --git a/src/plugins/utils/trimmer/trimmer.h b/src/plugins/utils/trimmer/trimmer.h index 3ed0d3ff..b6146b3a 100644 --- a/src/plugins/utils/trimmer/trimmer.h +++ b/src/plugins/utils/trimmer/trimmer.h @@ -12,28 +12,23 @@ #include "common/macros.h" #include -BT_HIDDEN void trimmer_finalize(bt_self_component_filter *self_comp); -BT_HIDDEN bt_component_class_initialize_method_status trimmer_init( bt_self_component_filter *self_comp, bt_self_component_filter_configuration *config, const bt_value *params, void *init_data); -BT_HIDDEN bt_message_iterator_class_initialize_method_status trimmer_msg_iter_init( bt_self_message_iterator *self_msg_iter, bt_self_message_iterator_configuration *config, bt_self_component_port_output *port); -BT_HIDDEN bt_message_iterator_class_next_method_status trimmer_msg_iter_next( bt_self_message_iterator *self_msg_iter, bt_message_array_const msgs, uint64_t capacity, uint64_t *count); -BT_HIDDEN void trimmer_msg_iter_finalize(bt_self_message_iterator *self_msg_iter); #endif /* BABELTRACE_PLUGINS_UTILS_TRIMMER_H */ diff --git a/src/py-common/py-common.c b/src/py-common/py-common.c index feb4cffa..b2177f5c 100644 --- a/src/py-common/py-common.c +++ b/src/py-common/py-common.c @@ -73,7 +73,6 @@ end: return gstr; } -BT_HIDDEN GString *bt_py_common_format_tb(PyObject *py_exc_tb, int log_level) { PyObject *traceback_module = NULL; @@ -133,7 +132,6 @@ error: return msg_buf; } -BT_HIDDEN GString *bt_py_common_format_exception(PyObject *py_exc_type, PyObject *py_exc_value, PyObject *py_exc_tb, int log_level, bool chain) @@ -206,7 +204,6 @@ error: return msg_buf; } -BT_HIDDEN GString *bt_py_common_format_current_exception(int log_level) { GString *result; diff --git a/src/py-common/py-common.h b/src/py-common/py-common.h index ded340b1..7d4e3f14 100644 --- a/src/py-common/py-common.h +++ b/src/py-common/py-common.h @@ -19,7 +19,6 @@ * Formats the Python traceback `py_exc_tb` using traceback.format_tb, from the * Python standard library, and return it as a Gstring. */ -BT_HIDDEN GString *bt_py_common_format_tb(PyObject *py_exc_tb, int log_level); /* @@ -30,7 +29,6 @@ GString *bt_py_common_format_tb(PyObject *py_exc_tb, int log_level); * If `chain` is true, include all exceptions in the causality chain * (see parameter `chain` of Python's traceback.format_exception). */ -BT_HIDDEN GString *bt_py_common_format_exception(PyObject *py_exc_type, PyObject *py_exc_value, PyObject *py_exc_tb, int log_level, bool chain); @@ -46,7 +44,6 @@ GString *bt_py_common_format_exception(PyObject *py_exc_type, * This function does not modify the error indicator, that is, anything * that is fetched is always restored. */ -BT_HIDDEN GString *bt_py_common_format_current_exception(int log_level); #endif /* BABELTRACE_PY_COMMON_INTERNAL_H */ diff --git a/src/string-format/format-error.h b/src/string-format/format-error.h index 40b46657..25da4648 100644 --- a/src/string-format/format-error.h +++ b/src/string-format/format-error.h @@ -12,14 +12,12 @@ #include #include -BT_HIDDEN gchar *format_bt_error_cause( const bt_error_cause *error_cause, unsigned int columns, bt_logging_level log_level, enum bt_common_color_when use_colors); -BT_HIDDEN gchar *format_bt_error( const bt_error *error, unsigned int columns, diff --git a/src/string-format/format-plugin-comp-cls-name.h b/src/string-format/format-plugin-comp-cls-name.h index f3fc60d7..25050042 100644 --- a/src/string-format/format-plugin-comp-cls-name.h +++ b/src/string-format/format-plugin-comp-cls-name.h @@ -12,7 +12,6 @@ #include #include -BT_HIDDEN gchar *format_plugin_comp_cls_opt(const char *plugin_name, const char *comp_cls_name, bt_component_class_type type, enum bt_common_color_when use_colors); -- 2.34.1