babeltrace/trace-ir/clock-value.h \
babeltrace/trace-ir/event-class.h \
babeltrace/trace-ir/event.h \
- babeltrace/trace-ir/event-header-field.h \
- babeltrace/trace-ir/field-path.h \
babeltrace/trace-ir/field-classes.h \
+ babeltrace/trace-ir/field-path.h \
babeltrace/trace-ir/fields.h \
babeltrace/trace-ir/packet.h \
- babeltrace/trace-ir/packet-context-field.h \
- babeltrace/trace-ir/packet-header-field.h \
+ babeltrace/trace-ir/private-clock-class.h \
+ babeltrace/trace-ir/private-event-class.h \
+ babeltrace/trace-ir/private-event-header-field.h \
+ babeltrace/trace-ir/private-event.h \
+ babeltrace/trace-ir/private-field-classes.h \
+ babeltrace/trace-ir/private-fields.h \
+ babeltrace/trace-ir/private-packet-context-field.h \
+ babeltrace/trace-ir/private-packet-header-field.h \
+ babeltrace/trace-ir/private-packet.h \
+ babeltrace/trace-ir/private-stream-class.h \
+ babeltrace/trace-ir/private-stream.h \
+ babeltrace/trace-ir/private-trace.h \
babeltrace/trace-ir/stream-class.h \
babeltrace/trace-ir/stream.h \
babeltrace/trace-ir/trace.h
babeltrace/graph/private-connection-notification-iterator.h \
babeltrace/graph/private-connection-private-notification-iterator.h \
babeltrace/graph/private-connection.h \
+ babeltrace/graph/private-notification-event.h \
+ babeltrace/graph/private-notification-inactivity.h \
+ babeltrace/graph/private-notification-packet.h \
+ babeltrace/graph/private-notification-stream.h \
+ babeltrace/graph/private-notification.h \
babeltrace/graph/private-port.h \
babeltrace/graph/query-executor.h
#include <babeltrace/trace-ir/clock-class.h>
#include <babeltrace/trace-ir/clock-value.h>
#include <babeltrace/trace-ir/event-class.h>
-#include <babeltrace/trace-ir/event-header-field.h>
#include <babeltrace/trace-ir/event.h>
#include <babeltrace/trace-ir/field-classes.h>
#include <babeltrace/trace-ir/field-path.h>
#include <babeltrace/trace-ir/fields.h>
-#include <babeltrace/trace-ir/packet-context-field.h>
-#include <babeltrace/trace-ir/packet-header-field.h>
#include <babeltrace/trace-ir/packet.h>
+#include <babeltrace/trace-ir/private-clock-class.h>
+#include <babeltrace/trace-ir/private-event-class.h>
+#include <babeltrace/trace-ir/private-event-header-field.h>
+#include <babeltrace/trace-ir/private-event.h>
+#include <babeltrace/trace-ir/private-field-classes.h>
+#include <babeltrace/trace-ir/private-fields.h>
+#include <babeltrace/trace-ir/private-packet-context-field.h>
+#include <babeltrace/trace-ir/private-packet-header-field.h>
+#include <babeltrace/trace-ir/private-packet.h>
+#include <babeltrace/trace-ir/private-stream-class.h>
+#include <babeltrace/trace-ir/private-stream.h>
+#include <babeltrace/trace-ir/private-trace.h>
#include <babeltrace/trace-ir/stream-class.h>
#include <babeltrace/trace-ir/stream.h>
#include <babeltrace/trace-ir/trace.h>
#include <babeltrace/graph/private-connection-notification-iterator.h>
#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/graph/private-connection.h>
+#include <babeltrace/graph/private-notification-event.h>
+#include <babeltrace/graph/private-notification-inactivity.h>
+#include <babeltrace/graph/private-notification-packet.h>
+#include <babeltrace/graph/private-notification-stream.h>
+#include <babeltrace/graph/private-notification.h>
#include <babeltrace/graph/private-port.h>
#include <babeltrace/graph/query-executor.h>
void *data;
};
+struct bt_graph;
+
struct bt_component {
struct bt_object base;
struct bt_component_class *class;
return (void *) component;
}
+static inline
+struct bt_graph *bt_component_borrow_graph(struct bt_component *comp)
+{
+ BT_ASSERT(comp);
+ return (void *) bt_object_borrow_parent(&comp->base);
+}
+
BT_HIDDEN
enum bt_component_status bt_component_create(
struct bt_component_class *component_class,
BT_COMPONENT_CLASS_TYPE_SINK;
}
-extern struct bt_graph *bt_component_borrow_graph(struct bt_component *component);
-
-static inline
-struct bt_graph *bt_component_get_graph(struct bt_component *component)
-{
- return bt_object_get_ref(bt_component_borrow_graph(component));
-}
+extern bt_bool bt_component_graph_is_canceled(struct bt_component *component);
#ifdef __cplusplus
}
#define BABELTRACE_GRAPH_NOTIFICATION_EVENT_H
/*
- * BabelTrace - Plug-in Event Notification
- *
* Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
* SOFTWARE.
*/
-/* For bt_object_get_ref() */
-#include <babeltrace/object.h>
-
#ifdef __cplusplus
extern "C" {
#endif
struct bt_notification;
-struct bt_private_connection_private_notification_iterator;
struct bt_event;
-struct bt_event_class;
-
-extern
-struct bt_notification *bt_notification_event_create(
- struct bt_private_connection_private_notification_iterator *notification_iterator,
- struct bt_event_class *event_class, struct bt_packet *packet);
extern struct bt_event *bt_notification_event_borrow_event(
struct bt_notification *notification);
* SOFTWARE.
*/
-#include <stdint.h>
-
-/* For bt_bool */
-#include <babeltrace/types.h>
-
#ifdef __cplusplus
extern "C" {
#endif
struct bt_notification;
-struct bt_private_connection_private_notification_iterator;
struct bt_clock_value;
-struct bt_clock_class;
-
-extern
-struct bt_notification *bt_notification_inactivity_create(
- struct bt_private_connection_private_notification_iterator *notification_iterator,
- struct bt_clock_class *default_clock_class);
-
-extern int bt_notification_inactivity_set_default_clock_value(
- struct bt_notification *notif, uint64_t raw_value);
extern struct bt_clock_value *bt_notification_inactivity_borrow_default_clock_value(
struct bt_notification *notif);
#define BABELTRACE_GRAPH_NOTIFICATION_ITERATOR_H
/*
- * BabelTrace - Notification Iterator
- *
* Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
* SOFTWARE.
*/
-/* For bt_object_get_ref() */
-#include <babeltrace/object.h>
-
-#include <stdint.h>
-
#ifdef __cplusplus
extern "C" {
#endif
#define BABELTRACE_GRAPH_NOTIFICATION_PACKET_H
/*
- * BabelTrace - Plug-in Packet-related Notifications
- *
* Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
* SOFTWARE.
*/
-/* For bt_object_get_ref() */
-#include <babeltrace/object.h>
-
#ifdef __cplusplus
extern "C" {
#endif
struct bt_notification;
-struct bt_private_connection_private_notification_iterator;
struct bt_packet;
-extern
-struct bt_notification *bt_notification_packet_begin_create(
- struct bt_private_connection_private_notification_iterator *notification_iterator,
- struct bt_packet *packet);
-
-extern
-struct bt_notification *bt_notification_packet_end_create(
- struct bt_private_connection_private_notification_iterator *notification_iterator,
- struct bt_packet *packet);
-
-
extern struct bt_packet *bt_notification_packet_begin_borrow_packet(
struct bt_notification *notification);
-static inline
-struct bt_packet *bt_notification_packet_begin_get_packet(
- struct bt_notification *notification)
-{
- return bt_object_get_ref(bt_notification_packet_begin_borrow_packet(notification));
-}
-
extern struct bt_packet *bt_notification_packet_end_borrow_packet(
struct bt_notification *notification);
-static inline
-struct bt_packet *bt_notification_packet_end_get_packet(
- struct bt_notification *notification)
-{
- return bt_object_get_ref(bt_notification_packet_end_borrow_packet(notification));
-}
-
#ifdef __cplusplus
}
#endif
#define BABELTRACE_GRAPH_NOTIFICATION_STREAM_H
/*
- * BabelTrace - Plug-in Stream-related Notifications
- *
* Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
* SOFTWARE.
*/
-#include <stdint.h>
-
-/* For bt_object_get_ref() */
-#include <babeltrace/object.h>
-
-/* For bt_bool */
-#include <babeltrace/types.h>
-
#ifdef __cplusplus
extern "C" {
#endif
struct bt_notification;
struct bt_private_connection_private_notification_iterator;
-struct bt_clock_class;
struct bt_clock_value;
struct bt_stream;
-extern
-struct bt_notification *bt_notification_stream_begin_create(
- struct bt_private_connection_private_notification_iterator *notification_iterator,
- struct bt_stream *stream);
-
-extern
-struct bt_notification *bt_notification_stream_end_create(
- struct bt_private_connection_private_notification_iterator *notification_iterator,
- struct bt_stream *stream);
-
extern struct bt_stream *bt_notification_stream_begin_borrow_stream(
struct bt_notification *notification);
-static inline
-struct bt_stream *bt_notification_stream_begin_get_stream(
- struct bt_notification *notification)
-{
- return bt_object_get_ref(bt_notification_stream_begin_borrow_stream(notification));
-}
-
-extern int bt_notification_stream_begin_set_default_clock_value(
- struct bt_notification *notif, uint64_t value_cycles);
-
extern struct bt_clock_value *bt_notification_stream_begin_borrow_default_clock_value(
struct bt_notification *notif);
extern struct bt_stream *bt_notification_stream_end_borrow_stream(
struct bt_notification *notification);
-static inline
-struct bt_stream *bt_notification_stream_end_get_stream(
- struct bt_notification *notification)
-{
- return bt_object_get_ref(bt_notification_stream_end_borrow_stream(notification));
-}
-
-extern int bt_notification_stream_end_set_default_clock_value(
- struct bt_notification *notif, uint64_t value_cycles);
-
extern struct bt_clock_value *bt_notification_stream_end_borrow_default_clock_value(
struct bt_notification *notif);
--- /dev/null
+#ifndef BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_EVENT_H
+#define BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_EVENT_H
+
+/*
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_notification;
+struct bt_private_connection_private_notification_iterator;
+struct bt_private_event;
+struct bt_private_packet;
+struct bt_private_event_class;
+
+extern
+struct bt_private_notification *bt_private_notification_event_create(
+ struct bt_private_connection_private_notification_iterator *notification_iterator,
+ struct bt_private_event_class *event_class,
+ struct bt_private_packet *packet);
+
+extern struct bt_private_event *
+bt_private_notification_event_borrow_private_event(
+ struct bt_private_notification *notification);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_EVENT_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_INACTIVITY_H
+#define BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_INACTIVITY_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_notification;
+struct bt_private_connection_private_notification_iterator;
+struct bt_clock_class;
+
+extern
+struct bt_private_notification *bt_private_notification_inactivity_create(
+ struct bt_private_connection_private_notification_iterator *notification_iterator,
+ struct bt_clock_class *default_clock_class);
+
+extern int bt_private_notification_inactivity_set_default_clock_value(
+ struct bt_private_notification *notif, uint64_t raw_value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_INACTIVITY_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_PACKET_H
+#define BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_PACKET_H
+
+/*
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_notification;
+struct bt_private_connection_private_notification_iterator;
+struct bt_private_packet;
+
+extern
+struct bt_private_notification *bt_private_notification_packet_begin_create(
+ struct bt_private_connection_private_notification_iterator *notification_iterator,
+ struct bt_private_packet *packet);
+
+extern
+struct bt_private_notification *bt_private_notification_packet_end_create(
+ struct bt_private_connection_private_notification_iterator *notification_iterator,
+ struct bt_private_packet *packet);
+
+extern struct bt_private_packet *
+bt_private_notification_packet_begin_borrow_private_packet(
+ struct bt_private_notification *notification);
+
+extern struct bt_private_packet *
+bt_private_notification_packet_end_borrow_private_packet(
+ struct bt_private_notification *notification);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_PACKET_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_STREAM_H
+#define BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_STREAM_H
+
+/*
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_notification;
+struct bt_private_connection_private_notification_iterator;
+struct bt_private_stream;
+
+extern
+struct bt_private_notification *bt_private_notification_stream_begin_create(
+ struct bt_private_connection_private_notification_iterator *notification_iterator,
+ struct bt_private_stream *stream);
+
+extern
+struct bt_private_notification *bt_private_notification_stream_end_create(
+ struct bt_private_connection_private_notification_iterator *notification_iterator,
+ struct bt_private_stream *stream);
+
+extern struct bt_private_stream *
+bt_private_notification_stream_begin_borrow_private_stream(
+ struct bt_private_notification *notification);
+
+extern int bt_private_notification_stream_begin_set_default_clock_value(
+ struct bt_private_notification *notif, uint64_t value_cycles);
+
+extern struct bt_private_stream *
+bt_private_notification_stream_end_borrow_private_stream(
+ struct bt_private_notification *notification);
+
+extern int bt_private_notification_stream_end_set_default_clock_value(
+ struct bt_private_notification *notif, uint64_t value_cycles);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_STREAM_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_H
+#define BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_H
+
+/*
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification;
+struct bt_private_notification;
+
+extern struct bt_notification *bt_notification_borrow_from_private(
+ struct bt_private_notification *priv_notif);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_H */
struct bt_port *bt_port_borrow_from_private(
struct bt_private_port *private_port);
+
extern struct bt_private_connection *bt_private_port_get_private_connection(
struct bt_private_port *private_port);
+
extern struct bt_private_component *bt_private_port_get_private_component(
struct bt_private_port *private_port);
+
extern enum bt_port_status bt_private_port_remove_from_component(
struct bt_private_port *private_port);
+
extern void *bt_private_port_get_user_data(
struct bt_private_port *private_port);
#define BABELTRACE_TRACE_IR_CLOCK_CLASS_H
/*
- * BabelTrace - Trace IR: Clock class
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
* Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
*
#endif
struct bt_clock_class;
-struct bt_clock_value;
-
-extern struct bt_clock_class *bt_clock_class_create(void);
extern const char *bt_clock_class_get_name(struct bt_clock_class *clock_class);
-extern int bt_clock_class_set_name(struct bt_clock_class *clock_class,
- const char *name);
-
extern const char *bt_clock_class_get_description(
struct bt_clock_class *clock_class);
-extern int bt_clock_class_set_description(struct bt_clock_class *clock_class,
- const char *description);
-
extern uint64_t bt_clock_class_get_frequency(
struct bt_clock_class *clock_class);
-extern int bt_clock_class_set_frequency(struct bt_clock_class *clock_class,
- uint64_t freq);
-
extern uint64_t bt_clock_class_get_precision(
struct bt_clock_class *clock_class);
-extern int bt_clock_class_set_precision(struct bt_clock_class *clock_class,
- uint64_t precision);
-
extern void bt_clock_class_get_offset(struct bt_clock_class *clock_class,
int64_t *seconds, uint64_t *cycles);
-extern int bt_clock_class_set_offset(struct bt_clock_class *clock_class,
- int64_t seconds, uint64_t cycles);
-
extern bt_bool bt_clock_class_is_absolute(struct bt_clock_class *clock_class);
-extern int bt_clock_class_set_is_absolute(struct bt_clock_class *clock_class,
- bt_bool is_absolute);
-
extern bt_uuid bt_clock_class_get_uuid(struct bt_clock_class *clock_class);
-extern int bt_clock_class_set_uuid(struct bt_clock_class *clock_class,
- bt_uuid uuid);
-
extern int bt_clock_class_cycles_to_ns_from_origin(
struct bt_clock_class *clock_class,
uint64_t cycles, int64_t *ns_from_origin);
#define BABELTRACE_TRACE_IR_CLOCK_VALUE_H
/*
- * BabelTrace - Trace IR: Clock class
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
* Copyright 2017 Philippe Proulx <pproulx@efficios.com>
*
+++ /dev/null
-#ifndef BABELTRACE_TRACE_IR_CLOCK_H
-#define BABELTRACE_TRACE_IR_CLOCK_H
-
-/*
- * BabelTrace - Trace IR: Clock
- *
- * Copyright 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * The Common Trace Format (CTF) Specification is available at
- * http://www.efficios.com/ctf
- */
-
-#include <babeltrace/ctf-writer/clock.h>
-
-#endif /* BABELTRACE_TRACE_IR_CLOCK_H */
#define BABELTRACE_TRACE_IR_EVENT_CLASS_H
/*
- * BabelTrace - Trace IR: Event class
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
BT_EVENT_CLASS_LOG_LEVEL_DEBUG,
};
-extern struct bt_event_class *bt_event_class_create(
- struct bt_stream_class *stream_class);
-
-extern struct bt_event_class *bt_event_class_create_with_id(
- struct bt_stream_class *stream_class, uint64_t id);
-
extern struct bt_stream_class *bt_event_class_borrow_stream_class(
struct bt_event_class *event_class);
extern const char *bt_event_class_get_name(struct bt_event_class *event_class);
-extern int bt_event_class_set_name(struct bt_event_class *event_class,
- const char *name);
-
extern uint64_t bt_event_class_get_id(struct bt_event_class *event_class);
extern enum bt_property_availability bt_event_class_get_log_level(
struct bt_event_class *event_class,
enum bt_event_class_log_level *log_level);
-extern int bt_event_class_set_log_level(struct bt_event_class *event_class,
- enum bt_event_class_log_level log_level);
-
extern const char *bt_event_class_get_emf_uri(
struct bt_event_class *event_class);
-extern int bt_event_class_set_emf_uri(struct bt_event_class *event_class,
- const char *emf_uri);
-
extern struct bt_field_class *bt_event_class_borrow_specific_context_field_class(
struct bt_event_class *event_class);
-extern int bt_event_class_set_specific_context_field_class(
- struct bt_event_class *event_class,
- struct bt_field_class *field_class);
-
extern struct bt_field_class *bt_event_class_borrow_payload_field_class(
struct bt_event_class *event_class);
-extern int bt_event_class_set_payload_field_class(
- struct bt_event_class *event_class,
- struct bt_field_class *field_class);
-
#ifdef __cplusplus
}
#endif
+++ /dev/null
-#ifndef BABELTRACE_TRACE_IR_EVENT_HEADER_FIELD_H
-#define BABELTRACE_TRACE_IR_EVENT_HEADER_FIELD_H
-
-/*
- * Copyright 2018 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * The Common Trace Format (CTF) Specification is available at
- * http://www.efficios.com/ctf
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_stream_class;
-struct bt_event_header_field;
-struct bt_field;
-
-extern
-struct bt_event_header_field *bt_event_header_field_create(
- struct bt_stream_class *stream_class);
-
-extern
-struct bt_field *bt_event_header_field_borrow_field(
- struct bt_event_header_field *field);
-
-extern
-void bt_event_header_field_release(struct bt_event_header_field *field);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_TRACE_IR_EVENT_HEADER_FIELD_H */
#include <glib.h>
#define BT_ASSERT_PRE_EVENT_HOT(_event) \
- BT_ASSERT_PRE_HOT((_event), "Event", ": %!+e", (_event))
+ BT_ASSERT_PRE_HOT(((struct bt_event *) (_event)), "Event", ": %!+e", (_event))
struct bt_event {
struct bt_object base;
#define BABELTRACE_TRACE_IR_EVENT_H
/*
- * BabelTrace - Trace IR: Event
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
* http://www.efficios.com/ctf
*/
-#include <stdint.h>
-#include <stddef.h>
-
/* For enum bt_clock_value_status */
#include <babeltrace/trace-ir/clock-value.h>
#endif
struct bt_event;
-struct bt_event_header_field;
struct bt_clock_value;
struct bt_event_class;
struct bt_field;
extern struct bt_field *bt_event_borrow_header_field(struct bt_event *event);
-extern int bt_event_move_header(struct bt_event *event,
- struct bt_event_header_field *header);
-
extern struct bt_field *bt_event_borrow_common_context_field(
struct bt_event *event);
extern struct bt_field *bt_event_borrow_payload_field(struct bt_event *event);
-extern int bt_event_set_default_clock_value(struct bt_event *event,
- uint64_t value_cycles);
-
extern enum bt_clock_value_status bt_event_borrow_default_clock_value(
struct bt_event *event, struct bt_clock_value **clock_value);
#define BABELTRACE_TRACE_IR_FIELD_CLASSES_H
/*
- * BabelTrace - Trace IR: Event field classes
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
* http://www.efficios.com/ctf
*/
-/* For bt_object_get_ref() */
-#include <babeltrace/object.h>
-
/* For bt_bool */
#include <babeltrace/types.h>
extern enum bt_field_class_type bt_field_class_get_type(
struct bt_field_class *field_class);
-extern struct bt_field_class *bt_field_class_unsigned_integer_create(void);
-
-extern struct bt_field_class *bt_field_class_signed_integer_create(void);
-
extern uint64_t bt_field_class_integer_get_field_value_range(
struct bt_field_class *field_class);
-extern int bt_field_class_integer_set_field_value_range(
- struct bt_field_class *field_class, uint64_t size);
-
extern enum bt_field_class_integer_preferred_display_base
bt_field_class_integer_get_preferred_display_base(
struct bt_field_class *field_class);
-extern int bt_field_class_integer_set_preferred_display_base(
- struct bt_field_class *field_class,
- enum bt_field_class_integer_preferred_display_base base);
-
-extern struct bt_field_class *bt_field_class_real_create(void);
-
extern bt_bool bt_field_class_real_is_single_precision(
struct bt_field_class *field_class);
-extern int bt_field_class_real_set_is_single_precision(
- struct bt_field_class *field_class,
- bt_bool is_single_precision);
-
-extern struct bt_field_class *bt_field_class_unsigned_enumeration_create(void);
-
-extern struct bt_field_class *bt_field_class_signed_enumeration_create(void);
-
extern uint64_t bt_field_class_enumeration_get_mapping_count(
struct bt_field_class *field_class);
bt_field_class_enumeration_mapping_label_array *label_array,
uint64_t *count);
-extern int bt_field_class_unsigned_enumeration_map_range(
- struct bt_field_class *field_class, const char *label,
- uint64_t range_lower, uint64_t range_upper);
-
-extern int bt_field_class_signed_enumeration_map_range(
- struct bt_field_class *field_class, const char *label,
- int64_t range_lower, int64_t range_upper);
-
-extern struct bt_field_class *bt_field_class_string_create(void);
-
-extern struct bt_field_class *bt_field_class_structure_create(void);
-
extern uint64_t bt_field_class_structure_get_member_count(
struct bt_field_class *field_class);
struct bt_field_class *bt_field_class_structure_borrow_member_field_class_by_name(
struct bt_field_class *field_class, const char *name);
-extern int bt_field_class_structure_append_member(
- struct bt_field_class *struct_field_class, const char *name,
- struct bt_field_class *field_class);
-
-extern struct bt_field_class *bt_field_class_static_array_create(
- struct bt_field_class *elem_field_class,
- uint64_t length);
-
-extern struct bt_field_class *bt_field_class_dynamic_array_create(
- struct bt_field_class *elem_field_class);
-
extern struct bt_field_class *bt_field_class_array_borrow_element_field_class(
struct bt_field_class *field_class);
bt_field_class_dynamic_array_borrow_length_field_path(
struct bt_field_class *field_class);
-extern int bt_field_class_dynamic_array_set_length_field_class(
- struct bt_field_class *field_class,
- struct bt_field_class *length_field_class);
-
-extern struct bt_field_class *bt_field_class_variant_create(void);
-
extern struct bt_field_path *
bt_field_class_variant_borrow_selector_field_path(
struct bt_field_class *field_class);
-extern int bt_field_class_variant_set_selector_field_class(
- struct bt_field_class *field_class,
- struct bt_field_class *selector_field_class);
-
extern uint64_t bt_field_class_variant_get_option_count(
struct bt_field_class *field_class);
struct bt_field_class *field_class,
const char *name);
-extern int bt_field_class_variant_append_option(
- struct bt_field_class *var_field_class,
- const char *name, struct bt_field_class *field_class);
-
#ifdef __cplusplus
}
#endif
#define BABELTRACE_TRACE_IR_FIELD_PATH_H
/*
- * BabelTrace - Trace IR: Field path
- *
* Copyright 2016-2018 Philippe Proulx <pproulx@efficios.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
#define BABELTRACE_TRACE_IR_FIELDS_H
/*
- * Babeltrace - Trace IR: Event Fields
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
#include <stdint.h>
-/* For bt_bool */
-#include <babeltrace/types.h>
-
/* For enum bt_field_class_type */
#include <babeltrace/trace-ir/field-classes.h>
struct bt_field;
struct bt_field_class;
-struct bt_field_class_enumeration_mapping_iterator;
extern struct bt_field_class *bt_field_borrow_class(struct bt_field *field);
extern int64_t bt_field_signed_integer_get_value(struct bt_field *field);
-extern void bt_field_signed_integer_set_value(struct bt_field *field,
- int64_t value);
-
extern uint64_t bt_field_unsigned_integer_get_value(struct bt_field *field);
-extern void bt_field_unsigned_integer_set_value(struct bt_field *field,
- uint64_t value);
-
extern double bt_field_real_get_value(struct bt_field *field);
-extern void bt_field_real_set_value(struct bt_field *field, double value);
-
extern int bt_field_unsigned_enumeration_get_mapping_labels(
struct bt_field *field,
bt_field_class_enumeration_mapping_label_array *label_array,
extern uint64_t bt_field_string_get_length(struct bt_field *field);
-extern int bt_field_string_set_value(struct bt_field *field, const char *value);
-
-extern int bt_field_string_append(struct bt_field *field, const char *value);
-
-extern int bt_field_string_append_with_length(struct bt_field *field,
- const char *value, uint64_t length);
-
-extern int bt_field_string_clear(struct bt_field *field);
-
extern struct bt_field *bt_field_structure_borrow_member_field_by_index(
struct bt_field *field, uint64_t index);
extern struct bt_field *bt_field_array_borrow_element_field_by_index(
struct bt_field *field, uint64_t index);
-extern int bt_field_dynamic_array_set_length(struct bt_field *field,
- uint64_t length);
-
-extern int bt_field_variant_select_option_field(struct bt_field *field,
- uint64_t index);
-
extern uint64_t bt_field_variant_get_selected_option_field_index(
struct bt_field *field);
+++ /dev/null
-#ifndef BABELTRACE_TRACE_IR_PACKET_CONTEXT_FIELD_H
-#define BABELTRACE_TRACE_IR_PACKET_CONTEXT_FIELD_H
-
-/*
- * Copyright 2018 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * The Common Trace Format (CTF) Specification is available at
- * http://www.efficios.com/ctf
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_stream_class;
-struct bt_packet_context_field;
-struct bt_field;
-
-extern
-struct bt_packet_context_field *bt_packet_context_field_create(
- struct bt_stream_class *stream_class);
-
-extern
-struct bt_field *bt_packet_context_field_borrow_field(
- struct bt_packet_context_field *field);
-
-extern
-void bt_packet_context_field_release(struct bt_packet_context_field *field);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_TRACE_IR_PACKET_CONTEXT_FIELD_H */
+++ /dev/null
-#ifndef BABELTRACE_TRACE_IR_PACKET_HEADER_FIELD_H
-#define BABELTRACE_TRACE_IR_PACKET_HEADER_FIELD_H
-
-/*
- * Copyright 2018 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * The Common Trace Format (CTF) Specification is available at
- * http://www.efficios.com/ctf
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_trace;
-struct bt_packet_header_field;
-struct bt_field;
-
-extern
-struct bt_packet_header_field *bt_packet_header_field_create(
- struct bt_trace *trace);
-
-extern
-struct bt_field *bt_packet_header_field_borrow_field(
- struct bt_packet_header_field *field);
-
-extern
-void bt_packet_header_field_release(struct bt_packet_header_field *field);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_TRACE_IR_PACKET_HEADER_FIELD_H */
#define BABELTRACE_TRACE_IR_PACKET_H
/*
- * BabelTrace - Trace IR: Stream packet
- *
* Copyright 2016 Philippe Proulx <pproulx@efficios.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
struct bt_stream;
struct bt_clock_value;
-extern struct bt_packet *bt_packet_create(struct bt_stream *stream);
-
extern struct bt_stream *bt_packet_borrow_stream(struct bt_packet *packet);
extern
struct bt_field *bt_packet_borrow_header_field(struct bt_packet *packet);
-extern
-int bt_packet_move_header_field(struct bt_packet *packet,
- struct bt_packet_header_field *header);
-
extern
struct bt_field *bt_packet_borrow_context_field(struct bt_packet *packet);
-extern
-int bt_packet_move_context_field(struct bt_packet *packet,
- struct bt_packet_context_field *context);
-
extern
enum bt_clock_value_status bt_packet_borrow_default_beginning_clock_value(
struct bt_packet *packet, struct bt_clock_value **clock_value);
-extern
-int bt_packet_set_default_beginning_clock_value(struct bt_packet *packet,
- uint64_t value_cycles);
-
extern
enum bt_clock_value_status bt_packet_borrow_default_end_clock_valeu(
struct bt_packet *packet, struct bt_clock_value **clock_value);
-extern
-int bt_packet_set_default_end_clock_value(struct bt_packet *packet,
- uint64_t value_cycles);
-
extern
enum bt_property_availability bt_packet_get_discarded_event_counter_snapshot(
struct bt_packet *packet, uint64_t *value);
-extern
-int bt_packet_set_discarded_event_counter_snapshot(struct bt_packet *packet,
- uint64_t value);
-
extern
enum bt_property_availability bt_packet_get_packet_counter_snapshot(
struct bt_packet *packet, uint64_t *value);
-extern
-int bt_packet_set_packet_counter_snapshot(struct bt_packet *packet,
- uint64_t value);
-
#ifdef __cplusplus
}
#endif
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_CLOCK_CLASS_H
+#define BABELTRACE_TRACE_IR_PRIVATE_CLOCK_CLASS_H
+
+/*
+ * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+#include <stdint.h>
+
+/* For bt_bool, bt_uuid */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_clock_class;
+struct bt_private_clock_class;
+
+extern struct bt_clock_class *bt_clock_class_borrow_from_private(
+ struct bt_private_clock_class *priv_clock_class);
+
+extern struct bt_private_clock_class *bt_private_clock_class_create(void);
+
+extern int bt_private_clock_class_set_name(
+ struct bt_private_clock_class *clock_class,
+ const char *name);
+
+extern int bt_private_clock_class_set_description(
+ struct bt_private_clock_class *clock_class,
+ const char *description);
+
+extern int bt_private_clock_class_set_frequency(
+ struct bt_private_clock_class *clock_class, uint64_t freq);
+
+extern int bt_private_clock_class_set_precision(
+ struct bt_private_clock_class *clock_class,
+ uint64_t precision);
+
+extern int bt_private_clock_class_set_offset(
+ struct bt_private_clock_class *clock_class,
+ int64_t seconds, uint64_t cycles);
+
+extern int bt_private_clock_class_set_is_absolute(
+ struct bt_private_clock_class *clock_class,
+ bt_bool is_absolute);
+
+extern int bt_private_clock_class_set_uuid(
+ struct bt_private_clock_class *clock_class, bt_uuid uuid);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_CLOCK_CLASS_H */
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_EVENT_CLASS_H
+#define BABELTRACE_TRACE_IR_PRIVATE_EVENT_CLASS_H
+
+/*
+ * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+/* For enum bt_event_class_log_level */
+#include <babeltrace/trace-ir/event-class.h>
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_event_class;
+struct bt_private_event_class;
+struct bt_private_stream_class;
+
+extern struct bt_event_class *bt_event_class_borrow_from_private(
+ struct bt_private_event_class *priv_event_class);
+
+extern struct bt_private_event_class *bt_private_event_class_create(
+ struct bt_private_stream_class *stream_class);
+
+extern struct bt_private_event_class *bt_private_event_class_create_with_id(
+ struct bt_private_stream_class *stream_class, uint64_t id);
+
+extern struct bt_private_stream_class *
+bt_private_event_class_borrow_private_stream_class(
+ struct bt_private_event_class *event_class);
+
+extern int bt_private_event_class_set_name(
+ struct bt_private_event_class *event_class, const char *name);
+
+extern int bt_private_event_class_set_log_level(
+ struct bt_private_event_class *event_class,
+ enum bt_event_class_log_level log_level);
+
+extern int bt_private_event_class_set_emf_uri(
+ struct bt_private_event_class *event_class,
+ const char *emf_uri);
+
+extern struct bt_private_field_class *
+bt_private_event_class_borrow_specific_context_private_field_class(
+ struct bt_private_event_class *event_class);
+
+extern int bt_private_event_class_set_specific_context_private_field_class(
+ struct bt_private_event_class *event_class,
+ struct bt_private_field_class *field_class);
+
+extern struct bt_private_field_class *
+bt_private_event_class_borrow_payload_private_field_class(
+ struct bt_private_event_class *event_class);
+
+extern int bt_private_event_class_set_payload_private_field_class(
+ struct bt_private_event_class *event_class,
+ struct bt_private_field_class *field_class);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_EVENT_CLASS_H */
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_EVENT_HEADER_FIELD_H
+#define BABELTRACE_TRACE_IR_PRIVATE_EVENT_HEADER_FIELD_H
+
+/*
+ * Copyright 2018 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_stream_class;
+struct bt_private_event_header_field;
+struct bt_private_field;
+
+extern
+struct bt_private_event_header_field *bt_private_event_header_field_create(
+ struct bt_private_stream_class *stream_class);
+
+extern
+struct bt_private_field *bt_private_event_header_field_borrow_private_field(
+ struct bt_private_event_header_field *field);
+
+extern
+void bt_private_event_header_field_release(
+ struct bt_private_event_header_field *field);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_EVENT_HEADER_FIELD_H */
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_EVENT_H
+#define BABELTRACE_TRACE_IR_PRIVATE_EVENT_H
+
+/*
+ * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_event;
+struct bt_private_event_header_field;
+struct bt_private_event_class;
+struct bt_private_field;
+struct bt_private_packet;
+
+extern struct bt_event *bt_event_borrow_from_private(
+ struct bt_private_event *priv_event);
+
+extern struct bt_private_event_class *bt_private_event_borrow_class(
+ struct bt_private_event *event);
+
+extern struct bt_private_packet *bt_private_event_borrow_packet(
+ struct bt_private_event *event);
+
+extern struct bt_private_stream *bt_private_event_borrow_stream(
+ struct bt_private_event *event);
+
+extern struct bt_private_field *bt_private_event_borrow_header_private_field(
+ struct bt_private_event *event);
+
+extern int bt_private_event_move_private_header_field(
+ struct bt_private_event *event,
+ struct bt_private_event_header_field *header);
+
+extern struct bt_private_field *
+bt_private_event_borrow_common_context_private_field(
+ struct bt_private_event *event);
+
+extern struct bt_private_field *
+bt_private_event_borrow_specific_context_private_field(
+ struct bt_private_event *event);
+
+extern struct bt_private_field *bt_private_event_borrow_payload_private_field(
+ struct bt_private_event *event);
+
+extern int bt_private_event_set_default_clock_value(
+ struct bt_private_event *event, uint64_t value_cycles);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_EVENT_H */
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_FIELD_CLASSES_H
+#define BABELTRACE_TRACE_IR_PRIVATE_FIELD_CLASSES_H
+
+/*
+ * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+/* For bt_bool */
+#include <babeltrace/types.h>
+
+/* For enum bt_field_class_integer_preferred_display_base */
+#include <babeltrace/trace-ir/field-classes.h>
+
+#include <stdint.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_field_class;
+struct bt_private_field_class;
+struct bt_private_field_path;
+struct bt_private_field_class_signed_enumeration_mapping_ranges;
+struct bt_private_field_class_unsigned_enumeration_mapping_ranges;
+
+extern struct bt_field_class *bt_field_class_borrow_from_private(
+ struct bt_private_field_class *priv_field_class);
+
+extern struct bt_private_field_class *
+bt_private_field_class_unsigned_integer_create(void);
+
+extern struct bt_private_field_class *
+bt_private_field_class_signed_integer_create(void);
+
+extern int bt_private_field_class_integer_set_field_value_range(
+ struct bt_private_field_class *field_class, uint64_t size);
+
+extern int bt_private_field_class_integer_set_preferred_display_base(
+ struct bt_private_field_class *field_class,
+ enum bt_field_class_integer_preferred_display_base base);
+
+extern struct bt_private_field_class *bt_private_field_class_real_create(void);
+
+extern int bt_private_field_class_real_set_is_single_precision(
+ struct bt_private_field_class *field_class,
+ bt_bool is_single_precision);
+
+extern struct bt_private_field_class *
+bt_private_field_class_unsigned_enumeration_create(void);
+
+extern struct bt_private_field_class *
+bt_private_field_class_signed_enumeration_create(void);
+
+extern uint64_t bt_private_field_class_enumeration_get_mapping_count(
+ struct bt_private_field_class *field_class);
+
+extern int bt_private_field_class_unsigned_enumeration_map_range(
+ struct bt_private_field_class *field_class, const char *label,
+ uint64_t range_lower, uint64_t range_upper);
+
+extern int bt_private_field_class_signed_enumeration_map_range(
+ struct bt_private_field_class *field_class, const char *label,
+ int64_t range_lower, int64_t range_upper);
+
+extern struct bt_private_field_class *
+bt_private_field_class_string_create(void);
+
+extern struct bt_private_field_class *
+bt_private_field_class_structure_create(void);
+
+extern void bt_private_field_class_structure_borrow_private_member_by_index(
+ struct bt_private_field_class *struct_field_class,
+ uint64_t index, const char **name,
+ struct bt_private_field_class **field_class);
+
+extern
+struct bt_private_field_class *
+bt_private_field_class_structure_borrow_member_private_field_class_by_name(
+ struct bt_private_field_class *field_class, const char *name);
+
+extern int bt_private_field_class_structure_append_private_member(
+ struct bt_private_field_class *struct_field_class,
+ const char *name, struct bt_private_field_class *field_class);
+
+extern struct bt_private_field_class *
+bt_private_field_class_static_array_create(
+ struct bt_private_field_class *elem_field_class,
+ uint64_t length);
+
+extern struct bt_private_field_class *
+bt_private_field_class_dynamic_array_create(
+ struct bt_private_field_class *elem_field_class);
+
+extern struct bt_private_field_class *
+bt_private_field_class_array_borrow_element_private_field_class(
+ struct bt_private_field_class *field_class);
+
+extern int bt_private_field_class_dynamic_array_set_length_private_field_class(
+ struct bt_private_field_class *field_class,
+ struct bt_private_field_class *length_field_class);
+
+extern struct bt_private_field_class *
+bt_private_field_class_variant_create(void);
+
+extern int bt_private_field_class_variant_set_selector_private_field_class(
+ struct bt_private_field_class *field_class,
+ struct bt_private_field_class *selector_field_class);
+
+extern void bt_private_field_class_variant_borrow_private_option_by_index(
+ struct bt_private_field_class *variant_field_class,
+ uint64_t index, const char **name,
+ struct bt_private_field_class **field_class);
+
+extern
+struct bt_private_field_class *
+bt_private_field_class_variant_borrow_option_private_field_class_by_name(
+ struct bt_private_field_class *field_class, const char *name);
+
+extern int bt_private_field_class_variant_append_private_option(
+ struct bt_private_field_class *var_field_class,
+ const char *name, struct bt_private_field_class *field_class);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_FIELD_CLASSES_H */
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_FIELDS_H
+#define BABELTRACE_TRACE_IR_PRIVATE_FIELDS_H
+
+/*
+ * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_field;
+struct bt_private_field;
+struct bt_private_field_class;
+
+extern struct bt_field *bt_field_borrow_from_private(
+ struct bt_private_field *priv_field);
+
+extern struct bt_private_field_class *bt_private_field_borrow_private_class(
+ struct bt_private_field *field);
+
+extern void bt_private_field_signed_integer_set_value(
+ struct bt_private_field *field, int64_t value);
+
+extern void bt_private_field_unsigned_integer_set_value(
+ struct bt_private_field *field, uint64_t value);
+
+extern void bt_private_field_real_set_value(struct bt_private_field *field,
+ double value);
+
+extern int bt_private_field_string_set_value(struct bt_private_field *field,
+ const char *value);
+
+extern int bt_private_field_string_append(struct bt_private_field *field,
+ const char *value);
+
+extern int bt_private_field_string_append_with_length(
+ struct bt_private_field *field,
+ const char *value, uint64_t length);
+
+extern int bt_private_field_string_clear(struct bt_private_field *field);
+
+extern struct bt_private_field *
+bt_private_field_structure_borrow_member_private_field_by_index(
+ struct bt_private_field *field, uint64_t index);
+
+extern struct bt_private_field *
+bt_private_field_structure_borrow_member_private_field_by_name(
+ struct bt_private_field *field, const char *name);
+
+extern struct bt_private_field *
+bt_private_field_array_borrow_element_private_field_by_index(
+ struct bt_private_field *field, uint64_t index);
+
+extern int bt_private_field_dynamic_array_set_length(
+ struct bt_private_field *field, uint64_t length);
+
+extern int bt_private_field_variant_select_option_private_field(
+ struct bt_private_field *field, uint64_t index);
+
+extern uint64_t bt_private_field_variant_get_selected_option_private_field_index(
+ struct bt_private_field *field);
+
+extern struct bt_private_field *
+bt_private_field_variant_borrow_selected_option_private_field(
+ struct bt_private_field *field);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_FIELDS_H */
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_PACKET_CONTEXT_FIELD_H
+#define BABELTRACE_TRACE_IR_PRIVATE_PACKET_CONTEXT_FIELD_H
+
+/*
+ * Copyright 2018 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_stream_class;
+struct bt_private_packet_context_field;
+struct bt_private_field;
+
+extern
+struct bt_private_packet_context_field *bt_private_packet_context_field_create(
+ struct bt_private_stream_class *stream_class);
+
+extern
+struct bt_private_field *bt_private_packet_context_field_borrow_private_field(
+ struct bt_private_packet_context_field *field);
+
+extern
+void bt_private_packet_context_field_release(
+ struct bt_private_packet_context_field *field);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_PACKET_CONTEXT_FIELD_H */
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_PACKET_HEADER_FIELD_H
+#define BABELTRACE_TRACE_IR_PRIVATE_PACKET_HEADER_FIELD_H
+
+/*
+ * Copyright 2018 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_trace;
+struct bt_private_packet_header_field;
+struct bt_private_field;
+
+extern
+struct bt_private_packet_header_field *bt_private_packet_header_field_create(
+ struct bt_private_trace *trace);
+
+extern
+struct bt_private_field *bt_private_packet_header_field_borrow_private_field(
+ struct bt_private_packet_header_field *field);
+
+extern
+void bt_private_packet_header_field_release(
+ struct bt_private_packet_header_field *field);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_PACKET_HEADER_FIELD_H */
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_PACKET_H
+#define BABELTRACE_TRACE_IR_PRIVATE_PACKET_H
+
+/*
+ * Copyright 2016 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_packet;
+struct bt_private_packet;
+struct bt_private_packet_header_field;
+struct bt_private_packet_context_field;
+struct bt_private_stream;
+
+extern struct bt_packet *bt_packet_borrow_from_private(
+ struct bt_private_packet *priv_packet);
+
+extern struct bt_private_packet *bt_private_packet_create(
+ struct bt_private_stream *stream);
+
+extern struct bt_private_stream *bt_private_packet_borrow_private_stream(
+ struct bt_private_packet *packet);
+
+extern
+struct bt_private_field *bt_private_packet_borrow_header_private_field(
+ struct bt_private_packet *packet);
+
+extern
+int bt_private_packet_move_private_header_field(
+ struct bt_private_packet *packet,
+ struct bt_private_packet_header_field *header);
+
+extern
+struct bt_private_field *bt_private_packet_borrow_context_private_field(
+ struct bt_private_packet *packet);
+
+extern
+int bt_private_packet_move_private_context_field(
+ struct bt_private_packet *packet,
+ struct bt_private_packet_context_field *context);
+
+extern
+int bt_private_packet_set_default_beginning_clock_value(
+ struct bt_private_packet *packet, uint64_t value_cycles);
+
+extern
+int bt_private_packet_set_default_end_clock_value(
+ struct bt_private_packet *packet, uint64_t value_cycles);
+
+extern
+int bt_private_packet_set_discarded_event_counter_snapshot(
+ struct bt_private_packet *packet, uint64_t value);
+
+extern
+int bt_private_packet_set_packet_counter_snapshot(
+ struct bt_private_packet *packet, uint64_t value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_PACKET_H */
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_STREAM_CLASS_H
+#define BABELTRACE_TRACE_IR_PRIVATE_STREAM_CLASS_H
+
+/*
+ * Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+#include <stdint.h>
+
+/* For bt_bool */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_stream_class;
+struct bt_private_stream_class;
+struct bt_private_trace;
+struct bt_private_event_class;
+struct bt_private_clock_class;
+
+extern struct bt_stream_class *bt_stream_class_borrow_from_private(
+ struct bt_private_stream_class *priv_stream_class);
+
+extern struct bt_private_stream_class *bt_private_stream_class_create(
+ struct bt_private_trace *trace);
+
+extern struct bt_private_stream_class *bt_private_stream_class_create_with_id(
+ struct bt_private_trace *trace, uint64_t id);
+
+extern struct bt_private_trace *bt_private_stream_class_borrow_private_trace(
+ struct bt_private_stream_class *stream_class);
+
+extern int bt_private_stream_class_set_name(
+ struct bt_private_stream_class *stream_class,
+ const char *name);
+
+extern int bt_private_stream_class_set_assigns_automatic_event_class_id(
+ struct bt_private_stream_class *stream_class, bt_bool value);
+
+extern int bt_private_stream_class_set_assigns_automatic_stream_id(
+ struct bt_private_stream_class *stream_class, bt_bool value);
+
+extern struct bt_private_field_class *
+bt_private_stream_class_borrow_packet_context_private_field_class(
+ struct bt_private_stream_class *stream_class);
+
+extern int bt_private_stream_class_set_packet_context_private_field_class(
+ struct bt_private_stream_class *stream_class,
+ struct bt_private_field_class *field_class);
+
+extern struct bt_private_field_class *
+bt_private_stream_class_borrow_event_header_private_field_class(
+ struct bt_private_stream_class *stream_class);
+
+extern int bt_private_stream_class_set_event_header_private_field_class(
+ struct bt_private_stream_class *stream_class,
+ struct bt_private_field_class *field_class);
+
+extern struct bt_private_field_class *
+bt_private_stream_class_borrow_event_common_context_private_field_class(
+ struct bt_private_stream_class *stream_class);
+
+extern int
+bt_private_stream_class_set_event_common_context_private_field_class(
+ struct bt_private_stream_class *stream_class,
+ struct bt_private_field_class *field_class);
+
+extern struct bt_private_event_class *
+bt_private_stream_class_borrow_private_event_class_by_index(
+ struct bt_private_stream_class *stream_class, uint64_t index);
+
+extern struct bt_private_event_class *
+bt_private_stream_class_borrow_private_event_class_by_id(
+ struct bt_private_stream_class *stream_class, uint64_t id);
+
+extern int bt_private_stream_class_set_default_clock_class(
+ struct bt_private_stream_class *stream_class,
+ struct bt_clock_class *clock_class);
+
+extern bt_bool bt_private_stream_class_default_clock_is_always_known(
+ struct bt_private_stream_class *stream_class);
+
+extern int
+bt_private_stream_class_set_packets_have_discarded_event_counter_snapshot(
+ struct bt_private_stream_class *stream_class, bt_bool value);
+
+extern int
+bt_private_stream_class_set_packets_have_packet_counter_snapshot(
+ struct bt_private_stream_class *stream_class, bt_bool value);
+
+extern int
+bt_private_stream_class_set_packets_have_default_beginning_clock_value(
+ struct bt_private_stream_class *stream_class, bt_bool value);
+
+extern int
+bt_private_stream_class_set_packets_have_default_end_clock_value(
+ struct bt_private_stream_class *stream_class, bt_bool value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_STREAM_CLASS_H */
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_STREAM_H
+#define BABELTRACE_TRACE_IR_PRIVATE_STREAM_H
+
+/*
+ * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_stream;
+struct bt_private_stream;
+struct bt_private_stream_class;
+
+extern struct bt_stream *bt_stream_borrow_from_private(
+ struct bt_private_stream *priv_stream);
+
+extern struct bt_private_stream *bt_private_stream_create(
+ struct bt_private_stream_class *stream_class);
+
+extern struct bt_private_stream *bt_private_stream_create_with_id(
+ struct bt_private_stream_class *stream_class, uint64_t id);
+
+extern struct bt_private_stream_class *bt_private_stream_borrow_private_class(
+ struct bt_private_stream *stream);
+
+extern int bt_private_stream_set_name(struct bt_private_stream *stream,
+ const char *name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_STREAM_H */
--- /dev/null
+#ifndef BABELTRACE_TRACE_IR_PRIVATE_TRACE_H
+#define BABELTRACE_TRACE_IR_PRIVATE_TRACE_H
+
+/*
+ * Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * The Common Trace Format (CTF) Specification is available at
+ * http://www.efficios.com/ctf
+ */
+
+/* For bt_bool, bt_uuid */
+#include <babeltrace/types.h>
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_trace;
+struct bt_private_trace;
+struct bt_private_stream;
+struct bt_private_stream_class;
+struct bt_private_field_class;
+struct bt_private_value;
+struct bt_private_packet_header_field;
+
+typedef void (* bt_private_trace_is_static_listener)(
+ struct bt_private_trace *trace, void *data);
+
+typedef void (* bt_private_trace_listener_removed)(
+ struct bt_private_trace *trace, void *data);
+
+extern struct bt_trace *bt_trace_borrow_from_private(
+ struct bt_private_trace *priv_trace);
+
+extern struct bt_private_trace *bt_private_trace_create(void);
+
+extern int bt_private_trace_set_assigns_automatic_stream_class_id(
+ struct bt_private_trace *trace, bt_bool value);
+
+extern int bt_private_trace_set_name(struct bt_private_trace *trace,
+ const char *name);
+
+extern int bt_private_trace_set_uuid(struct bt_private_trace *trace,
+ bt_uuid uuid);
+
+extern void bt_private_trace_borrow_private_environment_entry_by_index(
+ struct bt_private_trace *trace, uint64_t index,
+ const char **name, struct bt_private_value **value);
+
+extern struct bt_private_value *
+bt_private_trace_borrow_private_environment_entry_value_by_name(
+ struct bt_private_trace *trace, const char *name);
+
+extern int bt_private_trace_set_private_environment_entry_integer(
+ struct bt_private_trace *trace, const char *name,
+ int64_t value);
+
+extern int bt_private_trace_set_private_environment_entry_string(
+ struct bt_private_trace *trace, const char *name,
+ const char *value);
+
+extern struct bt_private_field_class *
+bt_private_trace_borrow_packet_header_private_field_class(
+ struct bt_private_trace *trace);
+
+extern int bt_private_trace_set_packet_header_private_field_class(
+ struct bt_private_trace *trace,
+ struct bt_private_field_class *packet_header_field_class);
+
+extern struct bt_private_stream_class *
+bt_private_trace_borrow_private_stream_class_by_index(
+ struct bt_private_trace *trace, uint64_t index);
+
+extern struct bt_private_stream_class *
+bt_private_trace_borrow_private_stream_class_by_id(
+ struct bt_private_trace *trace, uint64_t id);
+
+extern struct bt_private_stream *
+bt_private_trace_borrow_private_stream_by_index(
+ struct bt_private_trace *trace, uint64_t index);
+
+extern struct bt_private_stream *bt_private_trace_borrow_stream_by_id(
+ struct bt_private_trace *trace, uint64_t id);
+
+extern int bt_private_trace_make_static(struct bt_private_trace *trace);
+
+extern int bt_private_trace_add_is_static_listener(
+ struct bt_private_trace *trace,
+ bt_private_trace_is_static_listener listener,
+ bt_private_trace_listener_removed listener_removed, void *data,
+ uint64_t *listener_id);
+
+extern int bt_private_trace_remove_is_static_listener(
+ struct bt_private_trace *trace, uint64_t listener_id);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TRACE_IR_PRIVATE_TRACE_H */
#define BABELTRACE_TRACE_IR_STREAM_CLASS_H
/*
- * BabelTrace - Trace IR: Stream Class
- *
* Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
struct bt_event_header_field;
struct bt_packet_context_field;
-extern struct bt_stream_class *bt_stream_class_create(struct bt_trace *trace);
-
-extern struct bt_stream_class *bt_stream_class_create_with_id(
- struct bt_trace *trace, uint64_t id);
-
extern struct bt_trace *bt_stream_class_borrow_trace(
struct bt_stream_class *stream_class);
extern const char *bt_stream_class_get_name(
struct bt_stream_class *stream_class);
-extern int bt_stream_class_set_name(struct bt_stream_class *stream_class,
- const char *name);
-
extern bt_bool bt_stream_class_assigns_automatic_event_class_id(
struct bt_stream_class *stream_class);
-extern int bt_stream_class_set_assigns_automatic_event_class_id(
- struct bt_stream_class *stream_class, bt_bool value);
-
extern bt_bool bt_stream_class_assigns_automatic_stream_id(
struct bt_stream_class *stream_class);
-extern int bt_stream_class_set_assigns_automatic_stream_id(
- struct bt_stream_class *stream_class, bt_bool value);
-
extern uint64_t bt_stream_class_get_id(struct bt_stream_class *stream_class);
extern struct bt_field_class *bt_stream_class_borrow_packet_context_field_class(
struct bt_stream_class *stream_class);
-extern int bt_stream_class_set_packet_context_field_class(
- struct bt_stream_class *stream_class,
- struct bt_field_class *field_class);
-
extern struct bt_field_class *
bt_stream_class_borrow_event_header_field_class(
struct bt_stream_class *stream_class);
-extern int bt_stream_class_set_event_header_field_class(
- struct bt_stream_class *stream_class,
- struct bt_field_class *field_class);
-
extern struct bt_field_class *
bt_stream_class_borrow_event_common_context_field_class(
struct bt_stream_class *stream_class);
-extern int bt_stream_class_set_event_common_context_field_class(
- struct bt_stream_class *stream_class,
- struct bt_field_class *field_class);
-
extern uint64_t bt_stream_class_get_event_class_count(
struct bt_stream_class *stream_class);
extern struct bt_event_class *bt_stream_class_borrow_event_class_by_id(
struct bt_stream_class *stream_class, uint64_t id);
-extern int bt_stream_class_set_default_clock_class(
- struct bt_stream_class *stream_class,
- struct bt_clock_class *clock_class);
-
extern struct bt_clock_class *bt_stream_class_borrow_default_clock_class(
struct bt_stream_class *stream_class);
extern bt_bool bt_stream_class_packets_have_discarded_event_counter_snapshot(
struct bt_stream_class *stream_class);
-extern int bt_stream_class_set_packets_have_discarded_event_counter_snapshot(
- struct bt_stream_class *stream_class, bt_bool value);
-
extern bt_bool bt_stream_class_packets_have_packet_counter_snapshot(
struct bt_stream_class *stream_class);
-extern int bt_stream_class_set_packets_have_packet_counter_snapshot(
- struct bt_stream_class *stream_class, bt_bool value);
-
extern bt_bool bt_stream_class_packets_have_default_beginning_clock_value(
struct bt_stream_class *stream_class);
-extern int bt_stream_class_set_packets_have_default_beginning_clock_value(
- struct bt_stream_class *stream_class, bt_bool value);
-
extern bt_bool bt_stream_class_packets_have_default_end_clock_value(
struct bt_stream_class *stream_class);
-extern int bt_stream_class_set_packets_have_default_end_clock_value(
- struct bt_stream_class *stream_class, bt_bool value);
-
#ifdef __cplusplus
}
#endif
#define BABELTRACE_TRACE_IR_STREAM_H
/*
- * BabelTrace - Trace IR: Stream
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
* http://www.efficios.com/ctf
*/
-/* For enum bt_property_availability */
-#include <babeltrace/property.h>
-
#include <stdint.h>
#ifdef __cplusplus
struct bt_stream;
struct bt_stream_class;
-extern struct bt_stream *bt_stream_create(struct bt_stream_class *stream_class);
-
-extern struct bt_stream *bt_stream_create_with_id(
- struct bt_stream_class *stream_class, uint64_t id);
-
extern struct bt_stream_class *bt_stream_borrow_class(struct bt_stream *stream);
extern const char *bt_stream_get_name(struct bt_stream *stream);
-extern int bt_stream_set_name(struct bt_stream *stream, const char *name);
-
extern uint64_t bt_stream_get_id(struct bt_stream *stream);
#ifdef __cplusplus
#define BABELTRACE_TRACE_IR_TRACE_H
/*
- * BabelTrace - Trace IR: Trace
- *
* Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
struct bt_stream_class;
struct bt_field_class;
struct bt_value;
-struct bt_packet_header_field;
-
-typedef void (* bt_trace_is_static_listener)(
- struct bt_trace *trace, void *data);
-
-typedef void (* bt_trace_listener_removed)(
- struct bt_trace *trace, void *data);
-
-extern struct bt_trace *bt_trace_create(void);
extern bt_bool bt_trace_assigns_automatic_stream_class_id(
struct bt_trace *trace);
-extern int bt_trace_set_assigns_automatic_stream_class_id(
- struct bt_trace *trace, bt_bool value);
-
extern const char *bt_trace_get_name(struct bt_trace *trace);
-extern int bt_trace_set_name(struct bt_trace *trace, const char *name);
-
extern bt_uuid bt_trace_get_uuid(struct bt_trace *trace);
-extern int bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid);
-
extern uint64_t bt_trace_get_environment_entry_count(struct bt_trace *trace);
extern void bt_trace_borrow_environment_entry_by_index(
extern struct bt_value *bt_trace_borrow_environment_entry_value_by_name(
struct bt_trace *trace, const char *name);
-extern int bt_trace_set_environment_entry_integer(
- struct bt_trace *trace, const char *name,
- int64_t value);
-
-extern int bt_trace_set_environment_entry_string(
- struct bt_trace *trace, const char *name,
- const char *value);
-
extern struct bt_field_class *bt_trace_borrow_packet_header_field_class(
struct bt_trace *trace);
-extern int bt_trace_set_packet_header_field_class(struct bt_trace *trace,
- struct bt_field_class *packet_header_field_class);
-
extern uint64_t bt_trace_get_stream_class_count(struct bt_trace *trace);
extern struct bt_stream_class *bt_trace_borrow_stream_class_by_index(
extern bt_bool bt_trace_is_static(struct bt_trace *trace);
-extern int bt_trace_make_static(struct bt_trace *trace);
-
-extern int bt_trace_add_is_static_listener(
- struct bt_trace *trace,
- bt_trace_is_static_listener listener,
- bt_trace_listener_removed listener_removed, void *data,
- uint64_t *listener_id);
-
-extern int bt_trace_remove_is_static_listener(
- struct bt_trace *trace, uint64_t listener_id);
-
#ifdef __cplusplus
}
#endif
/*
- * component.c
- *
- * Babeltrace Plugin Component
- *
* Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
/*
* Notify the graph's creator that a new port was added.
*/
- graph = bt_component_get_graph(component);
+ graph = bt_object_get_ref(bt_component_borrow_graph(component));
if (graph) {
bt_graph_notify_port_added(graph, new_port);
BT_OBJECT_PUT_REF_AND_RESET(graph);
graph ? &graph->base : NULL);
}
-struct bt_graph *bt_component_borrow_graph(struct bt_component *component)
+bt_bool bt_component_graph_is_canceled(struct bt_component *component)
{
- return (struct bt_graph *) bt_object_borrow_parent(&component->base);
+ return bt_graph_is_canceled(
+ (void *) bt_object_borrow_parent(&component->base));
}
static
/*
* Notify the graph's creator that a port is removed.
*/
- graph = bt_component_get_graph(component);
+ graph = bt_object_get_ref(bt_component_borrow_graph(component));
if (graph) {
bt_graph_notify_port_removed(graph, component, port);
BT_OBJECT_PUT_REF_AND_RESET(graph);
#include <babeltrace/graph/connection.h>
#include <babeltrace/graph/connection-internal.h>
#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-internal.h>
#include <babeltrace/graph/component-source-internal.h>
#include <babeltrace/graph/component-class-internal.h>
#include <babeltrace/graph/component-class-sink-colander-internal.h>
output_port_comp = bt_port_get_component(output_port);
BT_ASSERT_PRE(output_port_comp,
"Output port has no component: %!+p", output_port);
- graph = bt_component_get_graph(output_port_comp);
+ graph = bt_object_get_ref(bt_component_borrow_graph(output_port_comp));
BT_ASSERT(graph);
/* Create notification iterator */
/*
- * Babeltrace Plug-in Event Notification
- *
* Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
#include <babeltrace/trace-ir/stream-class-internal.h>
#include <babeltrace/trace-ir/trace.h>
#include <babeltrace/graph/graph-internal.h>
+#include <babeltrace/graph/private-notification-event.h>
#include <babeltrace/graph/notification-event-internal.h>
#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/types.h>
#include <babeltrace/assert-internal.h>
#include <babeltrace/assert-pre-internal.h>
+#include <babeltrace/object.h>
#include <stdbool.h>
#include <inttypes.h>
return (void *) notification;
}
-struct bt_notification *bt_notification_event_create(
+struct bt_private_notification *bt_private_notification_event_create(
struct bt_private_connection_private_notification_iterator *notif_iter,
- struct bt_event_class *event_class,
- struct bt_packet *packet)
+ struct bt_private_event_class *priv_event_class,
+ struct bt_private_packet *priv_packet)
{
+ struct bt_event_class *event_class = (void *) priv_event_class;
+ struct bt_packet *packet = (void *) priv_packet;
struct bt_notification_event *notification = NULL;
struct bt_event *event;
struct bt_graph *graph;
struct bt_notification_event, parent);
return event_notification->event;
}
+
+struct bt_private_event *bt_private_notification_event_borrow_private_event(
+ struct bt_private_notification *notification)
+{
+ return (void *) bt_notification_event_borrow_event(
+ (void *) notification);
+}
#include <babeltrace/trace-ir/clock-class.h>
#include <babeltrace/trace-ir/clock-value-internal.h>
#include <babeltrace/graph/notification-internal.h>
+#include <babeltrace/graph/private-notification-inactivity.h>
#include <babeltrace/graph/notification-inactivity-internal.h>
#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/assert-pre-internal.h>
+#include <babeltrace/object.h>
static
void bt_notification_inactivity_destroy(struct bt_object *obj)
g_free(notification);
}
-struct bt_notification *bt_notification_inactivity_create(
+struct bt_private_notification *bt_private_notification_inactivity_create(
struct bt_private_connection_private_notification_iterator *notif_iter,
struct bt_clock_class *default_clock_class)
{
BT_OBJECT_PUT_REF_AND_RESET(ret_notif);
end:
- return ret_notif;
+ return (void *) ret_notif;
}
-int bt_notification_inactivity_set_default_clock_value(
- struct bt_notification *notif, uint64_t value_cycles)
+int bt_private_notification_inactivity_set_default_clock_value(
+ struct bt_private_notification *priv_notif,
+ uint64_t value_cycles)
{
+ struct bt_notification *notif = (void *) priv_notif;
struct bt_notification_inactivity *inactivity = (void *) notif;
BT_ASSERT_PRE_NON_NULL(notif, "Notification");
#define BT_LOG_TAG "NOTIF"
#include <babeltrace/lib-logging-internal.h>
+#include <babeltrace/graph/private-notification.h>
#include <babeltrace/graph/notification-internal.h>
#include <babeltrace/graph/graph-internal.h>
#include <babeltrace/assert-internal.h>
BT_ASSERT(notif);
notif->graph = NULL;
}
+
+struct bt_notification *bt_notification_borrow_from_private(
+ struct bt_private_notification *priv_notif)
+{
+ return (void *) priv_notif;
+}
/*
- * Babeltrace Plug-in Packet-related Notifications
- *
* Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
#include <babeltrace/trace-ir/stream.h>
#include <babeltrace/trace-ir/stream-internal.h>
#include <babeltrace/graph/graph-internal.h>
+#include <babeltrace/graph/private-notification-packet.h>
#include <babeltrace/graph/notification-packet-internal.h>
#include <babeltrace/graph/private-connection-private-notification-iterator.h>
+#include <babeltrace/object.h>
#include <babeltrace/assert-internal.h>
#include <babeltrace/assert-pre-internal.h>
#include <babeltrace/object-internal.h>
return (void *) notification;
}
-struct bt_notification *bt_notification_packet_begin_create(
+struct bt_private_notification *bt_private_notification_packet_begin_create(
struct bt_private_connection_private_notification_iterator *notif_iter,
- struct bt_packet *packet)
+ struct bt_private_packet *priv_packet)
{
+ struct bt_packet *packet = (void *) priv_packet;
struct bt_notification_packet_begin *notification = NULL;
struct bt_stream *stream;
struct bt_stream_class *stream_class;
return packet_begin->packet;
}
+struct bt_private_packet *
+bt_private_notification_packet_begin_borrow_private_packet(
+ struct bt_private_notification *notification)
+{
+ return (void *) bt_notification_packet_begin_borrow_packet(
+ (void *) notification);
+}
+
BT_HIDDEN
struct bt_notification *bt_notification_packet_end_new(struct bt_graph *graph)
{
return (void *) notification;
}
-struct bt_notification *bt_notification_packet_end_create(
+struct bt_private_notification *bt_private_notification_packet_end_create(
struct bt_private_connection_private_notification_iterator *notif_iter,
- struct bt_packet *packet)
+ struct bt_private_packet *priv_packet)
{
+ struct bt_packet *packet = (void *) priv_packet;
struct bt_notification_packet_end *notification = NULL;
struct bt_stream *stream;
struct bt_stream_class *stream_class;
struct bt_notification_packet_end, parent);
return packet_end->packet;
}
+
+struct bt_private_packet *bt_private_notification_packet_end_borrow_packet(
+ struct bt_private_notification *notification)
+{
+ return (void *) bt_notification_packet_end_borrow_packet(
+ (void *) notification);
+}
/*
- * Babeltrace Plug-in Stream-related Notifications
- *
* Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
#include <babeltrace/trace-ir/stream-internal.h>
#include <babeltrace/trace-ir/stream-class.h>
#include <babeltrace/trace-ir/stream-class-internal.h>
+#include <babeltrace/graph/private-notification-stream.h>
#include <babeltrace/graph/notification-stream-internal.h>
#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/assert-internal.h>
+#include <babeltrace/object.h>
#include <inttypes.h>
static
g_free(notification);
}
-struct bt_notification *bt_notification_stream_end_create(
+struct bt_private_notification *bt_private_notification_stream_end_create(
struct bt_private_connection_private_notification_iterator *notif_iter,
- struct bt_stream *stream)
+ struct bt_private_stream *priv_stream)
{
+ struct bt_stream *stream = (void *) priv_stream;
struct bt_notification_stream_end *notification;
struct bt_stream_class *stream_class;
stream_class,
bt_stream_class_get_name(stream_class),
bt_stream_class_get_id(stream_class), notification);
- return ¬ification->parent;
+
+ return (void *) ¬ification->parent;
error:
return NULL;
}
return stream_end->stream;
}
-int bt_notification_stream_end_set_default_clock_value(
- struct bt_notification *notif, uint64_t value_cycles)
+struct bt_private_stream *bt_private_notification_stream_end_borrow_stream(
+ struct bt_private_notification *notification)
+{
+ return (void *) bt_notification_stream_end_borrow_stream(
+ (void *) notification);
+}
+
+int bt_private_notification_stream_end_set_default_clock_value(
+ struct bt_private_notification *priv_notif,
+ uint64_t value_cycles)
{
int ret = 0;
+ struct bt_notification *notif = (void *) priv_notif;
struct bt_notification_stream_end *se_notif = (void *) notif;
BT_ASSERT_PRE_NON_NULL(notif, "Notification");
g_free(notification);
}
-struct bt_notification *bt_notification_stream_begin_create(
+struct bt_private_notification *bt_private_notification_stream_begin_create(
struct bt_private_connection_private_notification_iterator *notif_iter,
- struct bt_stream *stream)
+ struct bt_private_stream *priv_stream)
{
+ struct bt_stream *stream = (void *) priv_stream;
struct bt_notification_stream_begin *notification;
struct bt_stream_class *stream_class;
stream_class,
bt_stream_class_get_name(stream_class),
bt_stream_class_get_id(stream_class), notification);
- return ¬ification->parent;
+ return (void *) ¬ification->parent;
error:
return NULL;
}
return stream_begin->stream;
}
-int bt_notification_stream_begin_set_default_clock_value(
- struct bt_notification *notif, uint64_t value_cycles)
+struct bt_private_stream *bt_private_notification_stream_begin_borrow_stream(
+ struct bt_private_notification *notification)
+{
+ return (void *) bt_notification_stream_begin_borrow_stream(
+ (void *) notification);
+}
+
+int bt_private_notification_stream_begin_set_default_clock_value(
+ struct bt_private_notification *priv_notif,
+ uint64_t value_cycles)
{
int ret = 0;
+ struct bt_notification *notif = (void *) priv_notif;
struct bt_notification_stream_begin *sb_notif = (void *) notif;
BT_ASSERT_PRE_NON_NULL(notif, "Notification");
/*
- * clock-class.c
- *
- * Babeltrace trace IR - Clock class
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
return;
}
-struct bt_clock_class *bt_clock_class_create(void)
+struct bt_private_clock_class *bt_private_clock_class_create(void)
{
int ret;
struct bt_clock_class *clock_class = NULL;
BT_OBJECT_PUT_REF_AND_RESET(clock_class);
end:
- return clock_class;
+ return (void *) clock_class;
}
const char *bt_clock_class_get_name(
return clock_class->name.value;
}
-int bt_clock_class_set_name(struct bt_clock_class *clock_class,
+int bt_private_clock_class_set_name(
+ struct bt_private_clock_class *priv_clock_class,
const char *name)
{
+ struct bt_clock_class *clock_class = (void *) priv_clock_class;
+
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
return clock_class->description.value;
}
-int bt_clock_class_set_description(struct bt_clock_class *clock_class,
+int bt_private_clock_class_set_description(
+ struct bt_private_clock_class *priv_clock_class,
const char *descr)
{
+ struct bt_clock_class *clock_class = (void *) priv_clock_class;
+
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_NON_NULL(descr, "Description");
BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
return clock_class->frequency;
}
-int bt_clock_class_set_frequency(struct bt_clock_class *clock_class,
+int bt_private_clock_class_set_frequency(
+ struct bt_private_clock_class *priv_clock_class,
uint64_t frequency)
{
+ struct bt_clock_class *clock_class = (void *) priv_clock_class;
+
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE(frequency != UINT64_C(-1) && frequency != 0,
return clock_class->precision;
}
-int bt_clock_class_set_precision(struct bt_clock_class *clock_class,
+int bt_private_clock_class_set_precision(
+ struct bt_private_clock_class *priv_clock_class,
uint64_t precision)
{
+ struct bt_clock_class *clock_class = (void *) priv_clock_class;
+
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE(precision != UINT64_C(-1),
*cycles = clock_class->offset_cycles;
}
-int bt_clock_class_set_offset(struct bt_clock_class *clock_class,
+int bt_private_clock_class_set_offset(
+ struct bt_private_clock_class *priv_clock_class,
int64_t seconds, uint64_t cycles)
{
+ struct bt_clock_class *clock_class = (void *) priv_clock_class;
+
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE(cycles < clock_class->frequency,
return (bool) clock_class->is_absolute;
}
-int bt_clock_class_set_is_absolute(struct bt_clock_class *clock_class,
+int bt_private_clock_class_set_is_absolute(
+ struct bt_private_clock_class *priv_clock_class,
bt_bool is_absolute)
{
+ struct bt_clock_class *clock_class = (void *) priv_clock_class;
+
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
clock_class->is_absolute = (bool) is_absolute;
return clock_class->uuid.value;
}
-int bt_clock_class_set_uuid(struct bt_clock_class *clock_class,
+int bt_private_clock_class_set_uuid(
+ struct bt_private_clock_class *priv_clock_class,
bt_uuid uuid)
{
+ struct bt_clock_class *clock_class = (void *) priv_clock_class;
+
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_NON_NULL(uuid, "UUID");
BT_ASSERT_PRE_CLOCK_CLASS_HOT(clock_class);
return ret;
}
+
+struct bt_clock_class *bt_clock_class_borrow_from_private(
+ struct bt_private_clock_class *priv_clock_class)
+{
+ return (void *) priv_clock_class;
+}
/*
- * event-class.c
- *
- * Babeltrace trace IR - Event class
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
#include <babeltrace/trace-ir/fields-internal.h>
#include <babeltrace/trace-ir/field-classes.h>
#include <babeltrace/trace-ir/field-classes-internal.h>
+#include <babeltrace/trace-ir/private-event-class.h>
#include <babeltrace/trace-ir/event-class.h>
#include <babeltrace/trace-ir/event-class-internal.h>
#include <babeltrace/trace-ir/event-internal.h>
+#include <babeltrace/trace-ir/private-stream-class.h>
#include <babeltrace/trace-ir/stream-class.h>
#include <babeltrace/trace-ir/stream-class-internal.h>
#include <babeltrace/trace-ir/trace-internal.h>
#include <stdlib.h>
#define BT_ASSERT_PRE_EVENT_CLASS_HOT(_ec) \
- BT_ASSERT_PRE_HOT((_ec), "Event class", ": %!+E", (_ec))
+ BT_ASSERT_PRE_HOT(((struct bt_event_class *) (_ec)), \
+ "Event class", ": %!+E", (_ec))
static
void destroy_event_class(struct bt_object *obj)
return event_class;
}
-struct bt_event_class *bt_event_class_create(
- struct bt_stream_class *stream_class)
+struct bt_private_event_class *bt_private_event_class_create(
+ struct bt_private_stream_class *priv_stream_class)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE(stream_class->assigns_automatic_event_class_id,
"Stream class does not automatically assigns event class IDs: "
"%![sc-]+S", stream_class);
- return create_event_class_with_id(stream_class,
+ return (void *) create_event_class_with_id((void *) stream_class,
(uint64_t) stream_class->event_classes->len);
}
-struct bt_event_class *bt_event_class_create_with_id(
- struct bt_stream_class *stream_class, uint64_t id)
+struct bt_private_event_class *bt_private_event_class_create_with_id(
+ struct bt_private_stream_class *priv_stream_class, uint64_t id)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+
BT_ASSERT_PRE(!stream_class->assigns_automatic_event_class_id,
"Stream class automatically assigns event class IDs: "
"%![sc-]+S", stream_class);
- return create_event_class_with_id(stream_class, id);
+ return (void *) create_event_class_with_id((void *) stream_class, id);
}
const char *bt_event_class_get_name(struct bt_event_class *event_class)
return event_class->name.value;
}
-int bt_event_class_set_name(struct bt_event_class *event_class,
+int bt_private_event_class_set_name(struct bt_private_event_class *priv_event_class,
const char *name)
{
+ struct bt_event_class *event_class = (void *) priv_event_class;
+
BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
return event_class->log_level.base.avail;
}
-int bt_event_class_set_log_level(struct bt_event_class *event_class,
+int bt_private_event_class_set_log_level(
+ struct bt_private_event_class *priv_event_class,
enum bt_event_class_log_level log_level)
{
+ struct bt_event_class *event_class = (void *) priv_event_class;
+
BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
bt_property_uint_set(&event_class->log_level,
return event_class->emf_uri.value;
}
-int bt_event_class_set_emf_uri(struct bt_event_class *event_class,
+int bt_private_event_class_set_emf_uri(
+ struct bt_private_event_class *priv_event_class,
const char *emf_uri)
{
+ struct bt_event_class *event_class = (void *) priv_event_class;
+
BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
BT_ASSERT_PRE_NON_NULL(emf_uri, "EMF URI");
BT_ASSERT_PRE_EVENT_CLASS_HOT(event_class);
return bt_event_class_borrow_stream_class_inline(event_class);
}
+struct bt_private_stream_class *
+bt_private_event_class_borrow_private_stream_class(
+ struct bt_private_event_class *event_class)
+{
+ return (void *) bt_event_class_borrow_stream_class(
+ (void *) event_class);
+}
+
struct bt_field_class *bt_event_class_borrow_specific_context_field_class(
struct bt_event_class *event_class)
{
return event_class->specific_context_fc;
}
-int bt_event_class_set_specific_context_field_class(
- struct bt_event_class *event_class,
- struct bt_field_class *field_class)
+struct bt_private_field_class *
+bt_private_event_class_borrow_specific_context_private_field_class(
+ struct bt_private_event_class *event_class)
+{
+ return (void *) bt_event_class_borrow_specific_context_field_class(
+ (void *) event_class);
+}
+
+int bt_private_event_class_set_specific_context_private_field_class(
+ struct bt_private_event_class *priv_event_class,
+ struct bt_private_field_class *priv_field_class)
{
int ret;
+ struct bt_event_class *event_class = (void *) priv_event_class;
+ struct bt_field_class *field_class = (void *) priv_field_class;
struct bt_stream_class *stream_class;
struct bt_trace *trace;
struct bt_resolve_field_path_context resolve_ctx = {
return event_class->payload_fc;
}
-int bt_event_class_set_payload_field_class(struct bt_event_class *event_class,
- struct bt_field_class *field_class)
+struct bt_private_field_class *bt_private_event_class_borrow_payload_private_field_class(
+ struct bt_private_event_class *event_class)
+{
+ return (void *) bt_event_class_borrow_payload_field_class(
+ (void *) event_class);
+}
+
+int bt_private_event_class_set_payload_private_field_class(
+ struct bt_private_event_class *priv_event_class,
+ struct bt_private_field_class *priv_field_class)
{
int ret;
+ struct bt_event_class *event_class = (void *) priv_event_class;
+ struct bt_field_class *field_class = (void *) priv_field_class;
struct bt_stream_class *stream_class;
struct bt_trace *trace;
struct bt_resolve_field_path_context resolve_ctx = {
BT_LIB_LOGD("Freezing event class: %!+E", event_class);
event_class->frozen = true;
}
+
+struct bt_event_class *bt_event_class_borrow_from_private(
+ struct bt_private_event_class *priv_event_class)
+{
+ return (void *) priv_event_class;
+}
#include <babeltrace/lib-logging-internal.h>
#include <babeltrace/assert-pre-internal.h>
-#include <babeltrace/trace-ir/event-header-field.h>
+#include <babeltrace/trace-ir/private-event-header-field.h>
#include <babeltrace/trace-ir/stream-class-internal.h>
#include <babeltrace/trace-ir/fields-internal.h>
#include <babeltrace/trace-ir/field-wrapper-internal.h>
#include <glib.h>
-struct bt_field *bt_event_header_field_borrow_field(
- struct bt_event_header_field *header_field)
+struct bt_private_field *bt_private_event_header_field_borrow_private_field(
+ struct bt_private_event_header_field *header_field)
{
struct bt_field_wrapper *field_wrapper = (void *) header_field;
return (void *) field_wrapper->field;
}
-void bt_event_header_field_release(struct bt_event_header_field *header_field)
+void bt_private_event_header_field_release(
+ struct bt_private_event_header_field *header_field)
{
struct bt_field_wrapper *field_wrapper = (void *) header_field;
bt_field_wrapper_destroy(field_wrapper);
}
-struct bt_event_header_field *bt_event_header_field_create(
- struct bt_stream_class *stream_class)
+struct bt_private_event_header_field *bt_private_event_header_field_create(
+ struct bt_private_stream_class *priv_stream_class)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
struct bt_field_wrapper *field_wrapper;
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
/*
- * event.c
- *
- * Babeltrace trace IR - Event
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
#include <babeltrace/trace-ir/clock-value.h>
#include <babeltrace/trace-ir/clock-value-internal.h>
#include <babeltrace/trace-ir/clock-class-internal.h>
+#include <babeltrace/trace-ir/private-event.h>
#include <babeltrace/trace-ir/event-internal.h>
#include <babeltrace/trace-ir/event-class.h>
#include <babeltrace/trace-ir/event-class-internal.h>
return event->header_field ? event->header_field->field : NULL;
}
+struct bt_private_field *bt_private_event_borrow_header_private_field(
+ struct bt_private_event *event)
+{
+ return (void *) bt_event_borrow_header_field((void *) event);
+}
+
struct bt_field *bt_event_borrow_common_context_field(struct bt_event *event)
{
BT_ASSERT_PRE_NON_NULL(event, "Event");
return event->common_context_field;
}
+struct bt_private_field *bt_private_event_borrow_common_context_private_field(
+ struct bt_private_event *event)
+{
+ return (void *) bt_event_borrow_common_context_field((void *) event);
+}
+
struct bt_field *bt_event_borrow_specific_context_field(struct bt_event *event)
{
BT_ASSERT_PRE_NON_NULL(event, "Event");
return event->specific_context_field;
}
+struct bt_private_field *bt_private_event_borrow_specific_context_private_field(
+ struct bt_private_event *event)
+{
+ return (void *) bt_event_borrow_specific_context_field((void *) event);
+}
+
struct bt_field *bt_event_borrow_payload_field(struct bt_event *event)
{
BT_ASSERT_PRE_NON_NULL(event, "Event");
return event->payload_field;
}
+struct bt_private_field *bt_private_event_borrow_payload_private_field(
+ struct bt_private_event *event)
+{
+ return (void *) bt_event_borrow_payload_field((void *) event);
+}
+
static
void release_event_header_field(struct bt_field_wrapper *field_wrapper,
struct bt_event *event)
g_free(event);
}
-int bt_event_set_default_clock_value(struct bt_event *event,
- uint64_t value_cycles)
+int bt_private_event_set_default_clock_value(
+ struct bt_private_event *priv_event, uint64_t value_cycles)
{
+ struct bt_event *event = (void *) priv_event;
struct bt_stream_class *sc;
BT_ASSERT_PRE_NON_NULL(event, "Event");
return event->packet;
}
-int bt_event_move_header(struct bt_event *event,
- struct bt_event_header_field *header_field)
+struct bt_private_packet *bt_private_event_borrow_packet(
+ struct bt_private_event *event)
+{
+ return (void *) bt_event_borrow_packet((void *) event);
+}
+
+int bt_private_event_move_private_header_field(
+ struct bt_private_event *priv_event,
+ struct bt_private_event_header_field *priv_header_field)
{
struct bt_stream_class *stream_class;
- struct bt_field_wrapper *field_wrapper = (void *) header_field;
+ struct bt_event *event = (void *) priv_event;
+ struct bt_event_class *event_class = (void *) event_class;
+ struct bt_field_wrapper *field_wrapper = (void *) priv_header_field;
BT_ASSERT_PRE_NON_NULL(event, "Event");
BT_ASSERT_PRE_NON_NULL(field_wrapper, "Header field");
event->header_field = field_wrapper;
return 0;
}
+
+struct bt_event *bt_event_borrow_from_private(
+ struct bt_private_event *priv_event)
+{
+ return (void *) priv_event;
+}
/*
- * field-classes.c
- *
- * Babeltrace trace IR - Event Types
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
#include <babeltrace/lib-logging-internal.h>
#include <babeltrace/assert-pre-internal.h>
+#include <babeltrace/trace-ir/private-field-classes.h>
#include <babeltrace/trace-ir/field-classes-internal.h>
#include <babeltrace/trace-ir/field-path-internal.h>
#include <babeltrace/trace-ir/fields-internal.h>
+#include <babeltrace/trace-ir/private-fields.h>
#include <babeltrace/trace-ir/fields.h>
#include <babeltrace/trace-ir/utils-internal.h>
#include <babeltrace/object.h>
void destroy_integer_field_class(struct bt_object *obj)
{
BT_ASSERT(obj);
- BT_LIB_LOGD("Destroying integer field classe object: %!+F", obj);
+ BT_LIB_LOGD("Destroying integer field class object: %!+F", obj);
g_free(obj);
}
{
struct bt_field_class_integer *int_fc = NULL;
- BT_LOGD("Creating default integer field classe object: type=%s",
+ BT_LOGD("Creating default integer field class object: type=%s",
bt_common_field_class_type_string(type));
int_fc = g_new0(struct bt_field_class_integer, 1);
if (!int_fc) {
- BT_LOGE_STR("Failed to allocate one integer field classe.");
+ BT_LOGE_STR("Failed to allocate one integer field class.");
goto error;
}
init_integer_field_class(int_fc, type, destroy_integer_field_class);
- BT_LIB_LOGD("Created integer field classe object: %!+F", int_fc);
+ BT_LIB_LOGD("Created integer field class object: %!+F", int_fc);
goto end;
error:
return (void *) int_fc;
}
-struct bt_field_class *bt_field_class_unsigned_integer_create(void)
+struct bt_private_field_class *
+bt_private_field_class_unsigned_integer_create(void)
{
- return create_integer_field_class(BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER);
+ return (void *) create_integer_field_class(
+ BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER);
}
-struct bt_field_class *bt_field_class_signed_integer_create(void)
+struct bt_private_field_class *bt_private_field_class_signed_integer_create(void)
{
- return create_integer_field_class(BT_FIELD_CLASS_TYPE_SIGNED_INTEGER);
+ return (void *) create_integer_field_class(
+ BT_FIELD_CLASS_TYPE_SIGNED_INTEGER);
}
uint64_t bt_field_class_integer_get_field_value_range(
return true;
}
-int bt_field_class_integer_set_field_value_range(
- struct bt_field_class *fc, uint64_t size)
+int bt_private_field_class_integer_set_field_value_range(
+ struct bt_private_field_class *priv_fc, uint64_t size)
{
+ struct bt_field_class *fc = (void *) priv_fc;
struct bt_field_class_integer *int_fc = (void *) fc;
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
BT_ASSERT_PRE_FC_HOT(fc, "Field class");
BT_ASSERT_PRE(size <= 64,
- "Unsupported size for integer field classe's field value range "
+ "Unsupported size for integer field class's field value range "
"(maximum is 64): size=%" PRIu64, size);
BT_ASSERT_PRE(
int_fc->common.type == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER ||
int_fc->common.type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER ||
size_is_valid_for_enumeration_field_class(fc, size),
- "Invalid field value range for enumeration field classe: "
+ "Invalid field value range for enumeration field class: "
"at least one of the current mapping ranges contains values "
"which are outside this range: %!+F, size=%" PRIu64, fc, size);
int_fc->range = size;
- BT_LIB_LOGV("Set integer field classe's field value range: %!+F", fc);
+ BT_LIB_LOGV("Set integer field class's field value range: %!+F", fc);
return 0;
}
return int_fc->base;
}
-int bt_field_class_integer_set_preferred_display_base(struct bt_field_class *fc,
+int bt_private_field_class_integer_set_preferred_display_base(
+ struct bt_private_field_class *priv_fc,
enum bt_field_class_integer_preferred_display_base base)
{
+ struct bt_field_class *fc = (void *) priv_fc;
struct bt_field_class_integer *int_fc = (void *) fc;
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_FC_IS_INT(fc, "Field class");
BT_ASSERT_PRE_FC_HOT(fc, "Field class");
int_fc->base = base;
- BT_LIB_LOGV("Set integer field classe's preferred display base: %!+F", fc);
+ BT_LIB_LOGV("Set integer field class's preferred display base: %!+F", fc);
return 0;
}
struct bt_field_class_enumeration *fc = (void *) obj;
BT_ASSERT(fc);
- BT_LIB_LOGD("Destroying enumeration field classe object: %!+F", fc);
+ BT_LIB_LOGD("Destroying enumeration field class object: %!+F", fc);
if (fc->mappings) {
uint64_t i;
{
struct bt_field_class_enumeration *enum_fc = NULL;
- BT_LOGD("Creating default enumeration field classe object: type=%s",
+ BT_LOGD("Creating default enumeration field class object: type=%s",
bt_common_field_class_type_string(type));
enum_fc = g_new0(struct bt_field_class_enumeration, 1);
if (!enum_fc) {
- BT_LOGE_STR("Failed to allocate one enumeration field classe.");
+ BT_LOGE_STR("Failed to allocate one enumeration field class.");
goto error;
}
goto error;
}
- BT_LIB_LOGD("Created enumeration field classe object: %!+F", enum_fc);
+ BT_LIB_LOGD("Created enumeration field class object: %!+F", enum_fc);
goto end;
error:
return (void *) enum_fc;
}
-struct bt_field_class *bt_field_class_unsigned_enumeration_create(void)
+struct bt_private_field_class *
+bt_private_field_class_unsigned_enumeration_create(void)
{
- return create_enumeration_field_class(
+ return (void *) create_enumeration_field_class(
BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION);
}
-struct bt_field_class *bt_field_class_signed_enumeration_create(void)
+struct bt_private_field_class *
+bt_private_field_class_signed_enumeration_create(void)
{
- return create_enumeration_field_class(
+ return (void *) create_enumeration_field_class(
BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION);
}
mapping->ranges->len - 1);
range->lower.u = lower;
range->upper.u = upper;
- BT_LIB_LOGV("Added mapping to enumeration field classe: "
+ BT_LIB_LOGV("Added mapping to enumeration field class: "
"%![fc-]+F, label=\"%s\", lower-unsigned=%" PRIu64 ", "
"upper-unsigned=%" PRIu64, fc, label, lower, upper);
return ret;
}
-int bt_field_class_unsigned_enumeration_map_range(
- struct bt_field_class *fc, const char *label,
+int bt_private_field_class_unsigned_enumeration_map_range(
+ struct bt_private_field_class *priv_fc, const char *label,
uint64_t range_lower, uint64_t range_upper)
{
+ struct bt_field_class *fc = (void *) priv_fc;
struct bt_field_class_enumeration *enum_fc = (void *) fc;
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
range_lower, range_upper);
BT_ASSERT_PRE(bt_util_value_is_in_range_unsigned(enum_fc->common.range,
range_lower),
- "Range's lower bound is outside the enumeration field classe's value range: "
+ "Range's lower bound is outside the enumeration field class's value range: "
"%![fc-]+F, lower=%" PRIu64, fc, range_lower);
BT_ASSERT_PRE(bt_util_value_is_in_range_unsigned(enum_fc->common.range,
range_upper),
- "Range's upper bound is outside the enumeration field classe's value range: "
+ "Range's upper bound is outside the enumeration field class's value range: "
"%![fc-]+F, upper=%" PRIu64, fc, range_upper);
return add_mapping_to_enumeration_field_class(fc, label, range_lower,
range_upper);
}
-int bt_field_class_signed_enumeration_map_range(
- struct bt_field_class *fc, const char *label,
+int bt_private_field_class_signed_enumeration_map_range(
+ struct bt_private_field_class *priv_fc, const char *label,
int64_t range_lower, int64_t range_upper)
{
+ struct bt_field_class *fc = (void *) priv_fc;
struct bt_field_class_enumeration *enum_fc = (void *) fc;
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
range_lower, range_upper);
BT_ASSERT_PRE(bt_util_value_is_in_range_signed(enum_fc->common.range,
range_lower),
- "Range's lower bound is outside the enumeration field classe's value range: "
+ "Range's lower bound is outside the enumeration field class's value range: "
"%![fc-]+F, lower=%" PRId64, fc, range_lower);
BT_ASSERT_PRE(bt_util_value_is_in_range_signed(enum_fc->common.range,
range_upper),
- "Range's upper bound is outside the enumeration field classe's value range: "
+ "Range's upper bound is outside the enumeration field class's value range: "
"%![fc-]+F, upper=%" PRId64, fc, range_upper);
return add_mapping_to_enumeration_field_class(fc, label, range_lower,
range_upper);
void destroy_real_field_class(struct bt_object *obj)
{
BT_ASSERT(obj);
- BT_LIB_LOGD("Destroying real field classe object: %!+F", obj);
+ BT_LIB_LOGD("Destroying real field class object: %!+F", obj);
g_free(obj);
}
-struct bt_field_class *bt_field_class_real_create(void)
+struct bt_private_field_class *bt_private_field_class_real_create(void)
{
struct bt_field_class_real *real_fc = NULL;
- BT_LOGD_STR("Creating default real field classe object.");
+ BT_LOGD_STR("Creating default real field class object.");
real_fc = g_new0(struct bt_field_class_real, 1);
if (!real_fc) {
- BT_LOGE_STR("Failed to allocate one real field classe.");
+ BT_LOGE_STR("Failed to allocate one real field class.");
goto error;
}
init_field_class((void *) real_fc, BT_FIELD_CLASS_TYPE_REAL,
destroy_real_field_class);
- BT_LIB_LOGD("Created real field classe object: %!+F", real_fc);
+ BT_LIB_LOGD("Created real field class object: %!+F", real_fc);
goto end;
error:
return real_fc->is_single_precision;
}
-int bt_field_class_real_set_is_single_precision(struct bt_field_class *fc,
+int bt_private_field_class_real_set_is_single_precision(
+ struct bt_private_field_class *priv_fc,
bt_bool is_single_precision)
{
+ struct bt_field_class *fc = (void *) priv_fc;
struct bt_field_class_real *real_fc = (void *) fc;
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_REAL, "Field class");
BT_ASSERT_PRE_FC_HOT(fc, "Field class");
real_fc->is_single_precision = (bool) is_single_precision;
- BT_LIB_LOGV("Set real field classe's \"is single precision\" property: "
+ BT_LIB_LOGV("Set real field class's \"is single precision\" property: "
"%!+F", fc);
return 0;
}
void finalize_named_field_class(struct bt_named_field_class *named_fc)
{
BT_ASSERT(named_fc);
- BT_LIB_LOGD("Finalizing named field classe: "
+ BT_LIB_LOGD("Finalizing named field class: "
"addr=%p, name=\"%s\", %![fc-]+F",
named_fc, named_fc->name ? named_fc->name->str : NULL,
named_fc->fc);
g_string_free(named_fc->name, TRUE);
}
- BT_LOGD_STR("Putting named field classe's field classe.");
+ BT_LOGD_STR("Putting named field class's field class.");
bt_object_put_ref(named_fc->fc);
}
void destroy_structure_field_class(struct bt_object *obj)
{
BT_ASSERT(obj);
- BT_LIB_LOGD("Destroying string field classe object: %!+F", obj);
+ BT_LIB_LOGD("Destroying string field class object: %!+F", obj);
finalize_named_field_classes_container((void *) obj);
g_free(obj);
}
-struct bt_field_class *bt_field_class_structure_create(void)
+struct bt_private_field_class *bt_private_field_class_structure_create(void)
{
int ret;
struct bt_field_class_structure *struct_fc = NULL;
- BT_LOGD_STR("Creating default structure field classe object.");
+ BT_LOGD_STR("Creating default structure field class object.");
struct_fc = g_new0(struct bt_field_class_structure, 1);
if (!struct_fc) {
- BT_LOGE_STR("Failed to allocate one structure field classe.");
+ BT_LOGE_STR("Failed to allocate one structure field class.");
goto error;
}
goto error;
}
- BT_LIB_LOGD("Created structure field classe object: %!+F", struct_fc);
+ BT_LIB_LOGD("Created structure field class object: %!+F", struct_fc);
goto end;
error:
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE(!bt_g_hash_table_contains(container_fc->name_to_index,
name),
- "Duplicate member/option name in structure/variant field classe: "
+ "Duplicate member/option name in structure/variant field class: "
"%![container-fc-]+F, name=\"%s\"", container_fc, name);
name_str = g_string_new(name);
if (!name_str) {
return ret;
}
-int bt_field_class_structure_append_member(struct bt_field_class *fc,
- const char *name, struct bt_field_class *member_fc)
+int bt_private_field_class_structure_append_private_member(
+ struct bt_private_field_class *priv_fc,
+ const char *name, struct bt_private_field_class *member_fc)
{
+ struct bt_field_class *fc = (void *) priv_fc;
+
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE, "Field class");
return append_named_field_class_to_container_field_class((void *) fc,
- name, member_fc);
+ name, (void *) member_fc);
}
uint64_t bt_field_class_structure_get_member_count(struct bt_field_class *fc)
index, name, out_fc);
}
+void bt_private_field_class_structure_borrow_private_member_by_index(
+ struct bt_private_field_class *fc, uint64_t index,
+ const char **name, struct bt_private_field_class **out_fc)
+{
+ bt_field_class_structure_borrow_member_by_index((void *) fc,
+ index, name, (void *) out_fc);
+}
+
static
struct bt_field_class *borrow_field_class_from_container_field_class_by_name(
struct bt_field_class_named_field_class_container *fc,
name);
}
+struct bt_private_field_class *
+bt_private_field_class_structure_borrow_member_private_field_class_by_name(
+ struct bt_private_field_class *fc, const char *name)
+{
+ return (void *) bt_field_class_structure_borrow_member_field_class_by_name(
+ (void *) fc, name);
+}
+
static
void destroy_variant_field_class(struct bt_object *obj)
{
struct bt_field_class_variant *fc = (void *) obj;
BT_ASSERT(fc);
- BT_LIB_LOGD("Destroying variant field classe object: %!+F", fc);
+ BT_LIB_LOGD("Destroying variant field class object: %!+F", fc);
finalize_named_field_classes_container((void *) fc);
BT_LOGD_STR("Putting selector field path.");
bt_object_put_ref(fc->selector_field_path);
g_free(fc);
}
-struct bt_field_class *bt_field_class_variant_create(void)
+struct bt_private_field_class *bt_private_field_class_variant_create(void)
{
int ret;
struct bt_field_class_variant *var_fc = NULL;
- BT_LOGD_STR("Creating default variant field classe object.");
+ BT_LOGD_STR("Creating default variant field class object.");
var_fc = g_new0(struct bt_field_class_variant, 1);
if (!var_fc) {
- BT_LOGE_STR("Failed to allocate one variant field classe.");
+ BT_LOGE_STR("Failed to allocate one variant field class.");
goto error;
}
goto error;
}
- BT_LIB_LOGD("Created variant field classe object: %!+F", var_fc);
+ BT_LIB_LOGD("Created variant field class object: %!+F", var_fc);
goto end;
error:
return (void *) var_fc;
}
-int bt_field_class_variant_set_selector_field_class(
- struct bt_field_class *fc, struct bt_field_class *selector_fc)
+int bt_private_field_class_variant_set_selector_private_field_class(
+ struct bt_private_field_class *priv_fc,
+ struct bt_private_field_class *selector_fc)
{
+ struct bt_field_class *fc = (void *) priv_fc;
struct bt_field_class_variant *var_fc = (void *) fc;
- BT_ASSERT_PRE_NON_NULL(fc, "Variant field classe");
- BT_ASSERT_PRE_NON_NULL(selector_fc, "Selector field classe");
+ BT_ASSERT_PRE_NON_NULL(fc, "Variant field class");
+ BT_ASSERT_PRE_NON_NULL(selector_fc, "Selector field class");
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
- BT_ASSERT_PRE_FC_IS_ENUM(selector_fc, "Selector field classe");
- BT_ASSERT_PRE_FC_HOT(fc, "Variant field classe");
- var_fc->selector_fc = selector_fc;
- bt_field_class_freeze(selector_fc);
+ BT_ASSERT_PRE_FC_IS_ENUM(selector_fc, "Selector field class");
+ BT_ASSERT_PRE_FC_HOT(fc, "Variant field class");
+ var_fc->selector_fc = (void *) selector_fc;
+ bt_field_class_freeze((void *) selector_fc);
return 0;
}
-int bt_field_class_variant_append_option(struct bt_field_class *fc,
- const char *name, struct bt_field_class *option_fc)
+int bt_private_field_class_variant_append_private_option(
+ struct bt_private_field_class *priv_fc,
+ const char *name, struct bt_private_field_class *option_fc)
{
+ struct bt_field_class *fc = (void *) priv_fc;
+
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_VARIANT, "Field class");
return append_named_field_class_to_container_field_class((void *) fc,
- name, option_fc);
+ name, (void *) option_fc);
}
struct bt_field_class *bt_field_class_variant_borrow_option_field_class_by_name(
name);
}
+struct bt_private_field_class *
+bt_private_field_class_variant_borrow_option_private_field_class_by_name(
+ struct bt_private_field_class *fc, const char *name)
+{
+ return (void *) bt_field_class_variant_borrow_option_field_class_by_name(
+ (void *) fc, name);
+}
+
uint64_t bt_field_class_variant_get_option_count(struct bt_field_class *fc)
{
struct bt_field_class_variant *var_fc = (void *) fc;
index, name, out_fc);
}
+void bt_private_field_class_variant_borrow_private_option_by_index(
+ struct bt_private_field_class *fc, uint64_t index,
+ const char **name, struct bt_private_field_class **out_fc)
+{
+ bt_field_class_variant_borrow_option_by_index((void *) fc,
+ index, name, (void *) out_fc);
+}
+
struct bt_field_path *bt_field_class_variant_borrow_selector_field_path(
struct bt_field_class *fc)
{
void finalize_array_field_class(struct bt_field_class_array *array_fc)
{
BT_ASSERT(array_fc);
- BT_LOGD_STR("Putting element field classe.");
+ BT_LOGD_STR("Putting element field class.");
bt_object_put_ref(array_fc->element_fc);
}
void destroy_static_array_field_class(struct bt_object *obj)
{
BT_ASSERT(obj);
- BT_LIB_LOGD("Destroying static array field classe object: %!+F", obj);
+ BT_LIB_LOGD("Destroying static array field class object: %!+F", obj);
finalize_array_field_class((void *) obj);
g_free(obj);
}
-struct bt_field_class *bt_field_class_static_array_create(
- struct bt_field_class *element_fc, uint64_t length)
+struct bt_private_field_class *
+bt_private_field_class_static_array_create(
+ struct bt_private_field_class *priv_element_fc,
+ uint64_t length)
{
+ struct bt_field_class *element_fc = (void *) priv_element_fc;
struct bt_field_class_static_array *array_fc = NULL;
- BT_ASSERT_PRE_NON_NULL(element_fc, "Element field classe");
- BT_LOGD_STR("Creating default static array field classe object.");
+ BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class");
+ BT_LOGD_STR("Creating default static array field class object.");
array_fc = g_new0(struct bt_field_class_static_array, 1);
if (!array_fc) {
- BT_LOGE_STR("Failed to allocate one static array field classe.");
+ BT_LOGE_STR("Failed to allocate one static array field class.");
goto error;
}
init_array_field_class((void *) array_fc, BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
destroy_static_array_field_class, element_fc);
array_fc->length = length;
- BT_LIB_LOGD("Created static array field classe object: %!+F", array_fc);
+ BT_LIB_LOGD("Created static array field class object: %!+F", array_fc);
goto end;
error:
return array_fc->element_fc;
}
+struct bt_private_field_class *
+bt_private_field_class_array_borrow_element_field_class(
+ struct bt_private_field_class *fc)
+{
+ return (void *) bt_field_class_array_borrow_element_field_class(
+ (void *) fc);
+}
+
uint64_t bt_field_class_static_array_get_length(struct bt_field_class *fc)
{
struct bt_field_class_static_array *array_fc = (void *) fc;
struct bt_field_class_dynamic_array *fc = (void *) obj;
BT_ASSERT(fc);
- BT_LIB_LOGD("Destroying dynamic array field classe object: %!+F", fc);
+ BT_LIB_LOGD("Destroying dynamic array field class object: %!+F", fc);
finalize_array_field_class((void *) fc);
BT_LOGD_STR("Putting length field path.");
bt_object_put_ref(fc->length_field_path);
g_free(fc);
}
-struct bt_field_class *bt_field_class_dynamic_array_create(
- struct bt_field_class *element_fc)
+struct bt_private_field_class *bt_private_field_class_dynamic_array_create(
+ struct bt_private_field_class *priv_element_fc)
{
+ struct bt_field_class *element_fc = (void *) priv_element_fc;
struct bt_field_class_dynamic_array *array_fc = NULL;
- BT_ASSERT_PRE_NON_NULL(element_fc, "Element field classe");
- BT_LOGD_STR("Creating default dynamic array field classe object.");
+ BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class");
+ BT_LOGD_STR("Creating default dynamic array field class object.");
array_fc = g_new0(struct bt_field_class_dynamic_array, 1);
if (!array_fc) {
- BT_LOGE_STR("Failed to allocate one dynamic array field classe.");
+ BT_LOGE_STR("Failed to allocate one dynamic array field class.");
goto error;
}
init_array_field_class((void *) array_fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
destroy_dynamic_array_field_class, element_fc);
- BT_LIB_LOGD("Created dynamic array field classe object: %!+F", array_fc);
+ BT_LIB_LOGD("Created dynamic array field class object: %!+F", array_fc);
goto end;
error:
return (void *) array_fc;
}
-int bt_field_class_dynamic_array_set_length_field_class(struct bt_field_class *fc,
- struct bt_field_class *length_fc)
+int bt_private_field_class_dynamic_array_set_length_private_field_class(
+ struct bt_private_field_class *priv_fc,
+ struct bt_private_field_class *priv_length_fc)
{
+ struct bt_field_class *fc = (void *) priv_fc;
+ struct bt_field_class *length_fc = (void *) priv_length_fc;
struct bt_field_class_dynamic_array *array_fc = (void *) fc;
- BT_ASSERT_PRE_NON_NULL(fc, "Dynamic array field classe");
- BT_ASSERT_PRE_NON_NULL(length_fc, "Length field classe");
+ BT_ASSERT_PRE_NON_NULL(fc, "Dynamic array field class");
+ BT_ASSERT_PRE_NON_NULL(length_fc, "Length field class");
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
"Field class");
- BT_ASSERT_PRE_FC_IS_UNSIGNED_INT(length_fc, "Length field classe");
- BT_ASSERT_PRE_FC_HOT(fc, "Dynamic array field classe");
+ BT_ASSERT_PRE_FC_IS_UNSIGNED_INT(length_fc, "Length field class");
+ BT_ASSERT_PRE_FC_HOT(fc, "Dynamic array field class");
array_fc->length_fc = length_fc;
bt_field_class_freeze(length_fc);
return 0;
void destroy_string_field_class(struct bt_object *obj)
{
BT_ASSERT(obj);
- BT_LIB_LOGD("Destroying string field classe object: %!+F", obj);
+ BT_LIB_LOGD("Destroying string field class object: %!+F", obj);
g_free(obj);
}
-struct bt_field_class *bt_field_class_string_create(void)
+struct bt_private_field_class *bt_private_field_class_string_create(void)
{
struct bt_field_class_string *string_fc = NULL;
- BT_LOGD_STR("Creating default string field classe object.");
+ BT_LOGD_STR("Creating default string field class object.");
string_fc = g_new0(struct bt_field_class_string, 1);
if (!string_fc) {
- BT_LOGE_STR("Failed to allocate one string field classe.");
+ BT_LOGE_STR("Failed to allocate one string field class.");
goto error;
}
init_field_class((void *) string_fc, BT_FIELD_CLASS_TYPE_STRING,
destroy_string_field_class);
- BT_LIB_LOGD("Created string field classe object: %!+F", string_fc);
+ BT_LIB_LOGD("Created string field class object: %!+F", string_fc);
goto end;
error:
break;
}
}
+
+struct bt_field_class *bt_field_class_borrow_from_private(
+ struct bt_private_field_class *priv_field_class)
+{
+ return (void *) priv_field_class;
+}
#include <babeltrace/trace-ir/field-classes-internal.h>
#include <babeltrace/trace-ir/field-path-internal.h>
#include <babeltrace/trace-ir/field-path.h>
+#include <babeltrace/object.h>
#include <limits.h>
#include <stdint.h>
#include <inttypes.h>
/*
- * fields.c
- *
- * Babeltrace trace IR - Event Fields
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
#include <babeltrace/lib-logging-internal.h>
#include <babeltrace/assert-pre-internal.h>
+#include <babeltrace/trace-ir/private-fields.h>
#include <babeltrace/trace-ir/fields.h>
#include <babeltrace/trace-ir/fields-internal.h>
#include <babeltrace/trace-ir/field-classes-internal.h>
return field->class;
}
+struct bt_private_field_class *bt_private_field_borrow_private_class(
+ struct bt_private_field *field)
+{
+ return (void *) bt_field_borrow_class((void *) field);
+}
+
enum bt_field_class_type bt_field_get_class_type(struct bt_field *field)
{
BT_ASSERT_PRE_NON_NULL(field, "Field");
return int_field->value.i;
}
-void bt_field_signed_integer_set_value(struct bt_field *field, int64_t value)
+void bt_private_field_signed_integer_set_value(
+ struct bt_private_field *priv_field, int64_t value)
{
+ struct bt_field *field = (void *) priv_field;
struct bt_field_integer *int_field = (void *) field;
BT_ASSERT_PRE_NON_NULL(field, "Field");
return int_field->value.u;
}
-void bt_field_unsigned_integer_set_value(struct bt_field *field,
- uint64_t value)
+void bt_private_field_unsigned_integer_set_value(
+ struct bt_private_field *priv_field, uint64_t value)
{
+ struct bt_field *field = (void *) priv_field;
struct bt_field_integer *int_field = (void *) field;
BT_ASSERT_PRE_NON_NULL(field, "Field");
return real_field->value;
}
-void bt_field_real_set_value(struct bt_field *field, double value)
+void bt_private_field_real_set_value(struct bt_private_field *priv_field,
+ double value)
{
+ struct bt_field *field = (void *) priv_field;
struct bt_field_real *real_field = (void *) field;
BT_ASSERT_PRE_NON_NULL(field, "Field");
return string_field->length;
}
-int bt_field_string_set_value(struct bt_field *field, const char *value)
+int bt_private_field_string_set_value(struct bt_private_field *priv_field,
+ const char *value)
{
+ struct bt_field *field = (void *) priv_field;
+
BT_ASSERT_PRE_NON_NULL(field, "Field");
BT_ASSERT_PRE_NON_NULL(value, "Value");
BT_ASSERT_PRE_FIELD_HOT(field, "Field");
BT_ASSERT_PRE_FIELD_HAS_CLASS_TYPE(field, BT_FIELD_CLASS_TYPE_STRING,
"Field");
- bt_field_string_clear(field);
- return bt_field_string_append_with_length(field, value,
+ bt_private_field_string_clear(priv_field);
+ return bt_private_field_string_append_with_length(priv_field, value,
(uint64_t) strlen(value));
}
-int bt_field_string_append(struct bt_field *field, const char *value)
+int bt_private_field_string_append(struct bt_private_field *field,
+ const char *value)
{
- return bt_field_string_append_with_length(field, value,
- (uint64_t) strlen(value));
+ return bt_private_field_string_append_with_length(field,
+ value, (uint64_t) strlen(value));
}
-int bt_field_string_append_with_length(struct bt_field *field,
+int bt_private_field_string_append_with_length(
+ struct bt_private_field *priv_field,
const char *value, uint64_t length)
{
+ struct bt_field *field = (void *) priv_field;
struct bt_field_string *string_field = (void *) field;
char *data;
uint64_t new_length;
return 0;
}
-int bt_field_string_clear(struct bt_field *field)
+int bt_private_field_string_clear(struct bt_private_field *priv_field)
{
+ struct bt_field *field = (void *) priv_field;
struct bt_field_string *string_field = (void *) field;
BT_ASSERT_PRE_NON_NULL(field, "Field");
return array_field->length;
}
-int bt_field_dynamic_array_set_length(struct bt_field *field,
- uint64_t length)
+int bt_private_field_dynamic_array_set_length(
+ struct bt_private_field *priv_field, uint64_t length)
{
int ret = 0;
+ struct bt_field *field = (void *) priv_field;
struct bt_field_array *array_field = (void *) field;
BT_ASSERT_PRE_NON_NULL(field, "Field");
return array_field->fields->pdata[index];
}
+struct bt_private_field *
+bt_private_field_array_borrow_element_private_field_by_index(
+ struct bt_private_field *field, uint64_t index)
+{
+ return (void *) bt_field_array_borrow_element_field_by_index(
+ (void *) field, index);
+}
+
struct bt_field *bt_field_structure_borrow_member_field_by_index(
struct bt_field *field, uint64_t index)
{
return struct_field->fields->pdata[index];
}
+struct bt_private_field *
+bt_private_field_structure_borrow_member_private_field_by_index(
+ struct bt_private_field *field, uint64_t index)
+{
+ return (void *) bt_field_structure_borrow_member_field_by_index(
+ (void *) field, index);
+}
+
struct bt_field *bt_field_structure_borrow_member_field_by_name(
struct bt_field *field, const char *name)
{
return ret_field;
}
+struct bt_private_field *
+bt_private_field_structure_borrow_member_private_field_by_name(
+ struct bt_private_field *field, const char *name)
+{
+ return (void *) bt_field_structure_borrow_member_field_by_name(
+ (void *) field, name);
+}
+
struct bt_field *bt_field_variant_borrow_selected_option_field(
struct bt_field *field)
{
return var_field->selected_field;
}
-int bt_field_variant_select_option_field(struct bt_field *field,
- uint64_t index)
+struct bt_private_field *
+bt_private_field_variant_borrow_selected_option_private_field(
+ struct bt_private_field *field)
{
+ return (void *) bt_field_variant_borrow_selected_option_field(
+ (void *) field);
+}
+
+int bt_private_field_variant_select_option_private_field(
+ struct bt_private_field *priv_field, uint64_t index)
+{
+ struct bt_field *field = (void *) priv_field;
struct bt_field_variant *var_field = (void *) field;
BT_ASSERT_PRE_NON_NULL(field, "Field");
end:
return is_set;
}
+
+struct bt_field *bt_field_borrow_from_private(
+ struct bt_private_field *priv_field)
+{
+ return (void *) priv_field;
+}
#include <babeltrace/assert-pre-internal.h>
#include <babeltrace/trace-ir/stream-class-internal.h>
-#include <babeltrace/trace-ir/packet-context-field.h>
+#include <babeltrace/trace-ir/private-packet-context-field.h>
#include <babeltrace/trace-ir/fields-internal.h>
#include <babeltrace/trace-ir/field-wrapper-internal.h>
#include <glib.h>
-struct bt_field *bt_packet_context_field_borrow_field(
- struct bt_packet_context_field *context_field)
+struct bt_private_field *bt_private_packet_context_field_borrow_private_field(
+ struct bt_private_packet_context_field *context_field)
{
struct bt_field_wrapper *field_wrapper = (void *) context_field;
BT_ASSERT_PRE_NON_NULL(field_wrapper, "Packet context field");
- return field_wrapper->field;
+ return (void *) field_wrapper->field;
}
-void bt_packet_context_field_release(struct bt_packet_context_field *context_field)
+void bt_private_packet_context_field_release(
+ struct bt_private_packet_context_field *context_field)
{
struct bt_field_wrapper *field_wrapper = (void *) context_field;
bt_field_wrapper_destroy(field_wrapper);
}
-struct bt_packet_context_field *bt_packet_context_field_create(
- struct bt_stream_class *stream_class)
+struct bt_private_packet_context_field *bt_private_packet_context_field_create(
+ struct bt_private_stream_class *priv_stream_class)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
struct bt_field_wrapper *field_wrapper;
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
#include <babeltrace/assert-pre-internal.h>
#include <babeltrace/trace-ir/trace-internal.h>
-#include <babeltrace/trace-ir/packet-header-field.h>
+#include <babeltrace/trace-ir/private-packet-header-field.h>
#include <babeltrace/trace-ir/field-wrapper-internal.h>
#include <babeltrace/trace-ir/fields-internal.h>
#include <glib.h>
-struct bt_field *bt_packet_header_field_borrow_field(
- struct bt_packet_header_field *header_field)
+struct bt_private_field *bt_private_packet_header_field_borrow_private_field(
+ struct bt_private_packet_header_field *header_field)
{
struct bt_field_wrapper *field_wrapper = (void *) header_field;
return (void *) field_wrapper->field;
}
-void bt_packet_header_field_release(struct bt_packet_header_field *header_field)
+void bt_private_packet_header_field_release(
+ struct bt_private_packet_header_field *header_field)
{
struct bt_field_wrapper *field_wrapper = (void *) header_field;
bt_field_wrapper_destroy(field_wrapper);
}
-struct bt_packet_header_field *bt_packet_header_field_create(
- struct bt_trace *trace)
+struct bt_private_packet_header_field *bt_private_packet_header_field_create(
+ struct bt_private_trace *priv_trace)
{
struct bt_field_wrapper *field_wrapper;
+ struct bt_trace *trace = (void *) priv_trace;
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE(trace->packet_header_fc,
/*
- * packet.c
- *
- * Babeltrace trace IR - Stream packet
- *
* Copyright 2016 Philippe Proulx <pproulx@efficios.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
#include <babeltrace/assert-pre-internal.h>
#include <babeltrace/trace-ir/fields-internal.h>
+#include <babeltrace/trace-ir/private-packet.h>
#include <babeltrace/trace-ir/packet.h>
#include <babeltrace/trace-ir/packet-internal.h>
#include <babeltrace/trace-ir/field-wrapper-internal.h>
return packet->stream;
}
+struct bt_private_stream *bt_private_packet_borrow_private_stream(
+ struct bt_private_packet *packet)
+{
+ return (void *) bt_packet_borrow_stream((void *) packet);
+}
+
struct bt_field *bt_packet_borrow_header_field(struct bt_packet *packet)
{
BT_ASSERT_PRE_NON_NULL(packet, "Packet");
return packet->header_field ? packet->header_field->field : NULL;
}
+struct bt_private_field *bt_private_packet_borrow_header_private_field(
+ struct bt_private_packet *packet)
+{
+ return (void *) bt_packet_borrow_header_field((void *) packet);
+}
+
struct bt_field *bt_packet_borrow_context_field(struct bt_packet *packet)
{
BT_ASSERT_PRE_NON_NULL(packet, "Packet");
return packet->context_field ? packet->context_field->field : NULL;
}
+struct bt_private_field *bt_private_packet_borrow_context_private_field(
+ struct bt_private_packet *packet)
+{
+ return (void *) bt_packet_borrow_context_field((void *) packet);
+}
+
BT_HIDDEN
void _bt_packet_set_is_frozen(struct bt_packet *packet, bool is_frozen)
{
return packet;
}
-struct bt_packet *bt_packet_create(struct bt_stream *stream)
+struct bt_private_packet *bt_private_packet_create(
+ struct bt_private_stream *priv_stream)
{
+ struct bt_stream *stream = (void *) priv_stream;
struct bt_packet *packet = NULL;
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
}
end:
- return packet;
+ return (void *) packet;
}
-int bt_packet_move_header_field(struct bt_packet *packet,
- struct bt_packet_header_field *header_field)
+int bt_private_packet_move_private_header_field(
+ struct bt_private_packet *priv_packet,
+ struct bt_private_packet_header_field *header_field)
{
+ struct bt_packet *packet = (void *) priv_packet;
struct bt_trace *trace;
struct bt_field_wrapper *field_wrapper = (void *) header_field;
return 0;
}
-int bt_packet_move_context_field(struct bt_packet *packet,
- struct bt_packet_context_field *context_field)
+int bt_private_packet_move_private_context_field(
+ struct bt_private_packet *priv_packet,
+ struct bt_private_packet_context_field *context_field)
{
+ struct bt_packet *packet = (void *) priv_packet;
struct bt_stream_class *stream_class;
struct bt_field_wrapper *field_wrapper = (void *) context_field;
return 0;
}
-int bt_packet_set_default_beginning_clock_value(struct bt_packet *packet,
+int bt_private_packet_set_default_beginning_clock_value(
+ struct bt_private_packet *priv_packet,
uint64_t value_cycles)
{
+ struct bt_packet *packet = (void *) priv_packet;
struct bt_stream_class *sc;
BT_ASSERT_PRE_NON_NULL(packet, "Packet");
BT_ASSERT(packet->default_beginning_cv);
bt_clock_value_set_value_inline(packet->default_beginning_cv, value_cycles);
BT_LIB_LOGV("Set packet's default beginning clock value: "
- "%![packet-]+a, value=%" PRIu64, value_cycles);
+ "%![packet-]+a, value=%" PRIu64, packet, value_cycles);
return 0;
}
return BT_CLOCK_VALUE_STATUS_KNOWN;
}
-int bt_packet_set_default_end_clock_value(struct bt_packet *packet,
+int bt_private_packet_set_default_end_clock_value(
+ struct bt_private_packet *priv_packet,
uint64_t value_cycles)
{
+ struct bt_packet *packet = (void *) priv_packet;
struct bt_stream_class *sc;
BT_ASSERT_PRE_NON_NULL(packet, "Packet");
BT_ASSERT(packet->default_end_cv);
bt_clock_value_set_value_inline(packet->default_end_cv, value_cycles);
BT_LIB_LOGV("Set packet's default end clock value: "
- "%![packet-]+a, value=%" PRIu64, value_cycles);
+ "%![packet-]+a, value=%" PRIu64, packet, value_cycles);
return 0;
}
return packet->discarded_event_counter_snapshot.base.avail;
}
-int bt_packet_set_discarded_event_counter_snapshot(struct bt_packet *packet,
- uint64_t value)
+int bt_private_packet_set_discarded_event_counter_snapshot(
+ struct bt_private_packet *priv_packet, uint64_t value)
{
+ struct bt_packet *packet = (void *) priv_packet;
+
BT_ASSERT_PRE_NON_NULL(packet, "Packet");
BT_ASSERT_PRE_PACKET_HOT(packet);
BT_ASSERT_PRE(packet->stream->class->packets_have_discarded_event_counter_snapshot,
return packet->packet_counter_snapshot.base.avail;
}
-int bt_packet_set_packet_counter_snapshot(struct bt_packet *packet,
- uint64_t value)
+int bt_private_packet_set_packet_counter_snapshot(
+ struct bt_private_packet *priv_packet, uint64_t value)
{
+ struct bt_packet *packet = (void *) priv_packet;
+
BT_ASSERT_PRE_NON_NULL(packet, "Packet");
BT_ASSERT_PRE_PACKET_HOT(packet);
BT_ASSERT_PRE(packet->stream->class->packets_have_packet_counter_snapshot,
bt_property_uint_set(&packet->packet_counter_snapshot, value);
return 0;
}
+
+struct bt_packet *bt_packet_borrow_from_private(
+ struct bt_private_packet *priv_packet)
+{
+ return (void *) priv_packet;
+}
#include <babeltrace/assert-pre-internal.h>
#include <babeltrace/assert-internal.h>
+#include <babeltrace/object.h>
#include <babeltrace/trace-ir/field-classes-internal.h>
#include <babeltrace/trace-ir/field-path-internal.h>
#include <babeltrace/trace-ir/field-path.h>
/*
- * stream-class.c
- *
- * Babeltrace trace IR - Stream Class
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
#include <babeltrace/trace-ir/field-classes-internal.h>
#include <babeltrace/trace-ir/fields-internal.h>
#include <babeltrace/trace-ir/stream-class-internal.h>
+#include <babeltrace/trace-ir/private-trace.h>
+#include <babeltrace/trace-ir/trace-internal.h>
#include <babeltrace/trace-ir/utils-internal.h>
#include <babeltrace/trace-ir/field-wrapper-internal.h>
#include <babeltrace/trace-ir/resolve-field-path-internal.h>
return stream_class;
}
-struct bt_stream_class *bt_stream_class_create(struct bt_trace *trace)
+struct bt_private_stream_class *bt_private_stream_class_create(
+ struct bt_private_trace *priv_trace)
{
+ struct bt_trace *trace = (void *) priv_trace;
+
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE(trace->assigns_automatic_stream_class_id,
"Trace does not automatically assigns stream class IDs: "
"%![sc-]+t", trace);
- return create_stream_class_with_id(trace,
+ return (void *) create_stream_class_with_id(trace,
(uint64_t) trace->stream_classes->len);
}
-struct bt_stream_class *bt_stream_class_create_with_id(
- struct bt_trace *trace, uint64_t id)
+struct bt_private_stream_class *bt_private_stream_class_create_with_id(
+ struct bt_private_trace *priv_trace, uint64_t id)
{
+ struct bt_trace *trace = (void *) priv_trace;
+
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE(!trace->assigns_automatic_stream_class_id,
"Trace automatically assigns stream class IDs: "
"%![sc-]+t", trace);
- return create_stream_class_with_id(trace, id);
+ return (void *) create_stream_class_with_id(trace, id);
}
struct bt_trace *bt_stream_class_borrow_trace(struct bt_stream_class *stream_class)
return bt_stream_class_borrow_trace_inline(stream_class);
}
+struct bt_private_trace *bt_private_stream_class_borrow_trace(
+ struct bt_private_stream_class *stream_class)
+{
+ return (void *) bt_stream_class_borrow_trace((void *) stream_class);
+}
+
const char *bt_stream_class_get_name(struct bt_stream_class *stream_class)
{
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
return stream_class->name.value;
}
-int bt_stream_class_set_name(struct bt_stream_class *stream_class,
+int bt_private_stream_class_set_name(
+ struct bt_private_stream_class *priv_stream_class,
const char *name)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
return g_ptr_array_index(stream_class->event_classes, index);
}
+struct bt_private_event_class *
+bt_private_stream_class_borrow_private_event_class_by_index(
+ struct bt_private_stream_class *stream_class, uint64_t index)
+{
+ return (void *) bt_stream_class_borrow_event_class_by_index(
+ (void *) stream_class, index);
+}
+
struct bt_event_class *bt_stream_class_borrow_event_class_by_id(
- struct bt_stream_class *trace, uint64_t id)
+ struct bt_stream_class *stream_class, uint64_t id)
{
struct bt_event_class *event_class = NULL;
uint64_t i;
- BT_ASSERT_PRE_NON_NULL(trace, "Trace");
+ BT_ASSERT_PRE_NON_NULL(stream_class, "Trace");
- for (i = 0; i < trace->event_classes->len; i++) {
+ for (i = 0; i < stream_class->event_classes->len; i++) {
struct bt_event_class *event_class_candidate =
- g_ptr_array_index(trace->event_classes, i);
+ g_ptr_array_index(stream_class->event_classes, i);
if (event_class_candidate->id == id) {
event_class = event_class_candidate;
return event_class;
}
+struct bt_private_event_class *
+bt_private_stream_class_borrow_private_event_class_by_id(
+ struct bt_private_stream_class *stream_class, uint64_t id)
+{
+ return (void *) bt_stream_class_borrow_event_class_by_id(
+ (void *) stream_class, id);
+}
+
struct bt_field_class *bt_stream_class_borrow_packet_context_field_class(
struct bt_stream_class *stream_class)
{
return stream_class->packet_context_fc;
}
-int bt_stream_class_set_packet_context_field_class(
- struct bt_stream_class *stream_class,
- struct bt_field_class *field_class)
+struct bt_private_field_class *
+bt_private_stream_class_borrow_packet_context_private_field_class(
+ struct bt_private_stream_class *stream_class)
+{
+ return (void *) bt_stream_class_borrow_packet_context_field_class(
+ (void *) stream_class);
+}
+
+int bt_private_stream_class_set_packet_context_private_field_class(
+ struct bt_private_stream_class *priv_stream_class,
+ struct bt_private_field_class *priv_field_class)
{
int ret;
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+ struct bt_field_class *field_class = (void *) priv_field_class;
struct bt_resolve_field_path_context resolve_ctx = {
.packet_header = NULL,
.packet_context = field_class,
return stream_class->event_header_fc;
}
-int bt_stream_class_set_event_header_field_class(
- struct bt_stream_class *stream_class,
- struct bt_field_class *field_class)
+struct bt_private_field_class *
+bt_private_stream_class_borrow_event_header_private_field_class(
+ struct bt_private_stream_class *stream_class)
+{
+ return (void *) bt_stream_class_borrow_event_header_field_class(
+ (void *) stream_class);
+}
+
+int bt_private_stream_class_set_event_header_private_field_class(
+ struct bt_private_stream_class *priv_stream_class,
+ struct bt_private_field_class *priv_field_class)
{
int ret;
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+ struct bt_field_class *field_class = (void *) priv_field_class;
struct bt_resolve_field_path_context resolve_ctx = {
.packet_header = NULL,
.packet_context = NULL,
return stream_class->event_common_context_fc;
}
-int bt_stream_class_set_event_common_context_field_class(
- struct bt_stream_class *stream_class,
- struct bt_field_class *field_class)
+struct bt_private_field_class *
+bt_private_stream_class_borrow_event_common_context_private_field_class(
+ struct bt_private_stream_class *stream_class)
+{
+ return (void *) bt_stream_class_borrow_event_common_context_field_class(
+ (void *) stream_class);
+}
+
+int bt_private_stream_class_set_event_common_context_private_field_class(
+ struct bt_private_stream_class *priv_stream_class,
+ struct bt_private_field_class *priv_field_class)
{
int ret;
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+ struct bt_field_class *field_class = (void *) priv_field_class;
struct bt_resolve_field_path_context resolve_ctx = {
.packet_header = NULL,
.packet_context = NULL,
stream_class->frozen = true;
}
-int bt_stream_class_set_default_clock_class(
- struct bt_stream_class *stream_class,
+int bt_private_stream_class_set_default_clock_class(
+ struct bt_private_stream_class *priv_stream_class,
struct bt_clock_class *clock_class)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
return (bt_bool) stream_class->assigns_automatic_event_class_id;
}
-int bt_stream_class_set_assigns_automatic_event_class_id(
- struct bt_stream_class *stream_class, bt_bool value)
+int bt_private_stream_class_set_assigns_automatic_event_class_id(
+ struct bt_private_stream_class *priv_stream_class,
+ bt_bool value)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
stream_class->assigns_automatic_event_class_id = (bool) value;
return (bt_bool) stream_class->assigns_automatic_stream_id;
}
-int bt_stream_class_set_assigns_automatic_stream_id(
- struct bt_stream_class *stream_class, bt_bool value)
+int bt_private_stream_class_set_assigns_automatic_stream_id(
+ struct bt_private_stream_class *priv_stream_class,
+ bt_bool value)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
stream_class->assigns_automatic_stream_id = (bool) value;
return (bt_bool) stream_class->packets_have_discarded_event_counter_snapshot;
}
-int bt_stream_class_set_packets_have_discarded_event_counter_snapshot(
- struct bt_stream_class *stream_class, bt_bool value)
+int bt_private_stream_class_set_packets_have_discarded_event_counter_snapshot(
+ struct bt_private_stream_class *priv_stream_class,
+ bt_bool value)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
stream_class->packets_have_discarded_event_counter_snapshot =
return (bt_bool) stream_class->packets_have_packet_counter_snapshot;
}
-int bt_stream_class_set_packets_have_packet_counter_snapshot(
- struct bt_stream_class *stream_class, bt_bool value)
+int bt_private_stream_class_set_packets_have_packet_counter_snapshot(
+ struct bt_private_stream_class *priv_stream_class,
+ bt_bool value)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
stream_class->packets_have_packet_counter_snapshot =
return (bt_bool) stream_class->packets_have_default_beginning_cv;
}
-int bt_stream_class_set_packets_have_default_beginning_clock_value(
- struct bt_stream_class *stream_class, bt_bool value)
+int bt_private_stream_class_set_packets_have_default_beginning_clock_value(
+ struct bt_private_stream_class *priv_stream_class,
+ bt_bool value)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE(!value || stream_class->default_clock_class,
return (bt_bool) stream_class->packets_have_default_end_cv;
}
-int bt_stream_class_set_packets_have_default_end_clock_value(
- struct bt_stream_class *stream_class, bt_bool value)
+int bt_private_stream_class_set_packets_have_default_end_clock_value(
+ struct bt_private_stream_class *priv_stream_class,
+ bt_bool value)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE(!value || stream_class->default_clock_class,
/* BT_CLOCK_VALUE_STATUS_UNKNOWN is not supported as of 2.0 */
return BT_TRUE;
}
+
+struct bt_stream_class *bt_stream_class_borrow_from_private(
+ struct bt_private_stream_class *priv_stream_class)
+{
+ return (void *) priv_stream_class;
+}
/*
- * stream.c
- *
- * Babeltrace trace IR - Stream
- *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
#include <babeltrace/lib-logging-internal.h>
#include <babeltrace/assert-pre-internal.h>
+#include <babeltrace/trace-ir/private-stream.h>
#include <babeltrace/trace-ir/stream.h>
#include <babeltrace/trace-ir/stream-internal.h>
#include <babeltrace/trace-ir/stream-class.h>
return stream;
}
-struct bt_stream *bt_stream_create(struct bt_stream_class *stream_class)
+struct bt_private_stream *bt_private_stream_create(
+ struct bt_private_stream_class *priv_stream_class)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
uint64_t id;
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
id = bt_trace_get_automatic_stream_id(
bt_stream_class_borrow_trace_inline(stream_class),
stream_class);
- return create_stream_with_id(stream_class, id);
+ return (void *) create_stream_with_id(stream_class, id);
}
-struct bt_stream *bt_stream_create_with_id(struct bt_stream_class *stream_class,
+struct bt_private_stream *bt_private_stream_create_with_id(
+ struct bt_private_stream_class *priv_stream_class,
uint64_t id)
{
+ struct bt_stream_class *stream_class = (void *) priv_stream_class;
+
BT_ASSERT_PRE(!stream_class->assigns_automatic_stream_id,
"Stream class automatically assigns stream IDs: "
"%![sc-]+S", stream_class);
- return create_stream_with_id(stream_class, id);
+ return (void *) create_stream_with_id(stream_class, id);
}
struct bt_stream_class *bt_stream_borrow_class(struct bt_stream *stream)
return stream->class;
}
+struct bt_private_stream_class *bt_private_stream_borrow_private_class(
+ struct bt_private_stream *priv_stream)
+{
+ return (void *) bt_stream_borrow_class((void *) priv_stream);
+}
+
const char *bt_stream_get_name(struct bt_stream *stream)
{
BT_ASSERT_PRE_NON_NULL(stream, "Stream class");
return stream->name.value;
}
-int bt_stream_set_name(struct bt_stream *stream, const char *name)
+int bt_private_stream_set_name(struct bt_private_stream *priv_stream,
+ const char *name)
{
+ struct bt_stream *stream = (void *) priv_stream;
+
BT_ASSERT_PRE_NON_NULL(stream, "Clock class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_STREAM_HOT(stream);
g_string_assign(stream->name.str, name);
stream->name.value = stream->name.str->str;
- BT_LIB_LOGV("Set stream class's name: %!+S", stream);
+ BT_LIB_LOGV("Set stream class's name: %!+s", stream);
return 0;
}
BT_LIB_LOGD("Freezing stream: %!+s", stream);
stream->frozen = true;
}
+
+struct bt_stream *bt_stream_borrow_from_private(
+ struct bt_private_stream *priv_stream)
+{
+ return (void *) priv_stream;
+}
/*
- * trace.c
- *
- * Babeltrace trace IR - Trace
- *
* Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
#include <babeltrace/lib-logging-internal.h>
#include <babeltrace/assert-pre-internal.h>
+#include <babeltrace/trace-ir/private-trace.h>
#include <babeltrace/trace-ir/trace-internal.h>
#include <babeltrace/trace-ir/clock-class-internal.h>
#include <babeltrace/trace-ir/stream-internal.h>
#include <stdlib.h>
struct bt_trace_is_static_listener_elem {
- bt_trace_is_static_listener func;
- bt_trace_listener_removed removed;
+ bt_private_trace_is_static_listener func;
+ bt_private_trace_listener_removed removed;
void *data;
};
struct bt_trace_is_static_listener_elem, i);
if (elem.removed) {
- elem.removed(trace, elem.data);
+ elem.removed((void *) trace, elem.data);
}
}
bt_field_wrapper_destroy(field_wrapper);
}
-struct bt_trace *bt_trace_create(void)
+struct bt_private_trace *bt_private_trace_create(void)
{
struct bt_trace *trace = NULL;
int ret;
BT_OBJECT_PUT_REF_AND_RESET(trace);
end:
- return trace;
+ return (void *) trace;
}
const char *bt_trace_get_name(struct bt_trace *trace)
return trace->name.value;
}
-int bt_trace_set_name(struct bt_trace *trace, const char *name)
+int bt_private_trace_set_name(struct bt_private_trace *priv_trace,
+ const char *name)
{
+ struct bt_trace *trace = (void *) priv_trace;
+
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_TRACE_HOT(trace);
return trace->uuid.value;
}
-int bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid)
+int bt_private_trace_set_uuid(struct bt_private_trace *priv_trace, bt_uuid uuid)
{
+ struct bt_trace *trace = (void *) priv_trace;
+
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(uuid, "UUID");
BT_ASSERT_PRE_TRACE_HOT(trace);
return ret;
}
-int bt_trace_set_environment_entry_string(struct bt_trace *trace,
+int bt_private_trace_set_private_environment_entry_string(
+ struct bt_private_trace *priv_trace,
const char *name, const char *value)
{
int ret;
struct bt_private_value *value_obj;
+ struct bt_trace *trace = (void *) priv_trace;
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(name, "Name");
return ret;
}
-int bt_trace_set_environment_entry_integer(
- struct bt_trace *trace, const char *name, int64_t value)
+int bt_private_trace_set_private_environment_entry_integer(
+ struct bt_private_trace *priv_trace,
+ const char *name, int64_t value)
{
int ret;
struct bt_private_value *value_obj;
+ struct bt_trace *trace = (void *) priv_trace;
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT(*name);
}
+void bt_private_trace_borrow_private_environment_entry_by_index(
+ struct bt_private_trace *trace, uint64_t index,
+ const char **name, struct bt_private_value **value)
+{
+ bt_trace_borrow_environment_entry_by_index((void *) trace,
+ index, name, (void *) value);
+}
+
struct bt_value *bt_trace_borrow_environment_entry_value_by_name(
struct bt_trace *trace, const char *name)
{
name));
}
+struct bt_private_value *
+bt_private_trace_borrow_private_environment_entry_value_by_name(
+ struct bt_private_trace *trace, const char *name)
+{
+ return (void *) bt_trace_borrow_environment_entry_value_by_name(
+ (void *) trace, name);
+}
+
uint64_t bt_trace_get_stream_count(struct bt_trace *trace)
{
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
return g_ptr_array_index(trace->streams, index);
}
+struct bt_private_stream *bt_private_trace_borrow_private_stream_by_index(
+ struct bt_private_trace *trace, uint64_t index)
+{
+ return (void *) bt_trace_borrow_stream_by_index((void *) trace, index);
+}
+
struct bt_stream *bt_trace_borrow_stream_by_id(
struct bt_trace *trace, uint64_t id)
{
return stream;
}
+struct bt_private_stream *bt_private_trace_borrow_private_stream_by_id(
+ struct bt_private_trace *trace, uint64_t id)
+{
+ return (void *) bt_trace_borrow_stream_by_id((void *) trace, id);
+}
+
uint64_t bt_trace_get_stream_class_count(struct bt_trace *trace)
{
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
return g_ptr_array_index(trace->stream_classes, index);
}
+struct bt_private_stream_class *
+bt_private_trace_borrow_private_stream_class_by_index(
+ struct bt_private_trace *trace, uint64_t index)
+{
+ return (void *) bt_trace_borrow_stream_class_by_index(
+ (void *) trace, index);
+}
+
struct bt_stream_class *bt_trace_borrow_stream_class_by_id(
struct bt_trace *trace, uint64_t id)
{
return stream_class;
}
+struct bt_private_stream_class *
+bt_private_trace_borrow_private_stream_class_by_id(
+ struct bt_private_trace *trace, uint64_t id)
+{
+ return (void *) bt_trace_borrow_stream_class_by_id((void *) trace, id);
+}
+
struct bt_field_class *bt_trace_borrow_packet_header_field_class(
struct bt_trace *trace)
{
return trace->packet_header_fc;
}
-int bt_trace_set_packet_header_field_class(struct bt_trace *trace,
- struct bt_field_class *field_class)
+int bt_private_trace_set_packet_header_private_field_class(
+ struct bt_private_trace *priv_trace,
+ struct bt_private_field_class *priv_field_class)
{
int ret;
+ struct bt_trace *trace = (void *) priv_trace;
+ struct bt_field_class *field_class = (void *) priv_field_class;
struct bt_resolve_field_path_context resolve_ctx = {
.packet_header = field_class,
.packet_context = NULL,
return (bt_bool) trace->is_static;
}
-int bt_trace_make_static(struct bt_trace *trace)
+int bt_private_trace_make_static(struct bt_private_trace *priv_trace)
{
+ struct bt_trace *trace = (void *) priv_trace;
uint64_t i;
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
struct bt_trace_is_static_listener_elem, i);
if (elem.func) {
- elem.func(trace, elem.data);
+ elem.func((void *) trace, elem.data);
}
}
return 0;
}
-int bt_trace_add_is_static_listener(struct bt_trace *trace,
- bt_trace_is_static_listener listener,
- bt_trace_listener_removed listener_removed, void *data,
+int bt_private_trace_add_is_static_listener(
+ struct bt_private_trace *priv_trace,
+ bt_private_trace_is_static_listener listener,
+ bt_private_trace_listener_removed listener_removed, void *data,
uint64_t *listener_id)
{
+ struct bt_trace *trace = (void *) priv_trace;
uint64_t i;
struct bt_trace_is_static_listener_elem new_elem = {
.func = listener,
listener_id))->func != NULL;
}
-int bt_trace_remove_is_static_listener(
- struct bt_trace *trace, uint64_t listener_id)
+int bt_private_trace_remove_is_static_listener(
+ struct bt_private_trace *priv_trace, uint64_t listener_id)
{
+ struct bt_trace *trace = (void *) priv_trace;
struct bt_trace_is_static_listener_elem *elem;
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
"%![trace-]+t, listener-id=%" PRIu64,
trace, listener_id);
trace->in_remove_listener = true;
- elem->removed(trace, elem->data);
+ elem->removed((void *) trace, elem->data);
trace->in_remove_listener = false;
}
return (bt_bool) trace->assigns_automatic_stream_class_id;
}
-int bt_trace_set_assigns_automatic_stream_class_id(
- struct bt_trace *trace, bt_bool value)
+int bt_private_trace_set_assigns_automatic_stream_class_id(
+ struct bt_private_trace *priv_trace, bt_bool value)
{
+ struct bt_trace *trace = (void *) priv_trace;
+
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_TRACE_HOT(trace);
trace->assigns_automatic_stream_class_id = (bool) value;
void ctf_visitor_generate_ir_destroy(struct ctf_visitor_generate_ir *visitor);
BT_HIDDEN
-struct bt_trace *ctf_visitor_generate_ir_get_ir_trace(
+struct bt_private_trace *ctf_visitor_generate_ir_get_ir_trace(
struct ctf_visitor_generate_ir *visitor);
BT_HIDDEN
#include "ctf-meta-visitors.h"
static inline
-struct bt_field_class *ctf_field_class_to_ir(struct ctf_field_class *fc,
+struct bt_private_field_class *ctf_field_class_to_ir(struct ctf_field_class *fc,
struct ctf_trace_class *tc,
struct ctf_stream_class *sc,
struct ctf_event_class *ec);
static inline
void ctf_field_class_int_set_props(struct ctf_field_class_int *fc,
- struct bt_field_class *ir_fc)
+ struct bt_private_field_class *ir_fc)
{
int ret;
- ret = bt_field_class_integer_set_field_value_range(ir_fc, fc->base.size);
+ ret = bt_private_field_class_integer_set_field_value_range(ir_fc,
+ fc->base.size);
BT_ASSERT(ret == 0);
- ret = bt_field_class_integer_set_preferred_display_base(ir_fc,
+ ret = bt_private_field_class_integer_set_preferred_display_base(ir_fc,
fc->disp_base);
BT_ASSERT(ret == 0);
}
static inline
-struct bt_field_class *ctf_field_class_int_to_ir(struct ctf_field_class_int *fc)
+struct bt_private_field_class *ctf_field_class_int_to_ir(
+ struct ctf_field_class_int *fc)
{
- struct bt_field_class *ir_fc;
+ struct bt_private_field_class *ir_fc;
if (fc->is_signed) {
- ir_fc = bt_field_class_signed_integer_create();
+ ir_fc = bt_private_field_class_signed_integer_create();
} else {
- ir_fc = bt_field_class_unsigned_integer_create();
+ ir_fc = bt_private_field_class_unsigned_integer_create();
}
BT_ASSERT(ir_fc);
}
static inline
-struct bt_field_class *ctf_field_class_enum_to_ir(struct ctf_field_class_enum *fc)
+struct bt_private_field_class *ctf_field_class_enum_to_ir(
+ struct ctf_field_class_enum *fc)
{
int ret;
- struct bt_field_class *ir_fc;
+ struct bt_private_field_class *ir_fc;
uint64_t i;
if (fc->base.is_signed) {
- ir_fc = bt_field_class_signed_enumeration_create();
+ ir_fc = bt_private_field_class_signed_enumeration_create();
} else {
- ir_fc = bt_field_class_unsigned_enumeration_create();
+ ir_fc = bt_private_field_class_unsigned_enumeration_create();
}
BT_ASSERT(ir_fc);
ctf_field_class_enum_borrow_mapping_by_index(fc, i);
if (fc->base.is_signed) {
- ret = bt_field_class_signed_enumeration_map_range(
+ ret = bt_private_field_class_signed_enumeration_map_range(
ir_fc, mapping->label->str,
mapping->range.lower.i, mapping->range.upper.i);
} else {
- ret = bt_field_class_unsigned_enumeration_map_range(
+ ret = bt_private_field_class_unsigned_enumeration_map_range(
ir_fc, mapping->label->str,
mapping->range.lower.u, mapping->range.upper.u);
}
}
static inline
-struct bt_field_class *ctf_field_class_float_to_ir(
+struct bt_private_field_class *ctf_field_class_float_to_ir(
struct ctf_field_class_float *fc)
{
- struct bt_field_class *ir_fc;
+ struct bt_private_field_class *ir_fc;
int ret;
- ir_fc = bt_field_class_real_create();
+ ir_fc = bt_private_field_class_real_create();
BT_ASSERT(ir_fc);
if (fc->base.size == 32) {
- ret = bt_field_class_real_set_is_single_precision(ir_fc,
+ ret = bt_private_field_class_real_set_is_single_precision(ir_fc,
BT_TRUE);
BT_ASSERT(ret == 0);
}
}
static inline
-struct bt_field_class *ctf_field_class_string_to_ir(
+struct bt_private_field_class *ctf_field_class_string_to_ir(
struct ctf_field_class_string *fc)
{
- struct bt_field_class *ir_fc = bt_field_class_string_create();
+ struct bt_private_field_class *ir_fc =
+ bt_private_field_class_string_create();
BT_ASSERT(ir_fc);
return ir_fc;
}
static inline
-struct bt_field_class *ctf_field_class_struct_to_ir(
+struct bt_private_field_class *ctf_field_class_struct_to_ir(
struct ctf_field_class_struct *fc,
struct ctf_trace_class *tc,
struct ctf_stream_class *sc,
struct ctf_event_class *ec)
{
int ret;
- struct bt_field_class *ir_fc = bt_field_class_structure_create();
+ struct bt_private_field_class *ir_fc =
+ bt_private_field_class_structure_create();
uint64_t i;
BT_ASSERT(ir_fc);
for (i = 0; i < fc->members->len; i++) {
struct ctf_named_field_class *named_fc =
ctf_field_class_struct_borrow_member_by_index(fc, i);
- struct bt_field_class *member_ir_fc;
+ struct bt_private_field_class *member_ir_fc;
if (!named_fc->fc->in_ir) {
continue;
member_ir_fc = ctf_field_class_to_ir(named_fc->fc, tc, sc, ec);
BT_ASSERT(member_ir_fc);
- ret = bt_field_class_structure_append_member(ir_fc,
- named_fc->name->str, member_ir_fc);
+ ret = bt_private_field_class_structure_append_private_member(
+ ir_fc, named_fc->name->str, member_ir_fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(member_ir_fc);
}
}
static inline
-struct bt_field_class *borrow_ir_ft_from_field_path(
+struct bt_private_field_class *borrow_ir_ft_from_field_path(
struct ctf_field_path *field_path,
struct ctf_trace_class *tc,
struct ctf_stream_class *sc,
struct ctf_event_class *ec)
{
- struct bt_field_class *ir_fc = NULL;
+ struct bt_private_field_class *ir_fc = NULL;
struct ctf_field_class *fc = ctf_field_path_borrow_field_class(
field_path, tc, sc, ec);
}
static inline
-struct bt_field_class *ctf_field_class_variant_to_ir(
+struct bt_private_field_class *ctf_field_class_variant_to_ir(
struct ctf_field_class_variant *fc,
struct ctf_trace_class *tc,
struct ctf_stream_class *sc,
struct ctf_event_class *ec)
{
int ret;
- struct bt_field_class *ir_fc = bt_field_class_variant_create();
+ struct bt_private_field_class *ir_fc =
+ bt_private_field_class_variant_create();
uint64_t i;
BT_ASSERT(ir_fc);
- ret = bt_field_class_variant_set_selector_field_class(ir_fc,
- borrow_ir_ft_from_field_path(&fc->tag_path, tc, sc, ec));
+ ret = bt_private_field_class_variant_set_selector_private_field_class(
+ ir_fc, borrow_ir_ft_from_field_path(&fc->tag_path, tc, sc, ec));
BT_ASSERT(ret == 0);
for (i = 0; i < fc->options->len; i++) {
struct ctf_named_field_class *named_fc =
ctf_field_class_variant_borrow_option_by_index(fc, i);
- struct bt_field_class *option_ir_fc;
+ struct bt_private_field_class *option_ir_fc;
BT_ASSERT(named_fc->fc->in_ir);
option_ir_fc = ctf_field_class_to_ir(named_fc->fc, tc, sc, ec);
BT_ASSERT(option_ir_fc);
- ret = bt_field_class_variant_append_option(ir_fc,
- named_fc->name->str, option_ir_fc);
+ ret = bt_private_field_class_variant_append_private_option(
+ ir_fc, named_fc->name->str, option_ir_fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(option_ir_fc);
}
}
static inline
-struct bt_field_class *ctf_field_class_array_to_ir(
+struct bt_private_field_class *ctf_field_class_array_to_ir(
struct ctf_field_class_array *fc,
struct ctf_trace_class *tc,
struct ctf_stream_class *sc,
struct ctf_event_class *ec)
{
- struct bt_field_class *ir_fc;
- struct bt_field_class *elem_ir_fc;
+ struct bt_private_field_class *ir_fc;
+ struct bt_private_field_class *elem_ir_fc;
if (fc->base.is_text) {
- ir_fc = bt_field_class_string_create();
+ ir_fc = bt_private_field_class_string_create();
BT_ASSERT(ir_fc);
goto end;
}
elem_ir_fc = ctf_field_class_to_ir(fc->base.elem_fc, tc, sc, ec);
BT_ASSERT(elem_ir_fc);
- ir_fc = bt_field_class_static_array_create(elem_ir_fc, fc->length);
+ ir_fc = bt_private_field_class_static_array_create(elem_ir_fc,
+ fc->length);
BT_ASSERT(ir_fc);
bt_object_put_ref(elem_ir_fc);
}
static inline
-struct bt_field_class *ctf_field_class_sequence_to_ir(
+struct bt_private_field_class *ctf_field_class_sequence_to_ir(
struct ctf_field_class_sequence *fc,
struct ctf_trace_class *tc,
struct ctf_stream_class *sc,
struct ctf_event_class *ec)
{
int ret;
- struct bt_field_class *ir_fc;
- struct bt_field_class *elem_ir_fc;
+ struct bt_private_field_class *ir_fc;
+ struct bt_private_field_class *elem_ir_fc;
if (fc->base.is_text) {
- ir_fc = bt_field_class_string_create();
+ ir_fc = bt_private_field_class_string_create();
BT_ASSERT(ir_fc);
goto end;
}
elem_ir_fc = ctf_field_class_to_ir(fc->base.elem_fc, tc, sc, ec);
BT_ASSERT(elem_ir_fc);
- ir_fc = bt_field_class_dynamic_array_create(elem_ir_fc);
+ ir_fc = bt_private_field_class_dynamic_array_create(elem_ir_fc);
BT_ASSERT(ir_fc);
bt_object_put_ref(elem_ir_fc);
BT_ASSERT(ir_fc);
- ret = bt_field_class_dynamic_array_set_length_field_class(ir_fc,
+ ret = bt_private_field_class_dynamic_array_set_length_private_field_class(
+ ir_fc,
borrow_ir_ft_from_field_path(&fc->length_path, tc, sc, ec));
BT_ASSERT(ret == 0);
}
static inline
-struct bt_field_class *ctf_field_class_to_ir(struct ctf_field_class *fc,
+struct bt_private_field_class *ctf_field_class_to_ir(struct ctf_field_class *fc,
struct ctf_trace_class *tc,
struct ctf_stream_class *sc,
struct ctf_event_class *ec)
{
- struct bt_field_class *ir_fc = NULL;
+ struct bt_private_field_class *ir_fc = NULL;
BT_ASSERT(fc);
BT_ASSERT(fc->in_ir);
}
static inline
-struct bt_field_class *scope_ctf_field_class_to_ir(struct ctf_field_class *fc,
+struct bt_private_field_class *scope_ctf_field_class_to_ir(struct ctf_field_class *fc,
struct ctf_trace_class *tc,
struct ctf_stream_class *sc,
struct ctf_event_class *ec)
{
- struct bt_field_class *ir_fc = NULL;
+ struct bt_private_field_class *ir_fc = NULL;
if (!fc) {
goto end;
}
static inline
-struct bt_event_class *ctf_event_class_to_ir(struct ctf_event_class *ec,
- struct bt_stream_class *ir_sc, struct ctf_trace_class *tc,
+struct bt_private_event_class *ctf_event_class_to_ir(struct ctf_event_class *ec,
+ struct bt_private_stream_class *ir_sc, struct ctf_trace_class *tc,
struct ctf_stream_class *sc)
{
int ret;
- struct bt_event_class *ir_ec = NULL;
+ struct bt_private_event_class *ir_ec = NULL;
if (ec->is_translated) {
- ir_ec = bt_stream_class_borrow_event_class_by_id(
+ ir_ec = bt_private_stream_class_borrow_private_event_class_by_id(
ir_sc, ec->id);
BT_ASSERT(ir_ec);
goto end;
}
- ir_ec = bt_event_class_create_with_id(ir_sc, ec->id);
+ ir_ec = bt_private_event_class_create_with_id(ir_sc, ec->id);
BT_ASSERT(ir_ec);
bt_object_put_ref(ir_ec);
if (ec->spec_context_fc) {
- struct bt_field_class *ir_fc = scope_ctf_field_class_to_ir(
+ struct bt_private_field_class *ir_fc = scope_ctf_field_class_to_ir(
ec->spec_context_fc, tc, sc, ec);
if (ir_fc) {
- ret = bt_event_class_set_specific_context_field_class(
+ ret = bt_private_event_class_set_specific_context_private_field_class(
ir_ec, ir_fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(ir_fc);
}
if (ec->payload_fc) {
- struct bt_field_class *ir_fc = scope_ctf_field_class_to_ir(
+ struct bt_private_field_class *ir_fc = scope_ctf_field_class_to_ir(
ec->payload_fc, tc, sc, ec);
if (ir_fc) {
- ret = bt_event_class_set_payload_field_class(ir_ec,
+ ret = bt_private_event_class_set_payload_private_field_class(ir_ec,
ir_fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(ir_fc);
}
if (ec->name->len > 0) {
- ret = bt_event_class_set_name(ir_ec, ec->name->str);
+ ret = bt_private_event_class_set_name(ir_ec, ec->name->str);
BT_ASSERT(ret == 0);
}
if (ec->emf_uri->len > 0) {
- ret = bt_event_class_set_emf_uri(ir_ec, ec->emf_uri->str);
+ ret = bt_private_event_class_set_emf_uri(ir_ec, ec->emf_uri->str);
BT_ASSERT(ret == 0);
}
if (ec->log_level != -1) {
- ret = bt_event_class_set_log_level(ir_ec, ec->log_level);
+ ret = bt_private_event_class_set_log_level(ir_ec, ec->log_level);
BT_ASSERT(ret == 0);
}
static inline
-struct bt_stream_class *ctf_stream_class_to_ir(struct ctf_stream_class *sc,
- struct bt_trace *ir_trace, struct ctf_trace_class *tc)
+struct bt_private_stream_class *ctf_stream_class_to_ir(struct ctf_stream_class *sc,
+ struct bt_private_trace *ir_trace, struct ctf_trace_class *tc)
{
int ret;
- struct bt_stream_class *ir_sc = NULL;
+ struct bt_private_stream_class *ir_sc = NULL;
struct ctf_field_class_int *int_fc;
if (sc->is_translated) {
- ir_sc = bt_trace_borrow_stream_class_by_id(ir_trace, sc->id);
+ ir_sc = bt_private_trace_borrow_private_stream_class_by_id(
+ ir_trace, sc->id);
BT_ASSERT(ir_sc);
goto end;
}
- ir_sc = bt_stream_class_create_with_id(ir_trace, sc->id);
+ ir_sc = bt_private_stream_class_create_with_id(ir_trace, sc->id);
BT_ASSERT(ir_sc);
bt_object_put_ref(ir_sc);
if (sc->packet_context_fc) {
- struct bt_field_class *ir_fc = scope_ctf_field_class_to_ir(
+ struct bt_private_field_class *ir_fc = scope_ctf_field_class_to_ir(
sc->packet_context_fc, tc, sc, NULL);
if (ir_fc) {
- ret = bt_stream_class_set_packet_context_field_class(
+ ret = bt_private_stream_class_set_packet_context_private_field_class(
ir_sc, ir_fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(ir_fc);
}
if (sc->event_header_fc) {
- struct bt_field_class *ir_fc = scope_ctf_field_class_to_ir(
+ struct bt_private_field_class *ir_fc = scope_ctf_field_class_to_ir(
sc->event_header_fc, tc, sc, NULL);
if (ir_fc) {
- ret = bt_stream_class_set_event_header_field_class(ir_sc,
- ir_fc);
+ ret = bt_private_stream_class_set_event_header_private_field_class(
+ ir_sc, ir_fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(ir_fc);
}
}
if (sc->event_common_context_fc) {
- struct bt_field_class *ir_fc = scope_ctf_field_class_to_ir(
+ struct bt_private_field_class *ir_fc = scope_ctf_field_class_to_ir(
sc->event_common_context_fc, tc, sc, NULL);
if (ir_fc) {
- ret = bt_stream_class_set_event_common_context_field_class(
+ ret = bt_private_stream_class_set_event_common_context_private_field_class(
ir_sc, ir_fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(ir_fc);
}
}
- ret = bt_stream_class_set_assigns_automatic_event_class_id(ir_sc,
+ ret = bt_private_stream_class_set_assigns_automatic_event_class_id(ir_sc,
BT_FALSE);
BT_ASSERT(ret == 0);
- ret = bt_stream_class_set_assigns_automatic_stream_id(ir_sc, BT_FALSE);
+ ret = bt_private_stream_class_set_assigns_automatic_stream_id(ir_sc, BT_FALSE);
BT_ASSERT(ret == 0);
if (sc->default_clock_class) {
- ret = bt_stream_class_set_default_clock_class(ir_sc,
- sc->default_clock_class);
+ ret = bt_private_stream_class_set_default_clock_class(ir_sc,
+ bt_clock_class_borrow_from_private(sc->default_clock_class));
BT_ASSERT(ret == 0);
}
"events_discarded");
if (int_fc) {
if (int_fc->meaning == CTF_FIELD_CLASS_MEANING_DISC_EV_REC_COUNTER_SNAPSHOT) {
- ret = bt_stream_class_set_packets_have_discarded_event_counter_snapshot(
+ ret = bt_private_stream_class_set_packets_have_discarded_event_counter_snapshot(
ir_sc, BT_TRUE);
BT_ASSERT(ret == 0);
}
"packet_seq_num");
if (int_fc) {
if (int_fc->meaning == CTF_FIELD_CLASS_MEANING_PACKET_COUNTER_SNAPSHOT) {
- ret = bt_stream_class_set_packets_have_packet_counter_snapshot(
+ ret = bt_private_stream_class_set_packets_have_packet_counter_snapshot(
ir_sc, BT_TRUE);
BT_ASSERT(ret == 0);
}
"timestamp_begin");
if (int_fc) {
if (int_fc->meaning == CTF_FIELD_CLASS_MEANING_PACKET_BEGINNING_TIME) {
- ret = bt_stream_class_set_packets_have_default_beginning_clock_value(
+ ret = bt_private_stream_class_set_packets_have_default_beginning_clock_value(
ir_sc, BT_TRUE);
BT_ASSERT(ret == 0);
}
"timestamp_end");
if (int_fc) {
if (int_fc->meaning == CTF_FIELD_CLASS_MEANING_PACKET_END_TIME) {
- ret = bt_stream_class_set_packets_have_default_end_clock_value(
+ ret = bt_private_stream_class_set_packets_have_default_end_clock_value(
ir_sc, BT_TRUE);
BT_ASSERT(ret == 0);
}
}
static inline
-int ctf_trace_class_to_ir(struct bt_trace *ir_trace,
+int ctf_trace_class_to_ir(struct bt_private_trace *ir_trace,
struct ctf_trace_class *tc)
{
int ret = 0;
}
if (tc->packet_header_fc) {
- struct bt_field_class *ir_fc = scope_ctf_field_class_to_ir(
+ struct bt_private_field_class *ir_fc = scope_ctf_field_class_to_ir(
tc->packet_header_fc, tc, NULL, NULL);
if (ir_fc) {
- ret = bt_trace_set_packet_header_field_class(ir_trace,
- ir_fc);
+ ret = bt_private_trace_set_packet_header_private_field_class(
+ ir_trace, ir_fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(ir_fc);
}
}
if (tc->name->len > 0) {
- ret = bt_trace_set_name(ir_trace, tc->name->str);
+ ret = bt_private_trace_set_name(ir_trace, tc->name->str);
if (ret) {
goto end;
}
}
if (tc->is_uuid_set) {
- ret = bt_trace_set_uuid(ir_trace, tc->uuid);
+ ret = bt_private_trace_set_uuid(ir_trace, tc->uuid);
if (ret) {
goto end;
}
switch (env_entry->type) {
case CTF_TRACE_CLASS_ENV_ENTRY_TYPE_INT:
- ret = bt_trace_set_environment_entry_integer(
+ ret = bt_private_trace_set_private_environment_entry_integer(
ir_trace, env_entry->name->str,
env_entry->value.i);
break;
case CTF_TRACE_CLASS_ENV_ENTRY_TYPE_STR:
- ret = bt_trace_set_environment_entry_string(
+ ret = bt_private_trace_set_private_environment_entry_string(
ir_trace, env_entry->name->str,
env_entry->value.str->str);
break;
}
}
- ret = bt_trace_set_assigns_automatic_stream_class_id(ir_trace,
+ ret = bt_private_trace_set_assigns_automatic_stream_class_id(ir_trace,
BT_FALSE);
if (ret) {
goto end;
}
BT_HIDDEN
-int ctf_trace_class_translate(struct bt_trace *ir_trace,
+int ctf_trace_class_translate(struct bt_private_trace *ir_trace,
struct ctf_trace_class *tc)
{
int ret = 0;
for (i = 0; i < tc->stream_classes->len; i++) {
uint64_t j;
struct ctf_stream_class *sc = tc->stream_classes->pdata[i];
- struct bt_stream_class *ir_sc;
+ struct bt_private_stream_class *ir_sc;
ir_sc = ctf_stream_class_to_ir(sc, ir_trace, tc);
if (!ir_sc) {
for (j = 0; j < sc->event_classes->len; j++) {
struct ctf_event_class *ec = sc->event_classes->pdata[j];
- struct bt_event_class *ir_ec;
+ struct bt_private_event_class *ir_ec;
ir_ec = ctf_event_class_to_ir(ec, ir_sc, tc, sc);
if (!ir_ec) {
static inline
int find_mapped_clock_class(struct ctf_field_class *fc,
- struct bt_clock_class **clock_class)
+ struct bt_private_clock_class **clock_class)
{
int ret = 0;
uint64_t i;
BT_LOGE("Stream class contains more than one "
"clock class: expected-cc-name=\"%s\", "
"other-cc-name=\"%s\"",
- bt_clock_class_get_name(*clock_class),
- bt_clock_class_get_name(int_fc->mapped_clock_class));
+ bt_clock_class_get_name(
+ bt_clock_class_borrow_from_private(
+ *clock_class)),
+ bt_clock_class_get_name(
+ bt_clock_class_borrow_from_private(
+ int_fc->mapped_clock_class)));
ret = -1;
goto end;
}
struct ctf_stream_class *stream_class)
{
int ret = 0;
- struct bt_clock_class *clock_class = stream_class->default_clock_class;
+ struct bt_private_clock_class *clock_class =
+ stream_class->default_clock_class;
uint64_t i;
ret = find_mapped_clock_class(stream_class->packet_context_fc,
{
uint64_t i;
int ret = 0;
- struct bt_clock_class *clock_class = NULL;
+ struct bt_private_clock_class *clock_class = NULL;
ret = find_mapped_clock_class(ctf_tc->packet_header_fc,
&clock_class);
int ctf_trace_class_resolve_field_classes(struct ctf_trace_class *tc);
BT_HIDDEN
-int ctf_trace_class_translate(struct bt_trace *ir_trace,
+int ctf_trace_class_translate(struct bt_private_trace *ir_trace,
struct ctf_trace_class *tc);
BT_HIDDEN
bool in_ir;
/* Weak, set during translation. NULL if `in_ir` is false below. */
- struct bt_field_class *ir_fc;
+ struct bt_private_field_class *ir_fc;
};
struct ctf_field_class_bit_array {
int64_t storing_index;
/* Owned by this */
- struct bt_clock_class *mapped_clock_class;
+ struct bt_private_clock_class *mapped_clock_class;
};
struct ctf_range {
struct ctf_field_class *payload_fc;
/* Weak, set during translation */
- struct bt_event_class *ir_ec;
+ struct bt_private_event_class *ir_ec;
};
struct ctf_stream_class {
GHashTable *event_classes_by_id;
/* Owned by this */
- struct bt_clock_class *default_clock_class;
+ struct bt_private_clock_class *default_clock_class;
/* Weak, set during translation */
- struct bt_stream_class *ir_sc;
+ struct bt_private_stream_class *ir_sc;
};
enum ctf_trace_class_env_entry_type {
uint64_t stored_value_count;
- /* Array of `struct bt_clock_class *` (owned by this) */
+ /* Array of `struct bt_private_clock_class *` (owned by this) */
GPtrArray *clock_classes;
/* Array of `struct ctf_stream_class *` */
bool is_translated;
/* Weak, set during translation */
- struct bt_trace *ir_tc;
+ struct bt_private_trace *ir_tc;
};
static inline
}
static inline
-struct bt_clock_class *ctf_trace_class_borrow_clock_class_by_name(
+struct bt_private_clock_class *ctf_trace_class_borrow_clock_class_by_name(
struct ctf_trace_class *tc, const char *name)
{
uint64_t i;
- struct bt_clock_class *ret_cc = NULL;
+ struct bt_private_clock_class *ret_cc = NULL;
BT_ASSERT(tc);
BT_ASSERT(name);
for (i = 0; i < tc->clock_classes->len; i++) {
- struct bt_clock_class *cc = tc->clock_classes->pdata[i];
- const char *cc_name = bt_clock_class_get_name(cc);
+ struct bt_private_clock_class *cc = tc->clock_classes->pdata[i];
+ const char *cc_name = bt_clock_class_get_name(
+ bt_clock_class_borrow_from_private(cc));
BT_ASSERT(cc_name);
if (strcmp(cc_name, name) == 0) {
}
BT_HIDDEN
-struct bt_trace *ctf_metadata_decoder_get_ir_trace(
+struct bt_private_trace *ctf_metadata_decoder_get_ir_trace(
struct ctf_metadata_decoder *mdec)
{
return ctf_visitor_generate_ir_get_ir_trace(mdec->visitor);
struct ctf_metadata_decoder *metadata_decoder, FILE *fp);
BT_HIDDEN
-struct bt_trace *ctf_metadata_decoder_get_ir_trace(
+struct bt_private_trace *ctf_metadata_decoder_get_ir_trace(
struct ctf_metadata_decoder *mdec);
BT_HIDDEN
*/
struct ctx {
/* Trace IR trace being filled (owned by this) */
- struct bt_trace *trace;
+ struct bt_private_trace *trace;
/* CTF meta trace being filled (owned by this) */
struct ctf_trace_class *ctf_tc;
goto error;
}
- ctx->trace = bt_trace_create();
+ ctx->trace = bt_private_trace_create();
if (!ctx->trace) {
BT_LOGE_STR("Cannot create empty trace.");
goto error;
int signedness = 0;
struct ctf_node *expression;
uint64_t alignment = 0, size = 0;
- struct bt_clock_class *mapped_clock_class = NULL;
+ struct bt_private_clock_class *mapped_clock_class = NULL;
enum ctf_encoding encoding = CTF_ENCODING_NONE;
enum bt_field_class_integer_preferred_display_base base =
BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL;
int auto_map_field_to_trace_clock_class(struct ctx *ctx,
struct ctf_field_class *fc)
{
- struct bt_clock_class *clock_class_to_map_to = NULL;
+ struct bt_private_clock_class *clock_class_to_map_to = NULL;
struct ctf_field_class_int *int_fc = (void *) fc;
int ret = 0;
uint64_t clock_class_count;
* implicit one at 1 GHz, named `default`, and use this clock
* class.
*/
- clock_class_to_map_to = bt_clock_class_create();
+ clock_class_to_map_to = bt_private_clock_class_create();
BT_ASSERT(clock_class_to_map_to);
- ret = bt_clock_class_set_frequency(clock_class_to_map_to,
+ ret = bt_private_clock_class_set_frequency(clock_class_to_map_to,
UINT64_C(1000000000));
BT_ASSERT(ret == 0);
- ret = bt_clock_class_set_name(clock_class_to_map_to,
+ ret = bt_private_clock_class_set_name(clock_class_to_map_to,
"default");
BT_ASSERT(ret == 0);
g_ptr_array_add(ctx->ctf_tc->clock_classes,
static
int visit_clock_decl_entry(struct ctx *ctx, struct ctf_node *entry_node,
- struct bt_clock_class *clock, int *set, int64_t *offset_seconds,
+ struct bt_private_clock_class *clock, int *set, int64_t *offset_seconds,
uint64_t *offset_cycles)
{
int ret = 0;
goto error;
}
- ret = bt_clock_class_set_name(clock, right);
+ ret = bt_private_clock_class_set_name(clock, right);
if (ret) {
_BT_LOGE_NODE(entry_node,
"cannot set clock class's name");
goto error;
}
- ret = bt_clock_class_set_uuid(clock, uuid);
+ ret = bt_private_clock_class_set_uuid(clock, uuid);
if (ret) {
_BT_LOGE_NODE(entry_node,
"Cannot set clock class's UUID.");
goto error;
}
- ret = bt_clock_class_set_description(clock, right);
+ ret = bt_private_clock_class_set_description(clock, right);
if (ret) {
_BT_LOGE_NODE(entry_node,
"Cannot set clock class's description.");
goto error;
}
- ret = bt_clock_class_set_frequency(clock, freq);
+ ret = bt_private_clock_class_set_frequency(clock, freq);
if (ret) {
_BT_LOGE_NODE(entry_node,
"Cannot set clock class's frequency.");
goto error;
}
- ret = bt_clock_class_set_precision(clock, precision);
+ ret = bt_private_clock_class_set_precision(clock, precision);
if (ret) {
_BT_LOGE_NODE(entry_node,
"Cannot set clock class's precision.");
goto error;
}
- ret = bt_clock_class_set_is_absolute(clock, ret);
+ ret = bt_private_clock_class_set_is_absolute(clock, ret);
if (ret) {
_BT_LOGE_NODE(entry_node,
"Cannot set clock class's absolute flag.");
}
static
-void apply_clock_class_offset(struct ctx *ctx, struct bt_clock_class *clock)
+void apply_clock_class_offset(struct ctx *ctx,
+ struct bt_private_clock_class *clock)
{
int ret;
uint64_t freq;
offset_s_to_apply += extra_s;
}
- freq = bt_clock_class_get_frequency(clock);
- bt_clock_class_get_offset(clock, &cur_offset_s, &cur_offset_cycles);
+ freq = bt_clock_class_get_frequency(
+ bt_clock_class_borrow_from_private(clock));
+ bt_clock_class_get_offset(bt_clock_class_borrow_from_private(clock),
+ &cur_offset_s, &cur_offset_cycles);
/* Apply offsets */
cur_offset_s += offset_s_to_apply;
calibrate_clock_class_offsets(&cur_offset_s, &cur_offset_cycles, freq);
/* Set final offsets */
- ret = bt_clock_class_set_offset(clock, cur_offset_s, cur_offset_cycles);
+ ret = bt_private_clock_class_set_offset(clock, cur_offset_s, cur_offset_cycles);
BT_ASSERT(ret == 0);
end:
{
int ret = 0;
int set = 0;
- struct bt_clock_class *clock;
+ struct bt_private_clock_class *clock;
struct ctf_node *entry_node;
struct bt_list_head *decl_list = &clock_node->u.clock.declaration_list;
const char *clock_class_name;
clock_node->visited = TRUE;
/* CTF 1.8's default frequency for a clock class is 1 GHz */
- clock = bt_clock_class_create();
+ clock = bt_private_clock_class_create();
if (!clock) {
_BT_LOGE_NODE(clock_node,
"Cannot create default clock class.");
}
/* CTF: not absolute by default */
- ret = bt_clock_class_set_is_absolute(clock, BT_FALSE);
+ ret = bt_private_clock_class_set_is_absolute(clock, BT_FALSE);
if (ret) {
_BT_LOGE_NODE(clock_node,
"Cannot set clock class's absolute flag.");
goto end;
}
- clock_class_name = bt_clock_class_get_name(clock);
+ clock_class_name = bt_clock_class_get_name(
+ bt_clock_class_borrow_from_private(clock));
BT_ASSERT(clock_class_name);
if (ctx->is_lttng && strcmp(clock_class_name, "monotonic") == 0) {
/*
* it's a condition to be able to sort notifications
* from different sources.
*/
- ret = bt_clock_class_set_is_absolute(clock, BT_TRUE);
+ ret = bt_private_clock_class_set_is_absolute(clock, BT_TRUE);
if (ret) {
_BT_LOGE_NODE(clock_node,
"Cannot set clock class's absolute flag.");
* Adjust offsets so that the part in cycles is less than the
* frequency (move to the part in seconds).
*/
- freq = bt_clock_class_get_frequency(clock);
+ freq = bt_clock_class_get_frequency(
+ bt_clock_class_borrow_from_private(clock));
calibrate_clock_class_offsets(&offset_seconds, &offset_cycles, freq);
- BT_ASSERT(offset_cycles < bt_clock_class_get_frequency(clock));
- ret = bt_clock_class_set_offset(clock, offset_seconds, offset_cycles);
+ BT_ASSERT(offset_cycles < bt_clock_class_get_frequency(
+ bt_clock_class_borrow_from_private(clock)));
+ ret = bt_private_clock_class_set_offset(clock, offset_seconds, offset_cycles);
BT_ASSERT(ret == 0);
apply_clock_class_offset(ctx, clock);
g_ptr_array_add(ctx->ctf_tc->clock_classes, bt_object_get_ref(clock));
}
BT_HIDDEN
-struct bt_trace *ctf_visitor_generate_ir_get_ir_trace(
+struct bt_private_trace *ctf_visitor_generate_ir_get_ir_trace(
struct ctf_visitor_generate_ir *visitor)
{
struct ctx *ctx = (void *) visitor;
*
* Field is borrowed.
*/
- struct bt_field *base;
+ struct bt_private_field *base;
/* Index of next field to set */
size_t index;
* This is set by read_dscope_begin_state() and contains the
* value of one of the pointers in `dscopes` below.
*/
- struct bt_field *cur_dscope_field;
+ struct bt_private_field *cur_dscope_field;
/*
* True if we're done filling a string field from a text
} meta;
/* Current packet header field wrapper (NULL if not created yet) */
- struct bt_packet_header_field *packet_header_field;
+ struct bt_private_packet_header_field *packet_header_field;
/* Current packet header field wrapper (NULL if not created yet) */
- struct bt_packet_context_field *packet_context_field;
+ struct bt_private_packet_context_field *packet_context_field;
/* Current event header field (NULL if not created yet) */
- struct bt_event_header_field *event_header_field;
+ struct bt_private_event_header_field *event_header_field;
/* Current packet (NULL if not created yet) */
- struct bt_packet *packet;
+ struct bt_private_packet *packet;
/* Current stream (NULL if not set yet) */
- struct bt_stream *stream;
+ struct bt_private_stream *stream;
/* Current event (NULL if not created yet) */
- struct bt_event *event;
+ struct bt_private_event *event;
/* Current event notification (NULL if not created yet) */
- struct bt_notification *event_notif;
+ struct bt_private_notification *event_notif;
/* Database of current dynamic scopes */
struct {
- struct bt_field *trace_packet_header;
- struct bt_field *stream_packet_context;
- struct bt_field *event_header;
- struct bt_field *event_common_context;
- struct bt_field *event_spec_context;
- struct bt_field *event_payload;
+ struct bt_private_field *trace_packet_header;
+ struct bt_private_field *stream_packet_context;
+ struct bt_private_field *event_header;
+ struct bt_private_field *event_common_context;
+ struct bt_private_field *event_spec_context;
+ struct bt_private_field *event_payload;
} dscopes;
/* Current state */
}
static
-void stack_push(struct stack *stack, struct bt_field *base)
+void stack_push(struct stack *stack, struct bt_private_field *base)
{
struct stack_entry *entry;
struct bt_notif_iter *notit,
struct ctf_field_class *dscope_fc,
enum state done_state, enum state continue_state,
- struct bt_field *dscope_field)
+ struct bt_private_field *dscope_field)
{
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
enum bt_bfcr_status bfcr_status;
notit->dscopes.event_header = NULL;
if (notit->event_header_field) {
- bt_event_header_field_release(notit->event_header_field);
+ bt_private_event_header_field_release(notit->event_header_field);
notit->event_header_field = NULL;
}
notit->dscopes.trace_packet_header = NULL;
if (notit->packet_header_field) {
- bt_packet_header_field_release(notit->packet_header_field);
+ bt_private_packet_header_field_release(notit->packet_header_field);
notit->packet_header_field = NULL;
}
notit->dscopes.stream_packet_context = NULL;
if (notit->packet_context_field) {
- bt_packet_context_field_release(notit->packet_context_field);
+ bt_private_packet_context_field_release(notit->packet_context_field);
notit->packet_context_field = NULL;
}
* 3. We need the packet header field's content to know
* the ID of the stream class to select.
*/
- notit->packet_header_field = bt_packet_header_field_create(
- notit->meta.tc->ir_tc);
+ notit->packet_header_field =
+ bt_private_packet_header_field_create(
+ notit->meta.tc->ir_tc);
if (!notit->packet_header_field) {
BT_LOGE_STR("Cannot create packet header field wrapper from trace.");
ret = BT_NOTIF_ITER_STATUS_ERROR;
}
notit->dscopes.trace_packet_header =
- bt_packet_header_field_borrow_field(notit->packet_header_field);
+ bt_private_packet_header_field_borrow_private_field(
+ notit->packet_header_field);
BT_ASSERT(notit->dscopes.trace_packet_header);
}
enum bt_notif_iter_status set_current_stream(struct bt_notif_iter *notit)
{
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
- struct bt_stream *stream = NULL;
+ struct bt_private_stream *stream = NULL;
BT_LOGV("Calling user function (get stream): notit-addr=%p, "
"stream-class-addr=%p, stream-class-id=%" PRId64,
enum bt_notif_iter_status set_current_packet(struct bt_notif_iter *notit)
{
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
- struct bt_packet *packet = NULL;
+ struct bt_private_packet *packet = NULL;
BT_LOGV("Creating packet for packet notification: "
"notit-addr=%p", notit);
/* Create packet */
BT_ASSERT(notit->stream);
- packet = bt_packet_create(notit->stream);
+ packet = bt_private_packet_create(notit->stream);
if (!packet) {
BT_LOGE("Cannot create packet from stream: "
"notit-addr=%p, stream-addr=%p, "
* (bt_notif_iter_borrow_packet_header_context_fields()).
*/
notit->packet_context_field =
- bt_packet_context_field_create(notit->meta.sc->ir_sc);
+ bt_private_packet_context_field_create(
+ notit->meta.sc->ir_sc);
if (!notit->packet_context_field) {
BT_LOGE_STR("Cannot create packet context field wrapper from stream class.");
status = BT_NOTIF_ITER_STATUS_ERROR;
}
notit->dscopes.stream_packet_context =
- bt_packet_context_field_borrow_field(notit->packet_context_field);
+ bt_private_packet_context_field_borrow_private_field(
+ notit->packet_context_field);
BT_ASSERT(notit->dscopes.stream_packet_context);
}
if (event_header_fc->in_ir) {
BT_ASSERT(!notit->event_header_field);
- notit->event_header_field = bt_event_header_field_create(
- notit->meta.sc->ir_sc);
+ notit->event_header_field =
+ bt_private_event_header_field_create(
+ notit->meta.sc->ir_sc);
if (!notit->event_header_field) {
BT_LOGE_STR("Cannot create event header field wrapper from trace.");
status = BT_NOTIF_ITER_STATUS_ERROR;
}
notit->dscopes.event_header =
- bt_event_header_field_borrow_field(notit->event_header_field);
+ bt_private_event_header_field_borrow_private_field(
+ notit->event_header_field);
BT_ASSERT(notit->dscopes.event_header);
}
struct bt_notif_iter *notit)
{
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
- struct bt_notification *notif = NULL;
+ struct bt_private_notification *notif = NULL;
BT_ASSERT(notit->meta.ec);
BT_ASSERT(notit->packet);
notit->meta.ec->name->str,
notit->packet);
BT_ASSERT(notit->notif_iter);
- notif = bt_notification_event_create(notit->notif_iter,
+ notif = bt_private_notification_event_create(notit->notif_iter,
notit->meta.ec->ir_ec, notit->packet);
if (!notif) {
BT_LOGE("Cannot create event notification: "
goto end;
}
- notit->event = bt_notification_event_borrow_event(notit->event_notif);
+ notit->event = bt_private_notification_event_borrow_private_event(
+ notit->event_notif);
BT_ASSERT(notit->event);
if (notit->event_header_field) {
int ret;
BT_ASSERT(notit->event);
- ret = bt_event_move_header(notit->event,
+ ret = bt_private_event_move_private_header_field(notit->event,
notit->event_header_field);
if (ret) {
status = BT_NOTIF_ITER_STATUS_ERROR;
* the same value as the event header field within
* notit->event.
*/
- BT_ASSERT(bt_event_borrow_header_field(notit->event) ==
- notit->dscopes.event_header);
+ BT_ASSERT(bt_private_event_borrow_header_private_field(
+ notit->event) == notit->dscopes.event_header);
}
notit->state = STATE_DSCOPE_EVENT_COMMON_CONTEXT_BEGIN;
if (event_common_context_fc->in_ir) {
BT_ASSERT(!notit->dscopes.event_common_context);
notit->dscopes.event_common_context =
- bt_event_borrow_common_context_field(notit->event);
+ bt_private_event_borrow_common_context_private_field(
+ notit->event);
BT_ASSERT(notit->dscopes.event_common_context);
}
if (event_spec_context_fc->in_ir) {
BT_ASSERT(!notit->dscopes.event_spec_context);
- notit->dscopes.event_spec_context = bt_event_borrow_specific_context_field(
- notit->event);
+ notit->dscopes.event_spec_context =
+ bt_private_event_borrow_specific_context_private_field(
+ notit->event);
BT_ASSERT(notit->dscopes.event_spec_context);
}
if (event_payload_fc->in_ir) {
BT_ASSERT(!notit->dscopes.event_payload);
- notit->dscopes.event_payload = bt_event_borrow_payload_field(
- notit->event);
+ notit->dscopes.event_payload =
+ bt_private_event_borrow_payload_private_field(
+ notit->event);
BT_ASSERT(notit->dscopes.event_payload);
}
notit->cur_dscope_field = NULL;
if (notit->packet_header_field) {
- bt_packet_header_field_release(notit->packet_header_field);
+ bt_private_packet_header_field_release(notit->packet_header_field);
notit->packet_header_field = NULL;
}
if (notit->packet_context_field) {
- bt_packet_context_field_release(notit->packet_context_field);
+ bt_private_packet_context_field_release(notit->packet_context_field);
notit->packet_context_field = NULL;
}
if (notit->event_header_field) {
- bt_event_header_field_release(notit->event_header_field);
+ bt_private_event_header_field_release(notit->event_header_field);
notit->event_header_field = NULL;
}
}
static
-struct bt_field *borrow_next_field(struct bt_notif_iter *notit)
+struct bt_private_field *borrow_next_field(struct bt_notif_iter *notit)
{
- struct bt_field *next_field = NULL;
- struct bt_field *base_field;
- struct bt_field_class *base_fc;
+ struct bt_private_field *next_field = NULL;
+ struct bt_private_field *base_field;
+ struct bt_private_field_class *base_fc;
size_t index;
BT_ASSERT(!stack_empty(notit->stack));
index = stack_top(notit->stack)->index;
base_field = stack_top(notit->stack)->base;
BT_ASSERT(base_field);
- base_fc = bt_field_borrow_class(base_field);
+ base_fc = bt_private_field_borrow_private_class(base_field);
BT_ASSERT(base_fc);
- switch (bt_field_class_get_type(base_fc)) {
+ switch (bt_field_class_get_type(bt_field_class_borrow_from_private(base_fc))) {
case BT_FIELD_CLASS_TYPE_STRUCTURE:
{
BT_ASSERT(index <
bt_field_class_structure_get_member_count(
- bt_field_borrow_class(base_field)));
- next_field = bt_field_structure_borrow_member_field_by_index(
- base_field, index);
+ bt_field_class_borrow_from_private(
+ bt_private_field_borrow_private_class(
+ base_field))));
+ next_field =
+ bt_private_field_structure_borrow_member_private_field_by_index(
+ base_field, index);
break;
}
case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
- BT_ASSERT(index < bt_field_array_get_length(base_field));
- next_field = bt_field_array_borrow_element_field_by_index(
+ BT_ASSERT(index < bt_field_array_get_length(
+ bt_field_borrow_from_private(base_field)));
+ next_field = bt_private_field_array_borrow_element_private_field_by_index(
base_field, index);
break;
case BT_FIELD_CLASS_TYPE_VARIANT:
BT_ASSERT(index == 0);
- next_field = bt_field_variant_borrow_selected_option_field(
+ next_field = bt_private_field_variant_borrow_selected_option_private_field(
base_field);
break;
default:
{
struct bt_notif_iter *notit = data;
enum bt_bfcr_status status = BT_BFCR_STATUS_OK;
- struct bt_field *field = NULL;
+ struct bt_private_field *field = NULL;
struct ctf_field_class_int *int_fc = (void *) fc;
BT_LOGV("Unsigned integer function called from BFCR: "
field = borrow_next_field(notit);
BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
- BT_ASSERT(bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER ||
- bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION);
- bt_field_unsigned_integer_set_value(field, value);
+ BT_ASSERT(bt_private_field_borrow_private_class(field) == fc->ir_fc);
+ BT_ASSERT(bt_field_get_class_type(
+ bt_field_borrow_from_private(field)) ==
+ BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER ||
+ bt_field_get_class_type(bt_field_borrow_from_private(field)) ==
+ BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION);
+ bt_private_field_unsigned_integer_set_value(field, value);
stack_top(notit->stack)->index++;
end:
int ret;
struct bt_notif_iter *notit = data;
enum bt_bfcr_status status = BT_BFCR_STATUS_OK;
- struct bt_field *string_field = NULL;
+ struct bt_private_field *string_field = NULL;
struct ctf_field_class_int *int_fc = (void *) fc;
char str[2] = {'\0', '\0'};
}
string_field = stack_top(notit->stack)->base;
- BT_ASSERT(bt_field_get_class_type(string_field) == BT_FIELD_CLASS_TYPE_STRING);
+ BT_ASSERT(bt_field_get_class_type(
+ bt_field_borrow_from_private(string_field)) ==
+ BT_FIELD_CLASS_TYPE_STRING);
/* Append character */
str[0] = (char) value;
- ret = bt_field_string_append_with_length(string_field, str, 1);
+ ret = bt_private_field_string_append_with_length(string_field, str, 1);
if (ret) {
BT_LOGE("Cannot append character to string field's value: "
"notit-addr=%p, field-addr=%p, ret=%d",
struct ctf_field_class *fc, void *data)
{
enum bt_bfcr_status status = BT_BFCR_STATUS_OK;
- struct bt_field *field = NULL;
+ struct bt_private_field *field = NULL;
struct bt_notif_iter *notit = data;
struct ctf_field_class_int *int_fc = (void *) fc;
field = borrow_next_field(notit);
BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
- BT_ASSERT(bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER ||
- bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION);
- bt_field_signed_integer_set_value(field, value);
+ BT_ASSERT(bt_private_field_borrow_private_class(field) == fc->ir_fc);
+ BT_ASSERT(bt_field_get_class_type(
+ bt_field_borrow_from_private(field)) ==
+ BT_FIELD_CLASS_TYPE_SIGNED_INTEGER ||
+ bt_field_get_class_type(bt_field_borrow_from_private(field)) ==
+ BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION);
+ bt_private_field_signed_integer_set_value(field, value);
stack_top(notit->stack)->index++;
end:
struct ctf_field_class *fc, void *data)
{
enum bt_bfcr_status status = BT_BFCR_STATUS_OK;
- struct bt_field *field = NULL;
+ struct bt_private_field *field = NULL;
struct bt_notif_iter *notit = data;
BT_LOGV("Floating point number function called from BFCR: "
BT_ASSERT(fc->in_ir);
field = borrow_next_field(notit);
BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
- BT_ASSERT(bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_REAL);
- bt_field_real_set_value(field, value);
+ BT_ASSERT(bt_private_field_borrow_private_class(field) == fc->ir_fc);
+ BT_ASSERT(bt_field_get_class_type(
+ bt_field_borrow_from_private(field)) ==
+ BT_FIELD_CLASS_TYPE_REAL);
+ bt_private_field_real_set_value(field, value);
stack_top(notit->stack)->index++;
return status;
}
enum bt_bfcr_status bfcr_string_begin_cb(
struct ctf_field_class *fc, void *data)
{
- struct bt_field *field = NULL;
+ struct bt_private_field *field = NULL;
struct bt_notif_iter *notit = data;
int ret;
BT_ASSERT(fc->in_ir);
field = borrow_next_field(notit);
BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
- BT_ASSERT(bt_field_get_class_type(field) == BT_FIELD_CLASS_TYPE_STRING);
- ret = bt_field_string_clear(field);
+ BT_ASSERT(bt_private_field_borrow_private_class(field) == fc->ir_fc);
+ BT_ASSERT(bt_field_get_class_type(
+ bt_field_borrow_from_private(field)) ==
+ BT_FIELD_CLASS_TYPE_STRING);
+ ret = bt_private_field_string_clear(field);
BT_ASSERT(ret == 0);
/*
size_t len, struct ctf_field_class *fc, void *data)
{
enum bt_bfcr_status status = BT_BFCR_STATUS_OK;
- struct bt_field *field = NULL;
+ struct bt_private_field *field = NULL;
struct bt_notif_iter *notit = data;
int ret;
BT_ASSERT(field);
/* Append current substring */
- ret = bt_field_string_append_with_length(field, value, len);
+ ret = bt_private_field_string_append_with_length(field, value, len);
if (ret) {
BT_LOGE("Cannot append substring to string field's value: "
"notit-addr=%p, field-addr=%p, string-length=%zu, "
struct ctf_field_class *fc, void *data)
{
struct bt_notif_iter *notit = data;
- struct bt_field *field;
+ struct bt_private_field *field;
BT_LOGV("Compound (beginning) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
/* Push field */
BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
+ BT_ASSERT(bt_private_field_borrow_private_class(field) == fc->ir_fc);
stack_push(notit->stack, field);
/*
if (array_fc->is_text) {
int ret;
- BT_ASSERT(bt_field_get_class_type(field) ==
+ BT_ASSERT(bt_field_get_class_type(
+ bt_field_borrow_from_private(field)) ==
BT_FIELD_CLASS_TYPE_STRING);
notit->done_filling_string = false;
- ret = bt_field_string_clear(field);
+ ret = bt_private_field_string_clear(field);
BT_ASSERT(ret == 0);
bt_bfcr_set_unsigned_int_cb(notit->bfcr,
bfcr_unsigned_int_char_cb);
}
BT_ASSERT(!stack_empty(notit->stack));
- BT_ASSERT(bt_field_borrow_class(stack_top(notit->stack)->base) ==
+ BT_ASSERT(bt_private_field_borrow_private_class(stack_top(notit->stack)->base) ==
fc->ir_fc);
/*
if (array_fc->is_text) {
BT_ASSERT(bt_field_get_class_type(
- stack_top(notit->stack)->base) ==
- BT_FIELD_CLASS_TYPE_STRING);
+ bt_field_borrow_from_private(
+ stack_top(notit->stack)->base)) ==
+ BT_FIELD_CLASS_TYPE_STRING);
bt_bfcr_set_unsigned_int_cb(notit->bfcr,
bfcr_unsigned_int_cb);
}
static
int64_t bfcr_get_sequence_length_cb(struct ctf_field_class *fc, void *data)
{
- struct bt_field *seq_field;
+ struct bt_private_field *seq_field;
struct bt_notif_iter *notit = data;
struct ctf_field_class_sequence *seq_fc = (void *) fc;
int64_t length = -1;
seq_fc->stored_length_index);
seq_field = stack_top(notit->stack)->base;
BT_ASSERT(seq_field);
- ret = bt_field_dynamic_array_set_length(seq_field, (uint64_t) length);
+ ret = bt_private_field_dynamic_array_set_length(seq_field, (uint64_t) length);
if (ret) {
BT_LOGE("Cannot set dynamic array field's length field: "
"notit-addr=%p, field-addr=%p, "
var_fc, (uint64_t) option_index);
if (selected_option->fc->in_ir) {
- struct bt_field *var_field = stack_top(notit->stack)->base;
+ struct bt_private_field *var_field = stack_top(notit->stack)->base;
- ret = bt_field_variant_select_option_field(var_field,
- option_index);
+ ret = bt_private_field_variant_select_option_private_field(
+ var_field, option_index);
if (ret) {
BT_LOGW("Cannot select variant field's option field: "
"notit-addr=%p, var-field-addr=%p, "
static
void set_event_default_clock_value(struct bt_notif_iter *notit)
{
- struct bt_event *event = bt_notification_event_borrow_event(
- notit->event_notif);
- struct bt_stream_class *sc = notit->meta.sc->ir_sc;
+ struct bt_private_event *event =
+ bt_private_notification_event_borrow_private_event(
+ notit->event_notif);
+ struct bt_stream_class *sc = bt_stream_class_borrow_from_private(
+ notit->meta.sc->ir_sc);
BT_ASSERT(event);
if (bt_stream_class_borrow_default_clock_class(sc)) {
- int ret = bt_event_set_default_clock_value(event,
+ int ret = bt_private_event_set_default_clock_value(event,
notit->default_clock_val);
BT_ASSERT(ret == 0);
static
void notify_new_stream(struct bt_notif_iter *notit,
- struct bt_notification **notification)
+ struct bt_private_notification **notification)
{
enum bt_notif_iter_status status;
- struct bt_notification *ret = NULL;
+ struct bt_private_notification *ret = NULL;
status = set_current_stream(notit);
if (status != BT_NOTIF_ITER_STATUS_OK) {
BT_ASSERT(notit->stream);
BT_ASSERT(notit->notif_iter);
- ret = bt_notification_stream_begin_create(notit->notif_iter,
+ ret = bt_private_notification_stream_begin_create(notit->notif_iter,
notit->stream);
if (!ret) {
BT_LOGE("Cannot create stream beginning notification: "
static
void notify_end_of_stream(struct bt_notif_iter *notit,
- struct bt_notification **notification)
+ struct bt_private_notification **notification)
{
- struct bt_notification *ret;
+ struct bt_private_notification *ret;
if (!notit->stream) {
BT_LOGE("Cannot create stream for stream notification: "
}
BT_ASSERT(notit->notif_iter);
- ret = bt_notification_stream_end_create(notit->notif_iter,
+ ret = bt_private_notification_stream_end_create(notit->notif_iter,
notit->stream);
if (!ret) {
BT_LOGE("Cannot create stream beginning notification: "
static
void notify_new_packet(struct bt_notif_iter *notit,
- struct bt_notification **notification)
+ struct bt_private_notification **notification)
{
int ret;
enum bt_notif_iter_status status;
- struct bt_notification *notif = NULL;
+ struct bt_private_notification *notif = NULL;
struct bt_stream_class *sc;
status = set_current_packet(notit);
}
BT_ASSERT(notit->packet);
- sc = notit->meta.sc->ir_sc;
+ sc = bt_stream_class_borrow_from_private(notit->meta.sc->ir_sc);
BT_ASSERT(sc);
if (bt_stream_class_packets_have_discarded_event_counter_snapshot(sc)) {
BT_ASSERT(notit->snapshots.discarded_events != UINT64_C(-1));
- ret = bt_packet_set_discarded_event_counter_snapshot(
+ ret = bt_private_packet_set_discarded_event_counter_snapshot(
notit->packet, notit->snapshots.discarded_events);
BT_ASSERT(ret == 0);
}
if (bt_stream_class_packets_have_packet_counter_snapshot(sc)) {
BT_ASSERT(notit->snapshots.packets != UINT64_C(-1));
- ret = bt_packet_set_packet_counter_snapshot(
+ ret = bt_private_packet_set_packet_counter_snapshot(
notit->packet, notit->snapshots.packets);
BT_ASSERT(ret == 0);
}
if (bt_stream_class_packets_have_default_beginning_clock_value(sc)) {
BT_ASSERT(notit->snapshots.beginning_clock != UINT64_C(-1));
- ret = bt_packet_set_default_beginning_clock_value(
+ ret = bt_private_packet_set_default_beginning_clock_value(
notit->packet, notit->snapshots.beginning_clock);
BT_ASSERT(ret == 0);
}
if (bt_stream_class_packets_have_default_end_clock_value(sc)) {
BT_ASSERT(notit->snapshots.end_clock != UINT64_C(-1));
- ret = bt_packet_set_default_end_clock_value(
+ ret = bt_private_packet_set_default_end_clock_value(
notit->packet, notit->snapshots.end_clock);
BT_ASSERT(ret == 0);
}
if (notit->packet_header_field) {
- ret = bt_packet_move_header_field(notit->packet,
- notit->packet_header_field);
+ ret = bt_private_packet_move_private_header_field(
+ notit->packet, notit->packet_header_field);
if (ret) {
goto end;
}
* the same value as the packet header field within
* notit->packet.
*/
- BT_ASSERT(bt_packet_borrow_header_field(notit->packet) ==
+ BT_ASSERT(bt_private_packet_borrow_header_private_field(
+ notit->packet) ==
notit->dscopes.trace_packet_header);
}
if (notit->packet_context_field) {
- ret = bt_packet_move_context_field(notit->packet,
- notit->packet_context_field);
+ ret = bt_private_packet_move_private_context_field(
+ notit->packet, notit->packet_context_field);
if (ret) {
goto end;
}
* the same value as the packet header field within
* notit->packet.
*/
- BT_ASSERT(bt_packet_borrow_context_field(notit->packet) ==
+ BT_ASSERT(bt_private_packet_borrow_context_private_field(
+ notit->packet) ==
notit->dscopes.stream_packet_context);
}
BT_ASSERT(notit->notif_iter);
- notif = bt_notification_packet_begin_create(notit->notif_iter,
+ notif = bt_private_notification_packet_begin_create(notit->notif_iter,
notit->packet);
if (!notif) {
BT_LOGE("Cannot create packet beginning notification: "
static
void notify_end_of_packet(struct bt_notif_iter *notit,
- struct bt_notification **notification)
+ struct bt_private_notification **notification)
{
- struct bt_notification *notif;
+ struct bt_private_notification *notif;
if (!notit->packet) {
return;
}
BT_ASSERT(notit->notif_iter);
- notif = bt_notification_packet_end_create(notit->notif_iter,
+ notif = bt_private_notification_packet_end_create(notit->notif_iter,
notit->packet);
if (!notif) {
BT_LOGE("Cannot create packet end notification: "
enum bt_notif_iter_status bt_notif_iter_get_next_notification(
struct bt_notif_iter *notit,
struct bt_private_connection_private_notification_iterator *notif_iter,
- struct bt_notification **notification)
+ struct bt_private_notification **notification)
{
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
BT_HIDDEN
enum bt_notif_iter_status bt_notif_iter_borrow_packet_header_context_fields(
struct bt_notif_iter *notit,
- struct bt_field **packet_header_field,
- struct bt_field **packet_context_field)
+ struct bt_private_field **packet_header_field,
+ struct bt_private_field **packet_context_field)
{
int ret;
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
* @returns Stream instance (weak reference) or
* \c NULL on error
*/
- struct bt_stream * (* borrow_stream)(
- struct bt_stream_class *stream_class,
+ struct bt_private_stream * (* borrow_stream)(
+ struct bt_private_stream_class *stream_class,
int64_t stream_id, void *data);
};
enum bt_notif_iter_status bt_notif_iter_get_next_notification(
struct bt_notif_iter *notit,
struct bt_private_connection_private_notification_iterator *notif_iter,
- struct bt_notification **notification);
+ struct bt_private_notification **notification);
/**
* Returns the first packet header and context fields. This function
BT_HIDDEN
enum bt_notif_iter_status bt_notif_iter_borrow_packet_header_context_fields(
struct bt_notif_iter *notit,
- struct bt_field **packet_header_field,
- struct bt_field **packet_context_field);
+ struct bt_private_field **packet_header_field,
+ struct bt_private_field **packet_context_field);
struct bt_notif_iter_packet_properties {
uint64_t exp_packet_total_size;
}
static
-struct bt_stream *medop_borrow_stream(
- struct bt_stream_class *stream_class, int64_t stream_id,
+struct bt_private_stream *medop_borrow_stream(
+ struct bt_private_stream_class *stream_class, int64_t stream_id,
void *data)
{
struct ctf_fs_ds_file *ds_file = data;
- struct bt_stream_class *ds_file_stream_class;
- struct bt_stream *stream = NULL;
+ struct bt_private_stream_class *ds_file_stream_class;
+ struct bt_private_stream *stream = NULL;
+
+ ds_file_stream_class = bt_private_stream_borrow_private_class(
+ ds_file->stream);
- ds_file_stream_class = bt_stream_borrow_class(ds_file->stream);
if (stream_class != ds_file_stream_class) {
/*
* Not supported: two packets described by two different
}
static
-int convert_cycles_to_ns(struct bt_clock_class *clock_class,
+int convert_cycles_to_ns(struct bt_private_clock_class *clock_class,
uint64_t cycles, int64_t *ns)
{
- return bt_clock_class_cycles_to_ns_from_origin(clock_class, cycles, ns);
+ return bt_clock_class_cycles_to_ns_from_origin(
+ bt_clock_class_borrow_from_private(clock_class), cycles, ns);
}
static
struct ctf_fs_trace *ctf_fs_trace,
struct bt_private_connection_private_notification_iterator *pc_notif_iter,
struct bt_notif_iter *notif_iter,
- struct bt_stream *stream, const char *path)
+ struct bt_private_stream *stream, const char *path)
{
int ret;
const size_t page_size = bt_common_get_page_size();
return;
}
- bt_object_put_ref(ds_file->cc_prio_map);
bt_object_put_ref(ds_file->stream);
(void) ds_file_munmap(ds_file);
BT_HIDDEN
enum bt_notification_iterator_status ctf_fs_ds_file_next(
struct ctf_fs_ds_file *ds_file,
- struct bt_notification **notif)
+ struct bt_private_notification **notif)
{
enum bt_notif_iter_status notif_iter_status;
enum bt_notification_iterator_status status;
BT_HIDDEN
int ctf_fs_ds_file_borrow_packet_header_context_fields(
struct ctf_fs_ds_file *ds_file,
- struct bt_field **packet_header_field,
- struct bt_field **packet_context_field)
+ struct bt_private_field **packet_header_field,
+ struct bt_private_field **packet_context_field)
{
enum bt_notif_iter_status notif_iter_status;
int ret = 0;
struct ctf_fs_file *file;
/* Owned by this */
- struct bt_stream *stream;
-
- /* Owned by this */
- struct bt_clock_class_priority_map *cc_prio_map;
+ struct bt_private_stream *stream;
/* Weak */
struct bt_notif_iter *notif_iter;
struct ctf_fs_trace *ctf_fs_trace,
struct bt_private_connection_private_notification_iterator *pc_notif_iter,
struct bt_notif_iter *notif_iter,
- struct bt_stream *stream, const char *path);
+ struct bt_private_stream *stream, const char *path);
BT_HIDDEN
int ctf_fs_ds_file_borrow_packet_header_context_fields(
struct ctf_fs_ds_file *ds_file,
- struct bt_field **packet_header_field,
- struct bt_field **packet_context_field);
+ struct bt_private_field **packet_header_field,
+ struct bt_private_field **packet_context_field);
BT_HIDDEN
void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *stream);
BT_HIDDEN
enum bt_notification_iterator_status ctf_fs_ds_file_next(
struct ctf_fs_ds_file *ds_file,
- struct bt_notification **notif);
+ struct bt_private_notification **notif);
BT_HIDDEN
struct ctf_fs_ds_index *ctf_fs_ds_file_build_index(
struct bt_notification **notif)
{
enum bt_notification_iterator_status status;
+ struct bt_private_notification *priv_notif;
int ret;
BT_ASSERT(notif_iter_data->ds_file);
- status = ctf_fs_ds_file_next(notif_iter_data->ds_file, notif);
+ status = ctf_fs_ds_file_next(notif_iter_data->ds_file, &priv_notif);
+ *notif = bt_notification_borrow_from_private(priv_notif);
if (status == BT_NOTIFICATION_ITERATOR_STATUS_OK &&
bt_notification_get_type(*notif) ==
*/
BT_OBJECT_PUT_REF_AND_RESET(*notif);
status = ctf_fs_ds_file_next(notif_iter_data->ds_file,
- notif);
+ &priv_notif);
+ *notif = bt_notification_borrow_from_private(priv_notif);
BT_ASSERT(status != BT_NOTIFICATION_ITERATOR_STATUS_END);
goto end;
} else {
goto end;
}
- status = ctf_fs_ds_file_next(notif_iter_data->ds_file, notif);
+ status = ctf_fs_ds_file_next(notif_iter_data->ds_file, &priv_notif);
+ *notif = bt_notification_borrow_from_private(priv_notif);
/*
* If we get a notification, we expect to get a
BT_NOTIFICATION_TYPE_STREAM_BEGIN);
BT_OBJECT_PUT_REF_AND_RESET(*notif);
status = ctf_fs_ds_file_next(notif_iter_data->ds_file,
- notif);
+ &priv_notif);
+ *notif = bt_notification_borrow_from_private(priv_notif);
BT_ASSERT(status != BT_NOTIFICATION_ITERATOR_STATUS_END);
}
}
static
struct ctf_fs_ds_file_group *ctf_fs_ds_file_group_create(
struct ctf_fs_trace *ctf_fs_trace,
- struct bt_stream_class *stream_class,
+ struct bt_private_stream_class *stream_class,
uint64_t stream_instance_id)
{
struct ctf_fs_ds_file_group *ds_file_group;
static
int add_ds_file_to_ds_file_group(struct ctf_fs_trace *ctf_fs_trace,
- struct bt_graph *graph, const char *path)
+ const char *path)
{
- struct bt_stream_class *stream_class = NULL;
+ struct bt_private_stream_class *stream_class = NULL;
int64_t stream_instance_id = -1;
int64_t begin_ns = -1;
struct ctf_fs_ds_file_group *ds_file_group = NULL;
if (props.snapshots.beginning_clock != UINT64_C(-1)) {
BT_ASSERT(sc->default_clock_class);
ret = bt_clock_class_cycles_to_ns_from_origin(
- sc->default_clock_class,
+ bt_clock_class_borrow_from_private(
+ sc->default_clock_class),
props.snapshots.beginning_clock, &begin_ns);
if (ret) {
BT_LOGE("Cannot convert clock cycles to nanoseconds from origin (`%s`).",
}
static
-int create_ds_file_groups(struct ctf_fs_trace *ctf_fs_trace,
- struct bt_graph *graph)
+int create_ds_file_groups(struct ctf_fs_trace *ctf_fs_trace)
{
int ret = 0;
const char *basename;
continue;
}
- ret = add_ds_file_to_ds_file_group(ctf_fs_trace, graph,
+ ret = add_ds_file_to_ds_file_group(ctf_fs_trace,
file->path->str);
if (ret) {
BT_LOGE("Cannot add stream file `%s` to stream file group",
if (ds_file_group->stream_id == UINT64_C(-1)) {
/* No stream ID: use 0 */
- ds_file_group->stream = bt_stream_create_with_id(
+ ds_file_group->stream = bt_private_stream_create_with_id(
ds_file_group->stream_class,
ctf_fs_trace->next_stream_id);
ctf_fs_trace->next_stream_id++;
} else {
/* Specific stream ID */
- ds_file_group->stream = bt_stream_create_with_id(
+ ds_file_group->stream = bt_private_stream_create_with_id(
ds_file_group->stream_class,
(uint64_t) ds_file_group->stream_id);
}
goto error;
}
- ret = bt_stream_set_name(ds_file_group->stream, name->str);
+ ret = bt_private_stream_set_name(ds_file_group->stream,
+ name->str);
if (ret) {
BT_LOGE("Cannot set stream's name: "
"addr=%p, stream-name=\"%s\"",
BT_HIDDEN
struct ctf_fs_trace *ctf_fs_trace_create(const char *path, const char *name,
- struct ctf_fs_metadata_config *metadata_config,
- struct bt_graph *graph)
+ struct ctf_fs_metadata_config *metadata_config)
{
struct ctf_fs_trace *ctf_fs_trace;
int ret;
goto error;
}
- ret = create_ds_file_groups(ctf_fs_trace, graph);
+ ret = create_ds_file_groups(ctf_fs_trace);
if (ret) {
goto error;
}
* trace needs. There won't be any more. Therefore it is safe to
* make this trace static.
*/
- (void) bt_trace_make_static(ctf_fs_trace->metadata->trace);
+ (void) bt_private_trace_make_static(ctf_fs_trace->metadata->trace);
goto end;
tn_node = g_list_next(tn_node)) {
GString *trace_path = tp_node->data;
GString *trace_name = tn_node->data;
- struct bt_graph *graph = bt_component_borrow_graph(
- bt_component_borrow_from_private(ctf_fs->priv_comp));
- BT_ASSERT(graph);
ctf_fs_trace = ctf_fs_trace_create(trace_path->str,
- trace_name->str, &ctf_fs->metadata_config,
- graph);
+ trace_name->str, &ctf_fs->metadata_config);
if (!ctf_fs_trace) {
BT_LOGE("Cannot create trace for `%s`.",
trace_path->str);
struct ctf_metadata_decoder *decoder;
/* Owned by this */
- struct bt_trace *trace;
+ struct bt_private_trace *trace;
/* Weak (owned by `decoder` above) */
struct ctf_trace_class *tc;
GPtrArray *ds_file_infos;
/* Owned by this */
- struct bt_stream_class *stream_class;
+ struct bt_private_stream_class *stream_class;
/* Owned by this */
- struct bt_stream *stream;
+ struct bt_private_stream *stream;
/* Stream (instance) ID; -1ULL means none */
uint64_t stream_id;
BT_HIDDEN
struct ctf_fs_trace *ctf_fs_trace_create(const char *path, const char *name,
- struct ctf_fs_metadata_config *config, struct bt_graph *graph);
+ struct ctf_fs_metadata_config *config);
BT_HIDDEN
void ctf_fs_trace_destroy(struct ctf_fs_trace *trace);
}
static
-int add_stream_ids(struct bt_private_value *info, struct bt_stream *stream)
+int add_stream_ids(struct bt_private_value *info,
+ struct bt_stream *stream)
{
int ret = 0;
int64_t stream_class_id, stream_instance_id;
goto end;
}
- ret = add_stream_ids(group_info, group->stream);
+ ret = add_stream_ids(group_info,
+ bt_stream_borrow_from_private(group->stream));
if (ret) {
goto end;
}
goto end;
}
- trace = ctf_fs_trace_create(trace_path, trace_name, NULL, NULL);
+ trace = ctf_fs_trace_create(trace_path, trace_name, NULL);
if (!trace) {
BT_LOGE("Failed to create fs trace at \'%s\'", trace_path);
ret = -1;
name = bt_event_class_get_name(event_class);
- writer_event_class = bt_event_class_create(name);
+ writer_event_class = bt_private_event_class_create(name);
BT_ASSERT(writer_event_class);
id = bt_event_class_get_id(event_class);
goto error;
}
- ret = bt_event_class_set_log_level(writer_event_class, log_level);
+ ret = bt_private_event_class_set_log_level(writer_event_class, log_level);
if (ret) {
BT_LOGE_STR("Failed to set log_level.");
goto error;
emf_uri = bt_event_class_get_emf_uri(event_class);
if (emf_uri) {
- ret = bt_event_class_set_emf_uri(writer_event_class,
+ ret = bt_private_event_class_set_emf_uri(writer_event_class,
emf_uri);
if (ret) {
BT_LOGE_STR("Failed to set emf uri.");
char *linebuf;
size_t linebuf_len;
FILE *fp;
- struct bt_notification *tmp_event_notif;
+ struct bt_private_notification *tmp_event_notif;
enum {
STATE_EMIT_STREAM_BEGINNING,
bt_bool no_timestamp;
} params;
- struct bt_trace *trace;
- struct bt_stream_class *stream_class;
- struct bt_event_class *event_class;
- struct bt_stream *stream;
- struct bt_packet *packet;
- struct bt_clock_class *clock_class;
- struct bt_clock_class_priority_map *cc_prio_map;
+ struct bt_private_trace *trace;
+ struct bt_private_stream_class *stream_class;
+ struct bt_private_event_class *event_class;
+ struct bt_private_stream *stream;
+ struct bt_private_packet *packet;
+ struct bt_private_clock_class *clock_class;
};
static
-struct bt_field_class *create_event_payload_fc(void)
+struct bt_private_field_class *create_event_payload_fc(void)
{
- struct bt_field_class *root_fc = NULL;
- struct bt_field_class *fc = NULL;
+ struct bt_private_field_class *root_fc = NULL;
+ struct bt_private_field_class *fc = NULL;
int ret;
- root_fc = bt_field_class_structure_create();
+ root_fc = bt_private_field_class_structure_create();
if (!root_fc) {
BT_LOGE_STR("Cannot create an empty structure field class object.");
goto error;
}
- fc = bt_field_class_string_create();
+ fc = bt_private_field_class_string_create();
if (!fc) {
BT_LOGE_STR("Cannot create a string field class object.");
goto error;
}
- ret = bt_field_class_structure_append_member(root_fc, "str", fc);
+ ret = bt_private_field_class_structure_append_private_member(root_fc,
+ "str", fc);
if (ret) {
BT_LOGE("Cannot add `str` member to structure field class: "
"ret=%d", ret);
static
int create_meta(struct dmesg_component *dmesg_comp, bool has_ts)
{
- struct bt_field_class *fc = NULL;
+ struct bt_private_field_class *fc = NULL;
const char *trace_name = NULL;
gchar *basename = NULL;
int ret = 0;
- dmesg_comp->trace = bt_trace_create();
+ dmesg_comp->trace = bt_private_trace_create();
if (!dmesg_comp->trace) {
BT_LOGE_STR("Cannot create an empty trace object.");
goto error;
}
if (trace_name) {
- ret = bt_trace_set_name(dmesg_comp->trace, trace_name);
+ ret = bt_private_trace_set_name(dmesg_comp->trace, trace_name);
if (ret) {
BT_LOGE("Cannot set trace's name: name=\"%s\"", trace_name);
goto error;
}
}
- dmesg_comp->stream_class = bt_stream_class_create(dmesg_comp->trace);
+ dmesg_comp->stream_class = bt_private_stream_class_create(
+ dmesg_comp->trace);
if (!dmesg_comp->stream_class) {
BT_LOGE_STR("Cannot create a stream class object.");
goto error;
}
if (has_ts) {
- dmesg_comp->clock_class = bt_clock_class_create();
+ dmesg_comp->clock_class = bt_private_clock_class_create();
if (!dmesg_comp->clock_class) {
BT_LOGE_STR("Cannot create clock class.");
goto error;
}
- ret = bt_stream_class_set_default_clock_class(
- dmesg_comp->stream_class, dmesg_comp->clock_class);
+ ret = bt_private_stream_class_set_default_clock_class(
+ dmesg_comp->stream_class,
+ bt_clock_class_borrow_from_private(
+ dmesg_comp->clock_class));
if (ret) {
BT_LOGE_STR("Cannot set stream class's default clock class.");
goto error;
}
}
- dmesg_comp->event_class = bt_event_class_create(
+ dmesg_comp->event_class = bt_private_event_class_create(
dmesg_comp->stream_class);
if (!dmesg_comp->event_class) {
BT_LOGE_STR("Cannot create an event class object.");
goto error;
}
- ret = bt_event_class_set_name(dmesg_comp->event_class, "string");
+ ret = bt_private_event_class_set_name(dmesg_comp->event_class, "string");
if (ret) {
BT_LOGE_STR("Cannot set event class's name.");
goto error;
goto error;
}
- ret = bt_event_class_set_payload_field_class(dmesg_comp->event_class, fc);
+ ret = bt_private_event_class_set_payload_private_field_class(dmesg_comp->event_class, fc);
if (ret) {
BT_LOGE_STR("Cannot set event class's event payload field class.");
goto error;
{
int ret = 0;
- dmesg_comp->stream = bt_stream_create(dmesg_comp->stream_class);
+ dmesg_comp->stream = bt_private_stream_create(dmesg_comp->stream_class);
if (!dmesg_comp->stream) {
BT_LOGE_STR("Cannot create stream object.");
goto error;
}
- dmesg_comp->packet = bt_packet_create(dmesg_comp->stream);
+ dmesg_comp->packet = bt_private_packet_create(dmesg_comp->stream);
if (!dmesg_comp->packet) {
BT_LOGE_STR("Cannot create packet object.");
goto error;
}
- ret = bt_trace_make_static(dmesg_comp->trace);
+ ret = bt_private_trace_make_static(dmesg_comp->trace);
if (ret) {
BT_LOGE_STR("Cannot make trace static.");
goto error;
bt_object_put_ref(dmesg_comp->event_class);
bt_object_put_ref(dmesg_comp->stream);
bt_object_put_ref(dmesg_comp->clock_class);
- bt_object_put_ref(dmesg_comp->cc_prio_map);
g_free(dmesg_comp);
}
}
static
-struct bt_notification *create_init_event_notif_from_line(
+struct bt_private_notification *create_init_event_notif_from_line(
struct dmesg_notif_iter *notif_iter,
const char *line, const char **new_start)
{
- struct bt_event *event;
- struct bt_notification *notif = NULL;
+ struct bt_private_event *event;
+ struct bt_private_notification *notif = NULL;
bool has_timestamp = false;
unsigned long sec, usec, msec;
unsigned int year, mon, mday, hour, min;
goto error;
}
- notif = bt_notification_event_create(notif_iter->pc_notif_iter,
+ notif = bt_private_notification_event_create(notif_iter->pc_notif_iter,
dmesg_comp->event_class, dmesg_comp->packet);
if (!notif) {
BT_LOGE_STR("Cannot create event notification.");
goto error;
}
- event = bt_notification_event_borrow_event(notif);
+ event = bt_private_notification_event_borrow_private_event(notif);
BT_ASSERT(event);
if (dmesg_comp->clock_class) {
- ret = bt_event_set_default_clock_value(event, ts);
+ ret = bt_private_event_set_default_clock_value(event, ts);
BT_ASSERT(ret == 0);
}
}
static
-int fill_event_payload_from_line(const char *line, struct bt_event *event)
+int fill_event_payload_from_line(const char *line,
+ struct bt_private_event *event)
{
- struct bt_field *ep_field = NULL;
- struct bt_field *str_field = NULL;
+ struct bt_private_field *ep_field = NULL;
+ struct bt_private_field *str_field = NULL;
size_t len;
int ret;
- ep_field = bt_event_borrow_payload_field(event);
+ ep_field = bt_private_event_borrow_payload_private_field(event);
BT_ASSERT(ep_field);
- str_field = bt_field_structure_borrow_member_field_by_index(ep_field,
- 0);
+ str_field = bt_private_field_structure_borrow_member_private_field_by_index(
+ ep_field, 0);
if (!str_field) {
BT_LOGE_STR("Cannot borrow `timestamp` field from event payload structure field.");
goto error;
len--;
}
- ret = bt_field_string_clear(str_field);
+ ret = bt_private_field_string_clear(str_field);
if (ret) {
BT_LOGE_STR("Cannot clear string field object.");
goto error;
}
- ret = bt_field_string_append_with_length(str_field, line, len);
+ ret = bt_private_field_string_append_with_length(str_field, line, len);
if (ret) {
BT_LOGE("Cannot append value to string field object: "
"len=%zu", len);
}
static
-struct bt_notification *create_notif_from_line(
+struct bt_private_notification *create_notif_from_line(
struct dmesg_notif_iter *dmesg_notif_iter, const char *line)
{
- struct bt_event *event = NULL;
- struct bt_notification *notif = NULL;
+ struct bt_private_event *event = NULL;
+ struct bt_private_notification *notif = NULL;
const char *new_start;
int ret;
goto error;
}
- event = bt_notification_event_borrow_event(notif);
+ event = bt_private_notification_event_borrow_private_event(notif);
BT_ASSERT(event);
ret = fill_event_payload_from_line(new_start, event);
if (ret) {
static
enum bt_notification_iterator_status dmesg_notif_iter_next_one(
struct dmesg_notif_iter *dmesg_notif_iter,
- struct bt_notification **notif)
+ struct bt_private_notification **notif)
{
ssize_t len;
struct dmesg_component *dmesg_comp;
switch (dmesg_notif_iter->state) {
case STATE_EMIT_STREAM_BEGINNING:
BT_ASSERT(dmesg_notif_iter->tmp_event_notif);
- *notif = bt_notification_stream_begin_create(
+ *notif = bt_private_notification_stream_begin_create(
dmesg_notif_iter->pc_notif_iter, dmesg_comp->stream);
dmesg_notif_iter->state = STATE_EMIT_PACKET_BEGINNING;
break;
case STATE_EMIT_PACKET_BEGINNING:
BT_ASSERT(dmesg_notif_iter->tmp_event_notif);
- *notif = bt_notification_packet_begin_create(
+ *notif = bt_private_notification_packet_begin_create(
dmesg_notif_iter->pc_notif_iter, dmesg_comp->packet);
dmesg_notif_iter->state = STATE_EMIT_EVENT;
break;
dmesg_notif_iter->tmp_event_notif = NULL;
break;
case STATE_EMIT_PACKET_END:
- *notif = bt_notification_packet_end_create(
+ *notif = bt_private_notification_packet_end_create(
dmesg_notif_iter->pc_notif_iter, dmesg_comp->packet);
dmesg_notif_iter->state = STATE_EMIT_STREAM_END;
break;
case STATE_EMIT_STREAM_END:
- *notif = bt_notification_stream_end_create(
+ *notif = bt_private_notification_stream_end_create(
dmesg_notif_iter->pc_notif_iter, dmesg_comp->stream);
dmesg_notif_iter->state = STATE_DONE;
break;
uint64_t i = 0;
while (i < capacity && status == BT_NOTIFICATION_ITERATOR_STATUS_OK) {
- status = dmesg_notif_iter_next_one(dmesg_notif_iter, ¬ifs[i]);
+ struct bt_private_notification *priv_notif;
+
+ status = dmesg_notif_iter_next_one(dmesg_notif_iter,
+ &priv_notif);
+ notifs[i] = bt_notification_borrow_from_private(priv_notif);
if (status == BT_NOTIFICATION_ITERATOR_STATUS_OK) {
i++;
}
#include <stdbool.h>
#include <inttypes.h>
#include <string.h>
+#include <babeltrace/babeltrace.h>
#include <babeltrace/assert-internal.h>
-#include <babeltrace/trace-ir/event-class.h>
-#include <babeltrace/trace-ir/event.h>
-#include <babeltrace/trace-ir/field-classes.h>
-#include <babeltrace/trace-ir/fields.h>
-#include <babeltrace/trace-ir/packet.h>
-#include <babeltrace/trace-ir/stream-class.h>
-#include <babeltrace/trace-ir/stream.h>
-#include <babeltrace/trace-ir/trace.h>
-#include <babeltrace/graph/component-class-filter.h>
-#include <babeltrace/graph/component-class-sink.h>
-#include <babeltrace/graph/component-class-source.h>
-#include <babeltrace/graph/component-class.h>
-#include <babeltrace/graph/component-sink.h>
-#include <babeltrace/graph/component-source.h>
-#include <babeltrace/graph/component.h>
-#include <babeltrace/graph/connection.h>
-#include <babeltrace/graph/graph.h>
-#include <babeltrace/graph/notification-event.h>
-#include <babeltrace/graph/notification-iterator.h>
-#include <babeltrace/graph/notification-packet.h>
-#include <babeltrace/graph/notification-stream.h>
-#include <babeltrace/graph/output-port-notification-iterator.h>
-#include <babeltrace/graph/port.h>
-#include <babeltrace/graph/private-component-source.h>
-#include <babeltrace/graph/private-component-sink.h>
-#include <babeltrace/graph/private-component.h>
-#include <babeltrace/graph/private-connection.h>
-#include <babeltrace/graph/private-connection-notification-iterator.h>
-#include <babeltrace/graph/private-connection-private-notification-iterator.h>
-#include <babeltrace/graph/private-port.h>
-#include <babeltrace/plugin/plugin.h>
-#include <babeltrace/object.h>
#include <glib.h>
#include "tap/tap.h"
static GArray *test_events;
static struct bt_graph *graph;
static struct bt_private_connection_private_notification_iterator *cur_notif_iter;
-static struct bt_stream_class *src_stream_class;
-static struct bt_event_class *src_event_class;
-static struct bt_stream *src_stream1;
-static struct bt_stream *src_stream2;
-static struct bt_packet *src_stream1_packet1;
-static struct bt_packet *src_stream1_packet2;
-static struct bt_packet *src_stream2_packet1;
-static struct bt_packet *src_stream2_packet2;
+static struct bt_private_stream_class *src_stream_class;
+static struct bt_private_event_class *src_event_class;
+static struct bt_private_stream *src_stream1;
+static struct bt_private_stream *src_stream2;
+static struct bt_private_packet *src_stream1_packet1;
+static struct bt_private_packet *src_stream1_packet2;
+static struct bt_private_packet *src_stream2_packet1;
+static struct bt_private_packet *src_stream2_packet2;
+static struct bt_stream *pub_src_stream1;
+static struct bt_stream *pub_src_stream2;
+static struct bt_packet *pub_src_stream1_packet1;
+static struct bt_packet *pub_src_stream1_packet2;
+static struct bt_packet *pub_src_stream2_packet1;
+static struct bt_packet *pub_src_stream2_packet2;
enum {
SEQ_END = -1,
static
void init_static_data(void)
{
- struct bt_trace *trace;
+ struct bt_private_trace *trace;
/* Test events */
test_events = g_array_new(FALSE, TRUE, sizeof(struct test_event));
BT_ASSERT(test_events);
/* Metadata */
- trace = bt_trace_create();
+ trace = bt_private_trace_create();
BT_ASSERT(trace);
- src_stream_class = bt_stream_class_create(trace);
+ src_stream_class = bt_private_stream_class_create(trace);
BT_ASSERT(src_stream_class);
- src_event_class = bt_event_class_create(src_stream_class);
+ src_event_class = bt_private_event_class_create(src_stream_class);
BT_ASSERT(src_event_class);
- src_stream1 = bt_stream_create(src_stream_class);
+ src_stream1 = bt_private_stream_create(src_stream_class);
BT_ASSERT(src_stream1);
- src_stream2 = bt_stream_create(src_stream_class);
+ pub_src_stream1 = bt_stream_borrow_from_private(src_stream1);
+ src_stream2 = bt_private_stream_create(src_stream_class);
BT_ASSERT(src_stream2);
- src_stream1_packet1 = bt_packet_create(src_stream1);
+ pub_src_stream2 = bt_stream_borrow_from_private(src_stream2);
+ src_stream1_packet1 = bt_private_packet_create(src_stream1);
BT_ASSERT(src_stream1_packet1);
- src_stream1_packet2 = bt_packet_create(src_stream1);
+ pub_src_stream1_packet1 = bt_packet_borrow_from_private(
+ src_stream1_packet1);
+ src_stream1_packet2 = bt_private_packet_create(src_stream1);
BT_ASSERT(src_stream1_packet2);
- src_stream2_packet1 = bt_packet_create(src_stream2);
+ pub_src_stream1_packet2 = bt_packet_borrow_from_private(
+ src_stream1_packet2);
+ src_stream2_packet1 = bt_private_packet_create(src_stream2);
BT_ASSERT(src_stream2_packet1);
- src_stream2_packet2 = bt_packet_create(src_stream2);
+ pub_src_stream2_packet1 = bt_packet_borrow_from_private(
+ src_stream2_packet1);
+ src_stream2_packet2 = bt_private_packet_create(src_stream2);
BT_ASSERT(src_stream2_packet2);
+ pub_src_stream2_packet2 = bt_packet_borrow_from_private(
+ src_stream2_packet2);
if (debug) {
fprintf(stderr, ":: stream 1: %p\n", src_stream1);
void src_iter_next_seq_one(struct src_iter_user_data *user_data,
struct bt_notification **notif)
{
- struct bt_packet *event_packet = NULL;
+ struct bt_private_packet *event_packet = NULL;
switch (user_data->seq[user_data->at]) {
case SEQ_STREAM1_BEGIN:
- *notif = bt_notification_stream_begin_create(cur_notif_iter,
- src_stream1);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_stream_begin_create(
+ cur_notif_iter, src_stream1));
break;
case SEQ_STREAM2_BEGIN:
- *notif = bt_notification_stream_begin_create(cur_notif_iter,
- src_stream2);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_stream_begin_create(
+ cur_notif_iter, src_stream2));
break;
case SEQ_STREAM1_END:
- *notif = bt_notification_stream_end_create(cur_notif_iter,
- src_stream1);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_stream_end_create(
+ cur_notif_iter, src_stream1));
break;
case SEQ_STREAM2_END:
- *notif = bt_notification_stream_end_create(cur_notif_iter,
- src_stream2);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_stream_end_create(
+ cur_notif_iter, src_stream2));
break;
case SEQ_STREAM1_PACKET1_BEGIN:
- *notif = bt_notification_packet_begin_create(cur_notif_iter,
- src_stream1_packet1);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_packet_begin_create(
+ cur_notif_iter, src_stream1_packet1));
break;
case SEQ_STREAM1_PACKET2_BEGIN:
- *notif = bt_notification_packet_begin_create(cur_notif_iter,
- src_stream1_packet2);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_packet_begin_create(
+ cur_notif_iter, src_stream1_packet2));
break;
case SEQ_STREAM2_PACKET1_BEGIN:
- *notif = bt_notification_packet_begin_create(cur_notif_iter,
- src_stream2_packet1);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_packet_begin_create(
+ cur_notif_iter, src_stream2_packet1));
break;
case SEQ_STREAM2_PACKET2_BEGIN:
- *notif = bt_notification_packet_begin_create(cur_notif_iter,
- src_stream2_packet2);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_packet_begin_create(
+ cur_notif_iter, src_stream2_packet2));
break;
case SEQ_STREAM1_PACKET1_END:
- *notif = bt_notification_packet_end_create(cur_notif_iter,
- src_stream1_packet1);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_packet_end_create(
+ cur_notif_iter, src_stream1_packet1));
break;
case SEQ_STREAM1_PACKET2_END:
- *notif = bt_notification_packet_end_create(cur_notif_iter,
- src_stream1_packet2);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_packet_end_create(
+ cur_notif_iter, src_stream1_packet2));
break;
case SEQ_STREAM2_PACKET1_END:
- *notif = bt_notification_packet_end_create(cur_notif_iter,
- src_stream2_packet1);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_packet_end_create(
+ cur_notif_iter, src_stream2_packet1));
break;
case SEQ_STREAM2_PACKET2_END:
- *notif = bt_notification_packet_end_create(cur_notif_iter,
- src_stream2_packet2);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_packet_end_create(
+ cur_notif_iter, src_stream2_packet2));
break;
case SEQ_EVENT_STREAM1_PACKET1:
event_packet = src_stream1_packet1;
}
if (event_packet) {
- *notif = bt_notification_event_create(cur_notif_iter,
- src_event_class, event_packet);
+ *notif = bt_notification_borrow_from_private(
+ bt_private_notification_event_create(
+ cur_notif_iter, src_event_class, event_packet));
}
BT_ASSERT(*notif);
void test_no_auto_notifs(void)
{
const struct test_event expected_test_events[] = {
- { .type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN, .stream = src_stream1, .packet = NULL, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN, .stream = src_stream2, .packet = NULL, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = src_stream2, .packet = src_stream2_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream2, .packet = src_stream2_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = src_stream2, .packet = src_stream2_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = src_stream1, .packet = src_stream1_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream1, .packet = src_stream1_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_STREAM_END, .stream = src_stream2, .packet = NULL, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = src_stream1, .packet = src_stream1_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_STREAM_END, .stream = src_stream1, .packet = NULL, },
+ { .type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN, .stream = pub_src_stream1, .packet = NULL, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN, .stream = pub_src_stream2, .packet = NULL, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = pub_src_stream2, .packet = pub_src_stream2_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream2, .packet = pub_src_stream2_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = pub_src_stream2, .packet = pub_src_stream2_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = pub_src_stream1, .packet = pub_src_stream1_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream1, .packet = pub_src_stream1_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_STREAM_END, .stream = pub_src_stream2, .packet = NULL, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = pub_src_stream1, .packet = pub_src_stream1_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_STREAM_END, .stream = pub_src_stream1, .packet = NULL, },
{ .type = TEST_EV_TYPE_END, },
{ .type = TEST_EV_TYPE_SENTINEL, },
};
void test_output_port_notification_iterator(void)
{
const struct test_event expected_test_events[] = {
- { .type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN, .stream = src_stream1, .packet = NULL, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN, .stream = src_stream2, .packet = NULL, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = src_stream2, .packet = src_stream2_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream2, .packet = src_stream2_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = src_stream1, .packet = src_stream1_packet1, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = src_stream2, .packet = src_stream2_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = src_stream1, .packet = src_stream1_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = src_stream1, .packet = src_stream1_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_STREAM_END, .stream = src_stream2, .packet = NULL, },
- { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = src_stream1, .packet = src_stream1_packet2, },
- { .type = TEST_EV_TYPE_NOTIF_STREAM_END, .stream = src_stream1, .packet = NULL, },
+ { .type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN, .stream = pub_src_stream1, .packet = NULL, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN, .stream = pub_src_stream2, .packet = NULL, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = pub_src_stream2, .packet = pub_src_stream2_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream2, .packet = pub_src_stream2_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = pub_src_stream1, .packet = pub_src_stream1_packet1, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = pub_src_stream2, .packet = pub_src_stream2_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN, .stream = pub_src_stream1, .packet = pub_src_stream1_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_EVENT, .stream = pub_src_stream1, .packet = pub_src_stream1_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_STREAM_END, .stream = pub_src_stream2, .packet = NULL, },
+ { .type = TEST_EV_TYPE_NOTIF_PACKET_END, .stream = pub_src_stream1, .packet = pub_src_stream1_packet2, },
+ { .type = TEST_EV_TYPE_NOTIF_STREAM_END, .stream = pub_src_stream1, .packet = NULL, },
{ .type = TEST_EV_TYPE_END, },
{ .type = TEST_EV_TYPE_SENTINEL, },
};
upstream_port = bt_component_source_get_output_port_by_name(src_comp, "out");
notif_iter = bt_output_port_notification_iterator_create(upstream_port,
NULL);
- ok(notif_iter, "bt_output_port_notification_iterator_create() succeeds");
+ ok(notif_iter, "bt_private_output_port_notification_iterator_create() succeeds");
bt_object_put_ref(upstream_port);
/* Consume the notification iterator */
*/
#include "tap/tap.h"
-#include <babeltrace/ctf-writer/clock.h>
-#include <babeltrace/ctf-writer/event.h>
-#include <babeltrace/ctf-writer/fields.h>
-#include <babeltrace/ctf-writer/stream-class.h>
-#include <babeltrace/ctf-writer/stream.h>
-#include <babeltrace/ctf-writer/trace.h>
-#include <babeltrace/ctf-writer/writer.h>
-#include <babeltrace/trace-ir/clock-class.h>
-#include <babeltrace/trace-ir/event.h>
-#include <babeltrace/trace-ir/event-class.h>
-#include <babeltrace/trace-ir/fields.h>
-#include <babeltrace/trace-ir/stream-class.h>
-#include <babeltrace/trace-ir/stream.h>
-#include <babeltrace/trace-ir/trace.h>
+#include <babeltrace/babeltrace.h>
#include <babeltrace/object-internal.h>
#include <babeltrace/compat/stdlib-internal.h>
#include <babeltrace/assert-internal.h>
#define NR_TESTS 37
struct user {
- struct bt_trace *tc;
- struct bt_stream_class *sc;
- struct bt_event_class *ec;
- struct bt_stream *stream;
- struct bt_event *event;
+ struct bt_private_trace *tc;
+ struct bt_private_stream_class *sc;
+ struct bt_private_event_class *ec;
+ struct bt_private_stream *stream;
+ struct bt_private_event *event;
};
struct writer_user {
* - uint16_t payload_16;
* - uint32_t payload_32;
*/
-static struct bt_field_class *create_integer_struct(void)
+static struct bt_private_field_class *create_integer_struct(void)
{
int ret;
- struct bt_field_class *structure = NULL;
- struct bt_field_class *ui8 = NULL, *ui16 = NULL, *ui32 = NULL;
+ struct bt_private_field_class *structure = NULL;
+ struct bt_private_field_class *ui8 = NULL, *ui16 = NULL, *ui32 = NULL;
- structure = bt_field_class_structure_create();
+ structure = bt_private_field_class_structure_create();
BT_ASSERT(structure);
- ui8 = bt_field_class_unsigned_integer_create();
+ ui8 = bt_private_field_class_unsigned_integer_create();
BT_ASSERT(ui8);
- ret = bt_field_class_integer_set_field_value_range(ui8, 8);
+ ret = bt_private_field_class_integer_set_field_value_range(ui8, 8);
BT_ASSERT(ret == 0);
- ret = bt_field_class_structure_append_member(structure,
+ ret = bt_private_field_class_structure_append_private_member(structure,
"payload_8", ui8);
BT_ASSERT(ret == 0);
- ui16 = bt_field_class_unsigned_integer_create();
+ ui16 = bt_private_field_class_unsigned_integer_create();
BT_ASSERT(ui16);
- ret = bt_field_class_integer_set_field_value_range(ui16, 16);
+ ret = bt_private_field_class_integer_set_field_value_range(ui16, 16);
BT_ASSERT(ret == 0);
- ret = bt_field_class_structure_append_member(structure,
+ ret = bt_private_field_class_structure_append_private_member(structure,
"payload_16", ui16);
BT_ASSERT(ret == 0);
- ui32 = bt_field_class_unsigned_integer_create();
+ ui32 = bt_private_field_class_unsigned_integer_create();
BT_ASSERT(ui32);
- ret = bt_field_class_integer_set_field_value_range(ui32, 32);
+ ret = bt_private_field_class_integer_set_field_value_range(ui32, 32);
BT_ASSERT(ret == 0);
- ret = bt_field_class_structure_append_member(structure,
+ ret = bt_private_field_class_structure_append_private_member(structure,
"payload_32", ui32);
BT_ASSERT(ret == 0);
BT_OBJECT_PUT_REF_AND_RESET(ui8);
* - uint16_t payload_16;
* - uint32_t payload_32;
*/
-static struct bt_event_class *create_simple_event(struct bt_stream_class *sc,
- const char *name)
+static struct bt_private_event_class *create_simple_event(
+ struct bt_private_stream_class *sc, const char *name)
{
int ret;
- struct bt_event_class *event = NULL;
- struct bt_field_class *payload = NULL;
+ struct bt_private_event_class *event = NULL;
+ struct bt_private_field_class *payload = NULL;
BT_ASSERT(name);
- event = bt_event_class_create(sc);
+ event = bt_private_event_class_create(sc);
BT_ASSERT(event);
- ret = bt_event_class_set_name(event, name);
+ ret = bt_private_event_class_set_name(event, name);
BT_ASSERT(ret == 0);
payload = create_integer_struct();
BT_ASSERT(payload);
- ret = bt_event_class_set_payload_field_class(event, payload);
+ ret = bt_private_event_class_set_payload_private_field_class(event, payload);
BT_ASSERT(ret == 0);
BT_OBJECT_PUT_REF_AND_RESET(payload);
return event;
* - uint16_t payload_16;
* - uint32_t payload_32;
*/
-static struct bt_event_class *create_complex_event(struct bt_stream_class *sc,
+static struct bt_private_event_class *create_complex_event(
+ struct bt_private_stream_class *sc,
const char *name)
{
int ret;
- struct bt_event_class *event = NULL;
- struct bt_field_class *inner = NULL, *outer = NULL;
+ struct bt_private_event_class *event = NULL;
+ struct bt_private_field_class *inner = NULL, *outer = NULL;
BT_ASSERT(name);
- event = bt_event_class_create(sc);
+ event = bt_private_event_class_create(sc);
BT_ASSERT(event);
- ret = bt_event_class_set_name(event, name);
+ ret = bt_private_event_class_set_name(event, name);
BT_ASSERT(ret == 0);
outer = create_integer_struct();
BT_ASSERT(outer);
inner = create_integer_struct();
BT_ASSERT(inner);
- ret = bt_field_class_structure_append_member(outer,
+ ret = bt_private_field_class_structure_append_private_member(outer,
"payload_struct", inner);
BT_ASSERT(ret == 0);
- ret = bt_event_class_set_payload_field_class(event, outer);
+ ret = bt_private_event_class_set_payload_private_field_class(event, outer);
BT_ASSERT(ret == 0);
BT_OBJECT_PUT_REF_AND_RESET(inner);
BT_OBJECT_PUT_REF_AND_RESET(outer);
}
static void set_stream_class_field_classes(
- struct bt_stream_class *stream_class)
+ struct bt_private_stream_class *stream_class)
{
- struct bt_field_class *packet_context_type;
- struct bt_field_class *event_header_type;
- struct bt_field_class *fc;
+ struct bt_private_field_class *packet_context_type;
+ struct bt_private_field_class *event_header_type;
+ struct bt_private_field_class *fc;
int ret;
- packet_context_type = bt_field_class_structure_create();
+ packet_context_type = bt_private_field_class_structure_create();
BT_ASSERT(packet_context_type);
- fc = bt_field_class_unsigned_integer_create();
+ fc = bt_private_field_class_unsigned_integer_create();
BT_ASSERT(fc);
- ret = bt_field_class_integer_set_field_value_range(fc, 32);
+ ret = bt_private_field_class_integer_set_field_value_range(fc, 32);
BT_ASSERT(ret == 0);
- ret = bt_field_class_structure_append_member(packet_context_type,
+ ret = bt_private_field_class_structure_append_private_member(packet_context_type,
"packet_size", fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(fc);
- fc = bt_field_class_unsigned_integer_create();
+ fc = bt_private_field_class_unsigned_integer_create();
BT_ASSERT(fc);
- ret = bt_field_class_integer_set_field_value_range(fc, 32);
+ ret = bt_private_field_class_integer_set_field_value_range(fc, 32);
BT_ASSERT(ret == 0);
- ret = bt_field_class_structure_append_member(packet_context_type,
+ ret = bt_private_field_class_structure_append_private_member(packet_context_type,
"content_size", fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(fc);
- event_header_type = bt_field_class_structure_create();
+ event_header_type = bt_private_field_class_structure_create();
BT_ASSERT(event_header_type);
- fc = bt_field_class_unsigned_integer_create();
+ fc = bt_private_field_class_unsigned_integer_create();
BT_ASSERT(fc);
- ret = bt_field_class_integer_set_field_value_range(fc, 32);
+ ret = bt_private_field_class_integer_set_field_value_range(fc, 32);
BT_ASSERT(ret == 0);
- ret = bt_field_class_structure_append_member(event_header_type,
+ ret = bt_private_field_class_structure_append_private_member(event_header_type,
"id", fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(fc);
- ret = bt_stream_class_set_packet_context_field_class(stream_class,
- packet_context_type);
+ ret = bt_private_stream_class_set_packet_context_private_field_class(
+ stream_class, packet_context_type);
BT_ASSERT(ret == 0);
- ret = bt_stream_class_set_event_header_field_class(stream_class,
- event_header_type);
+ ret = bt_private_stream_class_set_event_header_private_field_class(
+ stream_class, event_header_type);
BT_ASSERT(ret == 0);
bt_object_put_ref(packet_context_type);
bt_object_put_ref(event_header_type);
}
-static void create_sc1(struct bt_trace *trace)
+static void create_sc1(struct bt_private_trace *trace)
{
int ret;
- struct bt_event_class *ec1 = NULL, *ec2 = NULL;
- struct bt_stream_class *sc1 = NULL, *ret_stream = NULL;
+ struct bt_private_event_class *ec1 = NULL, *ec2 = NULL;
+ struct bt_private_stream_class *sc1 = NULL, *ret_stream = NULL;
- sc1 = bt_stream_class_create(trace);
+ sc1 = bt_private_stream_class_create(trace);
BT_ASSERT(sc1);
- ret = bt_stream_class_set_name(sc1, "sc1");
+ ret = bt_private_stream_class_set_name(sc1, "sc1");
BT_ASSERT(ret == 0);
set_stream_class_field_classes(sc1);
ec1 = create_complex_event(sc1, "ec1");
BT_ASSERT(ec1);
ec2 = create_simple_event(sc1, "ec2");
BT_ASSERT(ec2);
- ret_stream = bt_event_class_borrow_stream_class(ec1);
+ ret_stream = bt_private_event_class_borrow_private_stream_class(ec1);
ok(ret_stream == sc1, "Borrow parent stream SC1 from EC1");
- ret_stream = bt_event_class_borrow_stream_class(ec2);
+ ret_stream = bt_private_event_class_borrow_private_stream_class(ec2);
ok(ret_stream == sc1, "Borrow parent stream SC1 from EC2");
BT_OBJECT_PUT_REF_AND_RESET(ec1);
BT_OBJECT_PUT_REF_AND_RESET(ec2);
BT_OBJECT_PUT_REF_AND_RESET(sc1);
}
-static void create_sc2(struct bt_trace *trace)
+static void create_sc2(struct bt_private_trace *trace)
{
int ret;
- struct bt_event_class *ec3 = NULL;
- struct bt_stream_class *sc2 = NULL, *ret_stream = NULL;
+ struct bt_private_event_class *ec3 = NULL;
+ struct bt_private_stream_class *sc2 = NULL, *ret_stream = NULL;
- sc2 = bt_stream_class_create(trace);
+ sc2 = bt_private_stream_class_create(trace);
BT_ASSERT(sc2);
- ret = bt_stream_class_set_name(sc2, "sc2");
+ ret = bt_private_stream_class_set_name(sc2, "sc2");
BT_ASSERT(ret == 0);
set_stream_class_field_classes(sc2);
ec3 = create_simple_event(sc2, "ec3");
- ret_stream = bt_event_class_borrow_stream_class(ec3);
+ ret_stream = bt_private_event_class_borrow_private_stream_class(ec3);
ok(ret_stream == sc2, "Borrow parent stream SC2 from EC3");
BT_OBJECT_PUT_REF_AND_RESET(ec3);
BT_OBJECT_PUT_REF_AND_RESET(sc2);
}
-static void set_trace_packet_header(struct bt_trace *trace)
+static void set_trace_packet_header(struct bt_private_trace *trace)
{
- struct bt_field_class *packet_header_type;
- struct bt_field_class *fc;
+ struct bt_private_field_class *packet_header_type;
+ struct bt_private_field_class *fc;
int ret;
- packet_header_type = bt_field_class_structure_create();
+ packet_header_type = bt_private_field_class_structure_create();
BT_ASSERT(packet_header_type);
- fc = bt_field_class_unsigned_integer_create();
+ fc = bt_private_field_class_unsigned_integer_create();
BT_ASSERT(fc);
- ret = bt_field_class_integer_set_field_value_range(fc, 32);
+ ret = bt_private_field_class_integer_set_field_value_range(fc, 32);
BT_ASSERT(ret == 0);
- ret = bt_field_class_structure_append_member(packet_header_type,
+ ret = bt_private_field_class_structure_append_private_member(packet_header_type,
"stream_id", fc);
BT_ASSERT(ret == 0);
bt_object_put_ref(fc);
- ret = bt_trace_set_packet_header_field_class(trace,
+ ret = bt_private_trace_set_packet_header_private_field_class(trace,
packet_header_type);
BT_ASSERT(ret == 0);
bt_object_put_ref(packet_header_type);
}
-static struct bt_trace *create_tc1(void)
+static struct bt_private_trace *create_tc1(void)
{
- struct bt_trace *tc1 = NULL;
+ struct bt_private_trace *tc1 = NULL;
- tc1 = bt_trace_create();
+ tc1 = bt_private_trace_create();
BT_ASSERT(tc1);
set_trace_packet_header(tc1);
create_sc1(tc1);
return tc1;
}
-static void init_weak_refs(struct bt_trace *tc,
- struct bt_trace **tc1,
- struct bt_stream_class **sc1,
- struct bt_stream_class **sc2,
- struct bt_event_class **ec1,
- struct bt_event_class **ec2,
- struct bt_event_class **ec3)
+static void init_weak_refs(struct bt_private_trace *tc,
+ struct bt_private_trace **tc1,
+ struct bt_private_stream_class **sc1,
+ struct bt_private_stream_class **sc2,
+ struct bt_private_event_class **ec1,
+ struct bt_private_event_class **ec2,
+ struct bt_private_event_class **ec3)
{
*tc1 = tc;
- *sc1 = bt_trace_borrow_stream_class_by_index(tc, 0);
- *sc2 = bt_trace_borrow_stream_class_by_index(tc, 1);
- *ec1 = bt_stream_class_borrow_event_class_by_index(*sc1, 0);
- *ec2 = bt_stream_class_borrow_event_class_by_index(*sc1, 1);
- *ec3 = bt_stream_class_borrow_event_class_by_index(*sc2, 0);
+ *sc1 = bt_private_trace_borrow_private_stream_class_by_index(tc, 0);
+ *sc2 = bt_private_trace_borrow_private_stream_class_by_index(tc, 1);
+ *ec1 = bt_private_stream_class_borrow_private_event_class_by_index(*sc1, 0);
+ *ec2 = bt_private_stream_class_borrow_private_event_class_by_index(*sc1, 1);
+ *ec3 = bt_private_stream_class_borrow_private_event_class_by_index(*sc2, 0);
}
static void test_example_scenario(void)
* of expected reference counts without affecting them by taking
* "real" references to the objects.
*/
- struct bt_trace *tc1 = NULL, *weak_tc1 = NULL;
- struct bt_stream_class *weak_sc1 = NULL, *weak_sc2 = NULL;
- struct bt_event_class *weak_ec1 = NULL, *weak_ec2 = NULL,
+ struct bt_private_trace *tc1 = NULL, *weak_tc1 = NULL;
+ struct bt_private_stream_class *weak_sc1 = NULL, *weak_sc2 = NULL;
+ struct bt_private_event_class *weak_ec1 = NULL, *weak_ec2 = NULL,
*weak_ec3 = NULL;
struct user user_a = { 0 }, user_b = { 0 }, user_c = { 0 };
"TC1 reference count is 1");
/* User A acquires a reference to SC2 from TC1. */
- user_a.sc = bt_object_get_ref(bt_trace_borrow_stream_class_by_index(user_a.tc, 1));
+ user_a.sc = bt_object_get_ref(
+ bt_private_trace_borrow_private_stream_class_by_index(
+ user_a.tc, 1));
ok(user_a.sc, "User A acquires SC2 from TC1");
ok(bt_object_get_ref_count((void *) weak_tc1) == 2,
"TC1 reference count is 2");
/* User A acquires a reference to EC3 from SC2. */
user_a.ec = bt_object_get_ref(
- bt_stream_class_borrow_event_class_by_index(user_a.sc, 0));
+ bt_private_stream_class_borrow_private_event_class_by_index(
+ user_a.sc, 0));
ok(user_a.ec, "User A acquires EC3 from SC2");
ok(bt_object_get_ref_count((void *) weak_tc1) == 2,
"TC1 reference count is 2");
/* User C acquires a reference to EC1. */
diag("User C acquires a reference to EC1");
user_c.ec = bt_object_get_ref(
- bt_stream_class_borrow_event_class_by_index(user_b.sc, 0));
+ bt_private_stream_class_borrow_private_event_class_by_index(
+ user_b.sc, 0));
ok(bt_object_get_ref_count((void *) weak_ec1) == 1,
"EC1 reference count is 1");
ok(bt_object_get_ref_count((void *) weak_sc1) == 2,