projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ir: freeze clocks when freezing a trace
[babeltrace.git]
/
formats
/
ctf
/
ir
/
trace.c
diff --git
a/formats/ctf/ir/trace.c
b/formats/ctf/ir/trace.c
index 221e84e43b2b02f37e85f577cdbe0100aed7d5cf..93093881709c808b461b0068dcc79edd9bb403bd 100644
(file)
--- a/
formats/ctf/ir/trace.c
+++ b/
formats/ctf/ir/trace.c
@@
-387,6
+387,10
@@
int bt_ctf_trace_add_clock(struct bt_ctf_trace *trace,
bt_get(clock);
g_ptr_array_add(trace->clocks, clock);
bt_get(clock);
g_ptr_array_add(trace->clocks, clock);
+
+ if (trace->frozen) {
+ bt_ctf_clock_freeze(clock);
+ }
end:
return ret;
}
end:
return ret;
}
@@
-510,7
+514,7
@@
int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
}
/* Validate each event class individually */
}
/* Validate each event class individually */
- for (i = 0; i < event_class_count;
++i
) {
+ for (i = 0; i < event_class_count;
i++
) {
struct bt_ctf_event_class *event_class =
bt_ctf_stream_class_get_event_class(stream_class, i);
struct bt_ctf_field_type *event_context_type = NULL;
struct bt_ctf_event_class *event_class =
bt_ctf_stream_class_get_event_class(stream_class, i);
struct bt_ctf_field_type *event_context_type = NULL;
@@
-593,7
+597,7
@@
int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
*/
bt_ctf_validation_output_put_types(&trace_sc_validation_output);
*/
bt_ctf_validation_output_put_types(&trace_sc_validation_output);
- for (i = 0; i < event_class_count;
++i
) {
+ for (i = 0; i < event_class_count;
i++
) {
struct bt_ctf_event_class *event_class =
bt_ctf_stream_class_get_event_class(stream_class, i);
struct bt_ctf_event_class *event_class =
bt_ctf_stream_class_get_event_class(stream_class, i);
@@
-628,7
+632,7
@@
end:
bt_object_set_parent(stream_class, NULL);
if (ec_validation_outputs) {
bt_object_set_parent(stream_class, NULL);
if (ec_validation_outputs) {
- for (i = 0; i < event_class_count;
++i
) {
+ for (i = 0; i < event_class_count;
i++
) {
bt_ctf_validation_output_put_types(
&ec_validation_outputs[i]);
}
bt_ctf_validation_output_put_types(
&ec_validation_outputs[i]);
}
@@
-684,7
+688,7
@@
struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_id(
goto end;
}
goto end;
}
- for (i = 0; i < trace->stream_classes->len;
++i
) {
+ for (i = 0; i < trace->stream_classes->len;
i++
) {
struct bt_ctf_stream_class *stream_class_candidate;
stream_class_candidate =
struct bt_ctf_stream_class *stream_class_candidate;
stream_class_candidate =
@@
-712,7
+716,7
@@
struct bt_ctf_clock *bt_ctf_trace_get_clock_by_name(
goto end;
}
goto end;
}
- for (i = 0; i < trace->clocks->len;
++i
) {
+ for (i = 0; i < trace->clocks->len;
i++
) {
struct bt_ctf_clock *cur_clk =
g_ptr_array_index(trace->clocks, i);
const char *cur_clk_name = bt_ctf_clock_get_name(cur_clk);
struct bt_ctf_clock *cur_clk =
g_ptr_array_index(trace->clocks, i);
const char *cur_clk_name = bt_ctf_clock_get_name(cur_clk);
@@
-803,7
+807,7
@@
void append_env_metadata(struct bt_ctf_trace *trace,
g_string_append(context->string, "env {\n");
g_string_append(context->string, "env {\n");
- for (i = 0; i < env_size;
++i
) {
+ for (i = 0; i < env_size;
i++
) {
struct bt_value *env_field_value_obj = NULL;
const char *entry_name;
struct bt_value *env_field_value_obj = NULL;
const char *entry_name;
@@
-1048,8
+1052,18
@@
end:
static
void bt_ctf_trace_freeze(struct bt_ctf_trace *trace)
{
static
void bt_ctf_trace_freeze(struct bt_ctf_trace *trace)
{
+ int i;
+
bt_ctf_field_type_freeze(trace->packet_header_type);
bt_ctf_attributes_freeze(trace->environment);
bt_ctf_field_type_freeze(trace->packet_header_type);
bt_ctf_attributes_freeze(trace->environment);
+
+ for (i = 0; i < trace->clocks->len; i++) {
+ struct bt_ctf_clock *clock =
+ g_ptr_array_index(trace->clocks, i);
+
+ bt_ctf_clock_freeze(clock);
+ }
+
trace->frozen = 1;
}
trace->frozen = 1;
}
This page took
0.027208 seconds
and
4
git commands to generate.