-Wno-pointer-arith dnl
-Wno-format-nonliteral dnl
-Wno-undef dnl
- -Wno-missing-prototypes dnl
- -Wno-missing-declarations dnl
-Wno-double-promotion dnl
-Wno-cast-align dnl
])
extern struct bt_ctf_field_type *bt_ctf_event_class_get_payload_field_type(
struct bt_ctf_event_class *event_class);
+extern int64_t bt_ctf_event_class_get_payload_type_field_count(
+ struct bt_ctf_event_class *event_class);
+
+extern 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,
+ uint64_t index);
+
+extern 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);
+
extern int bt_ctf_event_class_set_payload_field_type(
struct bt_ctf_event_class *event_class,
struct bt_ctf_field_type *payload_type);
%include "native_bt_trace_class.i"
%include "native_bt_value.i"
%include "native_bt_version.i"
+
+%{
+
+/*
+ * This function is defined by SWIG. Declare here to avoid a
+ * -Wmissing-prototypes warning.
+ */
+PyObject *SWIG_init(void);
+
+%}
* This function can also return None, if it failed to allocate memory
* for the return value and status code.
*/
+static
bt_value *bt_bt2_auto_discover_source_components(const bt_value *inputs,
const bt_plugin_set *plugin_set)
{
* THE SOFTWARE.
*/
+static
bt_self_component_port_input_message_iterator_create_from_message_iterator_status
bt_bt2_self_component_port_input_message_iterator_create_from_message_iterator(
bt_self_message_iterator *self_msg_iter,
return status;
}
+static
bt_self_component_port_input_message_iterator_create_from_sink_component_status
bt_bt2_self_component_port_input_message_iterator_create_from_sink_component(
bt_self_component_sink *self_comp,
* `*OUT`; it could point to unreadable memory.
*/
+static
bt_property_availability bt_bt2_plugin_get_version(
const bt_plugin *plugin, unsigned int *major,
unsigned int *minor, unsigned int *patch, const char **extra)
return ret;
}
+static
bt_plugin_find_status bt_bt2_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,
return status;
}
+static
bt_plugin_find_all_status bt_bt2_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,
return status;
}
+static
bt_plugin_find_all_from_file_status bt_bt2_plugin_find_all_from_file(
const char *path, bt_bool fail_on_load_error,
const bt_plugin_set **plugin_set)
return status;
}
+static
bt_plugin_find_all_from_dir_status bt_bt2_plugin_find_all_from_dir(
const char *path, bt_bool recurse, bt_bool fail_on_load_error,
const bt_plugin_set **plugin_set)
typedef const bt_component_class *(* spec_comp_cls_borrow_comp_cls_func_t)(
void *);
+static
void cmd_list_plugins_print_component_classes(const bt_plugin *plugin,
const char *cc_type_name, uint64_t count,
plugin_borrow_comp_cls_by_index_func_t borrow_comp_cls_by_index_func,
#define BT_LOG_TAG "CTF-WRITER/ATTRS"
#include "logging.h"
+#include "attributes.h"
+
#include "common/assert.h"
#include "common/macros.h"
#include "compat/string.h"
return ret;
}
+static
int map_clock_classes_func(struct bt_ctf_stream_class_common *stream_class,
struct bt_ctf_field_type_common *packet_context_type,
struct bt_ctf_field_type_common *event_header_type)
return bt_ctf_object_get_ref(bt_ctf_event_common_borrow_class(BT_CTF_TO_COMMON(event)));
}
-BT_HIDDEN
+static
struct bt_ctf_stream *bt_ctf_event_borrow_stream(struct bt_ctf_event *event)
{
BT_ASSERT_DBG(event);
return ret;
}
-BT_HIDDEN
-void _bt_ctf_event_freeze(struct bt_ctf_event *event)
-{
- _bt_ctf_event_common_set_is_frozen(BT_CTF_TO_COMMON(event), true);
-}
-
int bt_ctf_event_set_header(struct bt_ctf_event *event,
struct bt_ctf_field *header)
{
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);
+
static inline
struct bt_ctf_field_common *bt_ctf_event_common_borrow_payload(
struct bt_ctf_event_common *event)
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,
*/
#include "object.h"
+#include <babeltrace2-ctf-writer/object.h>
void *bt_ctf_object_get_ref(void *obj)
{
return ret;
}
+static
int visit_event_update_clock_value(struct bt_ctf_event *event, uint64_t *val)
{
int ret = 0;
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);
+
#endif /* BABELTRACE_CTF_WRITER_TRACE_INTERNAL_H */
return cause;
}
+static
struct bt_error_cause_message_iterator_actor *
create_error_cause_message_iterator_actor(struct bt_message_iterator *iter,
const char *file_name, uint64_t line_no)
return iterator->upstream_component;
}
-const struct bt_component *
-bt_self_component_port_input_message_iterator_borrow_component_const(
- const struct bt_self_component_port_input_message_iterator *iterator)
-{
- BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
- return iterator->upstream_component;
-}
-
struct bt_self_component *bt_self_message_iterator_borrow_component(
struct bt_self_message_iterator *self_iterator)
{
return (void *) create_range_set();
}
+static
void add_range_to_range_set(struct bt_integer_range_set *range_set,
uint64_t u_lower, uint64_t u_upper)
{
#define APPEND_ALL_FROM_DIR_NFDOPEN_MAX 8
+/* Declare here to make sure definition in both ifdef branches are in sync. */
+static
+int init_python_plugin_provider(void);
+typedef int (*create_all_from_file_sym_type)(
+ const char *path,
+ bool fail_on_load_error,
+ struct bt_plugin_set **plugin_set_out);
+
#ifdef BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT
#include <plugin/python-plugin-provider.h>
static
-int (*bt_plugin_python_create_all_from_file_sym)(
- const char *path, bool fail_on_load_error,
- struct bt_plugin_set **plugin_set_out) =
- bt_plugin_python_create_all_from_file;
+create_all_from_file_sym_type
+ bt_plugin_python_create_all_from_file_sym =
+ bt_plugin_python_create_all_from_file;
static
-enum bt_plugin_status init_python_plugin_provider(void)
+int init_python_plugin_provider(void)
{
}
#else /* BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT */
static GModule *python_plugin_provider_module;
static
-int (*bt_plugin_python_create_all_from_file_sym)(
- const char *path, bool fail_on_load_error,
- struct bt_plugin_set **plugin_set_out);
+create_all_from_file_sym_type bt_plugin_python_create_all_from_file_sym;
static
int init_python_plugin_provider(void) {
* SOFTWARE.
*/
+#include "param-parse.h"
+
#include <errno.h>
#include <stdlib.h>
#include <string.h>
* Returns the index of the lowest common ancestor of two field path
* objects having the same root scope.
*/
+static
int64_t get_field_paths_lca_index(struct ctf_field_path *field_path1,
struct ctf_field_path *field_path2,
struct resolve_context *ctx)
#define BT_LOG_TAG "PLUGIN/CTF/META/DECODER-DECODE-PACKET"
#include "logging/comp-logging.h"
+#include "decoder-packetized-file-stream-to-buf.h"
+
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
return CTF_ERROR; \
} \
} while (0)
-
-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);
-
%}
%x comment_ml comment_sl string_lit char_const
#define BT_LOG_TAG "PLUGIN/CTF/META/OBJSTACK"
#include "logging.h"
+#include "objstack.h"
+
#include <stdlib.h>
#include "common/list.h"
#include "common/macros.h"
return 0;
}
-BT_HIDDEN
+static
void yyerror(struct ctf_scanner *scanner, yyscan_t yyscanner, const char *str)
{
_BT_LOGE_LINENO(yyget_lineno(scanner->scanner),
"%s: token=\"%s\"", str, yyget_text(scanner->scanner));
}
-BT_HIDDEN
-int yywrap(void)
-{
- return 1;
-}
-
#define reparent_error(scanner, str) \
do { \
yyerror(scanner, scanner->scanner, YY_("reparent_error: " str)); \
#endif
}
+%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);
+}
%define api.pure
/* %locations */
return ret;
}
+static
int get_unary_uuid(struct ctx *ctx, struct bt_list_head *head,
bt_uuid_t uuid)
{
return BT_BFCR_STATUS_OK;
}
+static
enum bt_bfcr_status bfcr_compound_begin_cb(
struct ctf_field_class *fc, void *data)
{
return BT_BFCR_STATUS_OK;
}
+static
enum bt_bfcr_status bfcr_compound_end_cb(
struct ctf_field_class *fc, void *data)
{
* SOFTWARE.
*/
+#include "translate-ctf-ir-to-tsdl.h"
+
#include <babeltrace2/babeltrace.h>
#include "common/macros.h"
#include <stdio.h>
#define BT_LOG_TAG "PLUGIN/SINK.CTF.FS/TRANSLATE-TRACE-IR-TO-CTF-IR"
#include "logging/comp-logging.h"
+#include "translate-trace-ir-to-ctf-ir.h"
+
#include <babeltrace2/babeltrace.h>
#include "common/macros.h"
#include "common/common.h"
return ret;
}
+static
bool default_clock_class_name_exists(struct fs_sink_ctf_trace *trace,
const char *name)
{
return;
}
+static
void trace_debug_info_remove_func(const bt_trace *in_trace, void *data)
{
struct debug_info_msg_iter *debug_it = data;
return DEBUG_INFO_TRACE_IR_MAPPING_STATUS_OK;
}
-BT_HIDDEN
+static
enum debug_info_trace_ir_mapping_status field_class_unsigned_enumeration_copy(
struct trace_ir_metadata_maps *md_maps,
const bt_field_class *in_field_class,
#define BT_LOG_TAG "PLUGIN/SRC.TEXT.DMESG"
#include "logging/comp-logging.h"
+#include "dmesg.h"
+
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
}
}
+static
void destroy_private_counter_data(struct counter *counter)
{
if (counter) {
static
const char * const in_port_name = "in";
+static
void destroy_private_dummy_data(struct dummy *dummy)
{
bt_self_component_port_input_message_iterator_put_ref(dummy->msg_iter);
*/
#define BT_LOG_TAG "LIB/PLUGIN-PY"
-
#include "lib/logging.h"
+
+#include "python-plugin-provider.h"
+
#include "common/macros.h"
#include "compat/compiler.h"
#include <babeltrace2/plugin/plugin-const.h>
* SOFTWARE.
*/
-#include <babeltrace2/plugin/plugin-const.h>
+#include <babeltrace2/babeltrace.h>
+#include <stdbool.h>
extern
-enum bt_plugin_status bt_plugin_python_create_all_from_file(const char *path,
+int bt_plugin_python_create_all_from_file(const char *path,
+ bool fail_on_load_error,
struct bt_plugin_set **plugin_set_out);
#endif /* BABELTRACE_PLUGIN_PYTHON_PLUGIN_PROVIDER_INTERNAL_H */
/*
* This function is only declared to show the size of a bitfield write in
- * objdump.
+ * objdump. The declaration is there to avoid a -Wmissing-prototypes warning.
*/
+void fct(void);
void fct(void)
{
bt_bitfield_write(&glob, unsigned int, 12, 15, 0x12345678);
(val) != (ref); \
})
+static
void run_test_unsigned_write(unsigned int src_ui, unsigned long long src_ull)
{
unsigned int nrbits_ui, nrbits_ull;
pass(UNSIGNED_LONG_LONG_WRITE_TEST_DESC_FMT_STR, src_ull);
}
+static
void run_test_unsigned_read(unsigned int src_ui, unsigned long long src_ull)
{
unsigned int nrbits_ui, nrbits_ull, readval_ui;
pass(UNSIGNED_LONG_LONG_READ_TEST_DESC_FMT_STR, src_ull);
}
+static
void run_test_unsigned(unsigned int src_ui, unsigned long long src_ull)
{
run_test_unsigned_write(src_ui, src_ull);
run_test_unsigned_read(src_ui, src_ull);
}
+static
void run_test_signed_write(int src_i, long long src_ll)
{
unsigned int nrbits_i, nrbits_ll;
pass(SIGNED_LONG_LONG_WRITE_TEST_DESC_FMT_STR, src_ll);
}
+static
void run_test_signed_read(int src_i, long long src_ll)
{
unsigned int nrbits_i, nrbits_ll;
pass(SIGNED_LONG_LONG_READ_TEST_DESC_FMT_STR, src_ll);
}
+static
void run_test_signed(int src_i, long long src_ll)
{
run_test_signed_write(src_i, src_ll);
run_test_signed_read(src_i, src_ll);
}
+static
void run_test(void)
{
int i;
BT_VALUE_PUT_REF_AND_RESET(int3);
}
+static
void test_is_equal_signed_integer(void)
{
bt_value *int1 =
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include "common.h"
+
#include <unistd.h>
#include <stdio.h>
#include <dirent.h>