{
int ret = 0;
- if (!trace || !bt_ctf_clock_class_is_valid(clock_class)) {
+ if (!trace || trace->is_static ||
+ !bt_ctf_clock_class_is_valid(clock_class)) {
ret = -1;
goto end;
}
int event_class_count;
struct bt_ctf_trace *current_parent_trace = NULL;
- if (!trace || !stream_class) {
+ if (!trace || !stream_class || trace->is_static) {
ret = -1;
goto end;
}
return ret;
}
+int bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace)
+{
+ int ret;
+
+ if (!trace) {
+ ret = -1;
+ goto end;
+ }
+
+ ret = trace->streams->len;
+
+end:
+ return ret;
+}
+
+struct bt_ctf_stream *bt_ctf_trace_get_stream(struct bt_ctf_trace *trace,
+ int index)
+{
+ struct bt_ctf_stream *stream = NULL;
+
+ if (!trace || index >= trace->streams->len) {
+ goto end;
+ }
+
+ stream = bt_get(g_ptr_array_index(trace->streams, index));
+
+end:
+ return stream;
+}
+
int bt_ctf_trace_get_stream_class_count(struct bt_ctf_trace *trace)
{
int ret;
bt_put(trace_packet_header_type);
return ret;
}
+
+bool bt_ctf_trace_is_static(struct bt_ctf_trace *trace)
+{
+ bool is_static = false;
+
+ if (!trace) {
+ goto end;
+ }
+
+ is_static = trace->is_static;
+
+end:
+ return is_static;
+}
+
+int bt_ctf_trace_set_is_static(struct bt_ctf_trace *trace)
+{
+ int ret = 0;
+
+ if (!trace) {
+ ret = -1;
+ goto end;
+ }
+
+ trace->is_static = true;
+ bt_ctf_trace_freeze(trace);
+
+end:
+ return ret;
+}