2 * Copyright 2019 - Philippe Proulx <pproulx@efficios.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
15 #include <babeltrace2/babeltrace.h>
17 #include "ctf-meta-configure-ir-trace.h"
20 int ctf_trace_class_configure_ir_trace(struct ctf_trace_class
*tc
,
29 if (tc
->is_uuid_set
) {
30 bt_trace_set_uuid(ir_trace
, tc
->uuid
);
33 for (i
= 0; i
< tc
->env_entries
->len
; i
++) {
34 struct ctf_trace_class_env_entry
*env_entry
=
35 ctf_trace_class_borrow_env_entry_by_index(tc
, i
);
37 switch (env_entry
->type
) {
38 case CTF_TRACE_CLASS_ENV_ENTRY_TYPE_INT
:
39 ret
= bt_trace_set_environment_entry_integer(
40 ir_trace
, env_entry
->name
->str
,
43 case CTF_TRACE_CLASS_ENV_ENTRY_TYPE_STR
:
44 ret
= bt_trace_set_environment_entry_string(
45 ir_trace
, env_entry
->name
->str
,
46 env_entry
->value
.str
->str
);