* THE SOFTWARE.
*/
-%{
-#include <babeltrace/ctf-ir/trace.h>
-%}
-
/* Type */
struct bt_ctf_trace;
/* Functions */
struct bt_ctf_trace *bt_ctf_trace_create(void);
-const char *bt_ctf_trace_get_name(struct bt_ctf_trace *trace);
-int bt_ctf_trace_set_name(struct bt_ctf_trace *trace,
+const char *bt_ctf_trace_get_name(struct bt_ctf_trace *trace_class);
+int bt_ctf_trace_set_name(struct bt_ctf_trace *trace_class,
const char *name);
-enum bt_ctf_byte_order bt_ctf_trace_get_byte_order(
- struct bt_ctf_trace *trace);
-int bt_ctf_trace_set_byte_order(struct bt_ctf_trace *trace,
- enum bt_ctf_byte_order byte_order);
-int bt_ctf_trace_get_environment_field_count(
- struct bt_ctf_trace *trace);
+enum bt_ctf_byte_order bt_ctf_trace_get_native_byte_order(
+ struct bt_ctf_trace *trace_class);
+int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace_class,
+ enum bt_ctf_byte_order native_byte_order);
+BTUUID bt_ctf_trace_get_uuid(
+ struct bt_ctf_trace *trace_class);
+int bt_ctf_trace_set_uuid(struct bt_ctf_trace *trace_class,
+ BTUUID uuid);
+int64_t bt_ctf_trace_get_environment_field_count(
+ struct bt_ctf_trace *trace_class);
const char *
-bt_ctf_trace_get_environment_field_name(struct bt_ctf_trace *trace,
- int index);
+bt_ctf_trace_get_environment_field_name_by_index(
+ struct bt_ctf_trace *trace_class, uint64_t index);
struct bt_value *
-bt_ctf_trace_get_environment_field_value(struct bt_ctf_trace *trace,
- int index);
+bt_ctf_trace_get_environment_field_value_by_index(struct bt_ctf_trace *trace_class,
+ uint64_t index);
struct bt_value *
bt_ctf_trace_get_environment_field_value_by_name(
- struct bt_ctf_trace *trace, const char *name);
+ struct bt_ctf_trace *trace_class, const char *name);
int bt_ctf_trace_set_environment_field(
- struct bt_ctf_trace *trace, const char *name,
+ struct bt_ctf_trace *trace_class, const char *name,
struct bt_value *value);
struct bt_ctf_field_type *bt_ctf_trace_get_packet_header_type(
- struct bt_ctf_trace *trace);
-int bt_ctf_trace_set_packet_header_type(struct bt_ctf_trace *trace,
+ struct bt_ctf_trace *trace_class);
+int bt_ctf_trace_set_packet_header_type(struct bt_ctf_trace *trace_class,
struct bt_ctf_field_type *packet_header_type);
-int bt_ctf_trace_get_clock_class_count(struct bt_ctf_trace *trace);
-struct bt_ctf_clock_class *bt_ctf_trace_get_clock_class(
- struct bt_ctf_trace *trace, int index);
+int64_t bt_ctf_trace_get_clock_class_count(
+ struct bt_ctf_trace *trace_class);
+struct bt_ctf_clock_class *bt_ctf_trace_get_clock_class_by_index(
+ struct bt_ctf_trace *trace_class, uint64_t index);
struct bt_ctf_clock_class *bt_ctf_trace_get_clock_class_by_name(
- struct bt_ctf_trace *trace, const char *name);
-int bt_ctf_trace_add_clock_class(struct bt_ctf_trace *trace,
+ struct bt_ctf_trace *trace_class, const char *name);
+int bt_ctf_trace_add_clock_class(struct bt_ctf_trace *trace_class,
struct bt_ctf_clock_class *clock_class);
-int bt_ctf_trace_get_stream_class_count(struct bt_ctf_trace *trace);
-struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class(
- struct bt_ctf_trace *trace, int index);
+int64_t bt_ctf_trace_get_stream_class_count(
+ struct bt_ctf_trace *trace_class);
+struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_index(
+ struct bt_ctf_trace *trace_class, uint64_t index);
struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_id(
- struct bt_ctf_trace *trace, uint32_t id);
-int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
+ struct bt_ctf_trace *trace_class, uint64_t id);
+int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace_class,
struct bt_ctf_stream_class *stream_class);
+int64_t bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace_class);
+struct bt_ctf_stream *bt_ctf_trace_get_stream_by_index(
+ struct bt_ctf_trace *trace_class, uint64_t index);
+int bt_ctf_trace_is_static(struct bt_ctf_trace *trace_class);
+int bt_ctf_trace_set_is_static(struct bt_ctf_trace *trace_class);
+
+/* Helper functions for Python */
+%{
+void trace_is_static_listener(struct bt_ctf_trace *trace, void *py_callable)
+{
+ PyObject *py_trace_ptr = NULL;
+ PyObject *py_res = NULL;
+
+ py_trace_ptr = SWIG_NewPointerObj(SWIG_as_voidptr(trace),
+ SWIGTYPE_p_bt_ctf_trace, 0);
+ if (!py_trace_ptr) {
+ BT_LOGF_STR("Failed to create a SWIG pointer object.");
+ abort();
+ }
+
+ py_res = PyObject_CallFunction(py_callable, "(O)", py_trace_ptr);
+ assert(py_res == Py_None);
+ Py_DECREF(py_trace_ptr);
+ Py_DECREF(py_res);
+}
+
+void trace_listener_removed(struct bt_ctf_trace *trace, void *py_callable)
+{
+ assert(py_callable);
+ Py_DECREF(py_callable);
+}
+
+static int bt_py3_trace_add_is_staitc_listener(unsigned long long trace_addr,
+ PyObject *py_callable)
+{
+ struct bt_ctf_trace *trace = (void *) trace_addr;
+ int ret = 0;
+
+ assert(trace);
+ assert(py_callable);
+ ret = bt_ctf_trace_add_is_static_listener(trace,
+ trace_is_static_listener, trace_listener_removed, py_callable);
+ if (ret >= 0) {
+ Py_INCREF(py_callable);
+ }
+
+ return ret;
+}
+%}
+
+int bt_py3_trace_add_is_staitc_listener(unsigned long long trace_addr,
+ PyObject *py_callable);