2 * SPDX-License-Identifier: MIT
4 * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
7 #include <babeltrace2/babeltrace.h>
9 #include "common/assert.h"
11 #include "ctf-meta-configure-ir-trace.hpp"
12 #include "plugins/ctf/common/metadata/ctf-meta.hpp"
14 int ctf_trace_class_configure_ir_trace(struct ctf_trace_class
*tc
, bt_trace
*ir_trace
)
22 if (tc
->is_uuid_set
) {
23 bt_trace_set_uuid(ir_trace
, tc
->uuid
);
26 for (i
= 0; i
< tc
->env_entries
->len
; i
++) {
27 struct ctf_trace_class_env_entry
*env_entry
=
28 ctf_trace_class_borrow_env_entry_by_index(tc
, i
);
30 switch (env_entry
->type
) {
31 case CTF_TRACE_CLASS_ENV_ENTRY_TYPE_INT
:
32 ret
= bt_trace_set_environment_entry_integer(ir_trace
, env_entry
->name
->str
,
35 case CTF_TRACE_CLASS_ENV_ENTRY_TYPE_STR
:
36 ret
= bt_trace_set_environment_entry_string(ir_trace
, env_entry
->name
->str
,
37 env_entry
->value
.str
->str
);