Commit | Line | Data |
---|---|---|
57ffc2f1 PP |
1 | /* |
2 | * Copyright 2018 Philippe Proulx <pproulx@efficios.com> | |
3 | * | |
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: | |
10 | * | |
11 | * The above copyright notice and this permission notice shall be included in | |
12 | * all copies or substantial portions of the Software. | |
13 | * | |
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
20 | * SOFTWARE. | |
21 | */ | |
22 | ||
8deee039 PP |
23 | #define BT_LOG_TAG "LIB-LOGGING" |
24 | ||
57ffc2f1 PP |
25 | #include <stdarg.h> |
26 | #include <stdio.h> | |
27 | #include <stdlib.h> | |
28 | #include <string.h> | |
29 | #include <inttypes.h> | |
30 | #include <stdint.h> | |
57ffc2f1 PP |
31 | #include <wchar.h> |
32 | #include <glib.h> | |
8c6884d9 PP |
33 | #include <babeltrace/lib-logging-internal.h> |
34 | #include <babeltrace/assert-pre-internal.h> | |
57ffc2f1 PP |
35 | #include <babeltrace/common-internal.h> |
36 | #include <babeltrace/lib-logging-internal.h> | |
0f15f666 PP |
37 | #include <babeltrace/value-internal.h> |
38 | #include <babeltrace/value-internal.h> | |
a6918753 | 39 | #include <babeltrace/object-pool-internal.h> |
0f15f666 PP |
40 | #include <babeltrace/trace-ir/field-class-internal.h> |
41 | #include <babeltrace/trace-ir/field-internal.h> | |
108b91d0 | 42 | #include <babeltrace/trace-ir/event-class-internal.h> |
10b7a2e4 | 43 | #include <babeltrace/trace-ir/event-const.h> |
108b91d0 | 44 | #include <babeltrace/trace-ir/event-internal.h> |
10b7a2e4 | 45 | #include <babeltrace/trace-ir/packet-const.h> |
108b91d0 PP |
46 | #include <babeltrace/trace-ir/packet-internal.h> |
47 | #include <babeltrace/trace-ir/stream-class-internal.h> | |
48 | #include <babeltrace/trace-ir/stream-internal.h> | |
10b7a2e4 | 49 | #include <babeltrace/trace-ir/stream-const.h> |
108b91d0 | 50 | #include <babeltrace/trace-ir/trace-internal.h> |
10b7a2e4 | 51 | #include <babeltrace/trace-ir/trace-class-internal.h> |
108b91d0 | 52 | #include <babeltrace/trace-ir/clock-class-internal.h> |
ecbb78c0 | 53 | #include <babeltrace/trace-ir/clock-snapshot-internal.h> |
108b91d0 PP |
54 | #include <babeltrace/trace-ir/field-path-internal.h> |
55 | #include <babeltrace/trace-ir/utils-internal.h> | |
57ffc2f1 PP |
56 | #include <babeltrace/graph/component-class-internal.h> |
57 | #include <babeltrace/graph/component-class-sink-colander-internal.h> | |
58 | #include <babeltrace/graph/component-filter-internal.h> | |
59 | #include <babeltrace/graph/component-internal.h> | |
60 | #include <babeltrace/graph/component-sink-internal.h> | |
61 | #include <babeltrace/graph/component-source-internal.h> | |
62 | #include <babeltrace/graph/connection-internal.h> | |
63 | #include <babeltrace/graph/graph-internal.h> | |
b09a5592 PP |
64 | #include <babeltrace/graph/message-event-internal.h> |
65 | #include <babeltrace/graph/message-inactivity-internal.h> | |
66 | #include <babeltrace/graph/message-internal.h> | |
67 | #include <babeltrace/graph/message-iterator-internal.h> | |
68 | #include <babeltrace/graph/message-packet-internal.h> | |
69 | #include <babeltrace/graph/message-stream-internal.h> | |
57ffc2f1 PP |
70 | #include <babeltrace/graph/port-internal.h> |
71 | #include <babeltrace/plugin/plugin-internal.h> | |
72 | #include <babeltrace/plugin/plugin-so-internal.h> | |
57ffc2f1 PP |
73 | |
74 | #define LIB_LOGGING_BUF_SIZE (4096 * 4) | |
75 | ||
76 | static char __thread lib_logging_buf[LIB_LOGGING_BUF_SIZE]; | |
77 | ||
78 | #define BUF_APPEND(_fmt, ...) \ | |
79 | do { \ | |
80 | int _count; \ | |
81 | size_t _size = LIB_LOGGING_BUF_SIZE - \ | |
82 | (size_t) (*buf_ch - lib_logging_buf); \ | |
83 | _count = snprintf(*buf_ch, _size, (_fmt), __VA_ARGS__); \ | |
8b45963b | 84 | BT_ASSERT(_count >= 0); \ |
57ffc2f1 PP |
85 | *buf_ch += MIN(_count, _size); \ |
86 | if (*buf_ch >= lib_logging_buf + LIB_LOGGING_BUF_SIZE - 1) { \ | |
87 | return; \ | |
88 | } \ | |
89 | } while (0) | |
90 | ||
91 | #define BUF_APPEND_UUID(_uuid) \ | |
7b33a0e0 PP |
92 | do { \ |
93 | BUF_APPEND(", %suuid=", prefix); \ | |
94 | format_uuid(buf_ch, (_uuid)); \ | |
95 | } while (0) | |
57ffc2f1 PP |
96 | |
97 | #define PRFIELD(_expr) prefix, (_expr) | |
98 | ||
834e9996 PP |
99 | #define PRFIELD_GSTRING(_expr) PRFIELD((_expr) ? (_expr)->str : NULL) |
100 | ||
57ffc2f1 PP |
101 | #define SET_TMP_PREFIX(_prefix2) \ |
102 | do { \ | |
103 | strcpy(tmp_prefix, prefix); \ | |
104 | strcat(tmp_prefix, (_prefix2)); \ | |
105 | } while (0) | |
106 | ||
107 | static inline void format_component(char **buf_ch, bool extended, | |
10b7a2e4 | 108 | const char *prefix, const struct bt_component *component); |
57ffc2f1 PP |
109 | |
110 | static inline void format_port(char **buf_ch, bool extended, | |
10b7a2e4 | 111 | const char *prefix, const struct bt_port *port); |
57ffc2f1 PP |
112 | |
113 | static inline void format_connection(char **buf_ch, bool extended, | |
10b7a2e4 | 114 | const char *prefix, const struct bt_connection *connection); |
57ffc2f1 | 115 | |
ecbb78c0 PP |
116 | static inline void format_clock_snapshot(char **buf_ch, bool extended, |
117 | const char *prefix, const struct bt_clock_snapshot *clock_snapshot); | |
8fc063a2 | 118 | |
7b33a0e0 | 119 | static inline void format_field_path(char **buf_ch, bool extended, |
10b7a2e4 | 120 | const char *prefix, const struct bt_field_path *field_path); |
7b33a0e0 | 121 | |
1d7bf349 | 122 | static inline void format_object(char **buf_ch, bool extended, |
10b7a2e4 | 123 | const char *prefix, const struct bt_object *obj) |
57ffc2f1 | 124 | { |
1d7bf349 | 125 | BUF_APPEND(", %sref-count=%llu", prefix, obj->ref_count); |
57ffc2f1 PP |
126 | } |
127 | ||
7b33a0e0 | 128 | static inline void format_uuid(char **buf_ch, bt_uuid uuid) |
8fc063a2 | 129 | { |
7b33a0e0 PP |
130 | BUF_APPEND("\"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\"", |
131 | (unsigned int) uuid[0], | |
132 | (unsigned int) uuid[1], | |
133 | (unsigned int) uuid[2], | |
134 | (unsigned int) uuid[3], | |
135 | (unsigned int) uuid[4], | |
136 | (unsigned int) uuid[5], | |
137 | (unsigned int) uuid[6], | |
138 | (unsigned int) uuid[7], | |
139 | (unsigned int) uuid[8], | |
140 | (unsigned int) uuid[9], | |
141 | (unsigned int) uuid[10], | |
142 | (unsigned int) uuid[11], | |
143 | (unsigned int) uuid[12], | |
144 | (unsigned int) uuid[13], | |
145 | (unsigned int) uuid[14], | |
146 | (unsigned int) uuid[15]); | |
8fc063a2 PP |
147 | } |
148 | ||
a6918753 | 149 | static inline void format_object_pool(char **buf_ch, bool extended, |
10b7a2e4 | 150 | const char *prefix, const struct bt_object_pool *pool) |
a6918753 PP |
151 | { |
152 | BUF_APPEND(", %ssize=%zu", PRFIELD(pool->size)); | |
153 | ||
154 | if (pool->objects) { | |
155 | BUF_APPEND(", %scap=%u", PRFIELD(pool->objects->len)); | |
156 | } | |
157 | } | |
158 | ||
939190b3 | 159 | static inline void format_integer_field_class(char **buf_ch, |
7b33a0e0 | 160 | bool extended, const char *prefix, |
10b7a2e4 | 161 | const struct bt_field_class *field_class) |
7b33a0e0 | 162 | { |
10b7a2e4 PP |
163 | const struct bt_field_class_integer *int_fc = |
164 | (const void *) field_class; | |
7b33a0e0 PP |
165 | |
166 | BUF_APPEND(", %srange-size=%" PRIu64 ", %sbase=%s", | |
939190b3 PP |
167 | PRFIELD(int_fc->range), |
168 | PRFIELD(bt_common_field_class_integer_preferred_display_base_string(int_fc->base))); | |
7b33a0e0 PP |
169 | } |
170 | ||
939190b3 | 171 | static inline void format_array_field_class(char **buf_ch, |
7b33a0e0 | 172 | bool extended, const char *prefix, |
10b7a2e4 | 173 | const struct bt_field_class *field_class) |
7b33a0e0 | 174 | { |
10b7a2e4 PP |
175 | const struct bt_field_class_array *array_fc = |
176 | (const void *) field_class; | |
7b33a0e0 | 177 | |
af0c18e3 | 178 | BUF_APPEND(", %selement-fc-addr=%p, %selement-fc-type=%s", |
939190b3 | 179 | PRFIELD(array_fc->element_fc), |
af0c18e3 | 180 | PRFIELD(bt_common_field_class_type_string(array_fc->element_fc->type))); |
7b33a0e0 PP |
181 | } |
182 | ||
939190b3 | 183 | static inline void format_field_class(char **buf_ch, bool extended, |
10b7a2e4 | 184 | const char *prefix, const struct bt_field_class *field_class) |
57ffc2f1 | 185 | { |
7b33a0e0 PP |
186 | char tmp_prefix[64]; |
187 | ||
af0c18e3 PP |
188 | BUF_APPEND(", %stype=%s", |
189 | PRFIELD(bt_common_field_class_type_string(field_class->type))); | |
57ffc2f1 PP |
190 | |
191 | if (extended) { | |
939190b3 | 192 | BUF_APPEND(", %sis-frozen=%d", PRFIELD(field_class->frozen)); |
10b7a2e4 PP |
193 | BUF_APPEND(", %sis-part-of-trace-class=%d", |
194 | PRFIELD(field_class->part_of_trace_class)); | |
57ffc2f1 PP |
195 | } else { |
196 | return; | |
197 | } | |
198 | ||
af0c18e3 PP |
199 | switch (field_class->type) { |
200 | case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER: | |
201 | case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER: | |
57ffc2f1 | 202 | { |
939190b3 | 203 | format_integer_field_class(buf_ch, extended, prefix, field_class); |
57ffc2f1 PP |
204 | break; |
205 | } | |
af0c18e3 | 206 | case BT_FIELD_CLASS_TYPE_REAL: |
57ffc2f1 | 207 | { |
10b7a2e4 | 208 | const struct bt_field_class_real *real_fc = (void *) field_class; |
57ffc2f1 | 209 | |
7b33a0e0 | 210 | BUF_APPEND(", %sis-single-precision=%d", |
939190b3 | 211 | PRFIELD(real_fc->is_single_precision)); |
57ffc2f1 PP |
212 | break; |
213 | } | |
af0c18e3 PP |
214 | case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION: |
215 | case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION: | |
57ffc2f1 | 216 | { |
10b7a2e4 PP |
217 | const struct bt_field_class_enumeration *enum_fc = |
218 | (const void *) field_class; | |
57ffc2f1 | 219 | |
939190b3 | 220 | format_integer_field_class(buf_ch, extended, prefix, field_class); |
57ffc2f1 | 221 | BUF_APPEND(", %smapping-count=%u", |
939190b3 | 222 | PRFIELD(enum_fc->mappings->len)); |
57ffc2f1 PP |
223 | break; |
224 | } | |
af0c18e3 | 225 | case BT_FIELD_CLASS_TYPE_STRUCTURE: |
57ffc2f1 | 226 | { |
10b7a2e4 PP |
227 | const struct bt_field_class_structure *struct_fc = |
228 | (const void *) field_class; | |
7b33a0e0 | 229 | |
939190b3 | 230 | if (struct_fc->common.named_fcs) { |
7b33a0e0 | 231 | BUF_APPEND(", %smember-count=%u", |
939190b3 | 232 | PRFIELD(struct_fc->common.named_fcs->len)); |
7b33a0e0 | 233 | } |
57ffc2f1 | 234 | |
57ffc2f1 PP |
235 | break; |
236 | } | |
af0c18e3 | 237 | case BT_FIELD_CLASS_TYPE_STATIC_ARRAY: |
57ffc2f1 | 238 | { |
10b7a2e4 PP |
239 | const struct bt_field_class_static_array *array_fc = |
240 | (const void *) field_class; | |
57ffc2f1 | 241 | |
939190b3 PP |
242 | format_array_field_class(buf_ch, extended, prefix, field_class); |
243 | BUF_APPEND(", %slength=%" PRIu64, PRFIELD(array_fc->length)); | |
57ffc2f1 PP |
244 | break; |
245 | } | |
af0c18e3 | 246 | case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY: |
57ffc2f1 | 247 | { |
10b7a2e4 PP |
248 | const struct bt_field_class_dynamic_array *array_fc = |
249 | (const void *) field_class; | |
7b33a0e0 | 250 | |
939190b3 | 251 | format_array_field_class(buf_ch, extended, prefix, field_class); |
7b33a0e0 | 252 | |
939190b3 PP |
253 | if (array_fc->length_fc) { |
254 | SET_TMP_PREFIX("length-fc-"); | |
255 | format_field_class(buf_ch, extended, tmp_prefix, | |
256 | array_fc->length_fc); | |
7b33a0e0 PP |
257 | } |
258 | ||
939190b3 | 259 | if (array_fc->length_field_path) { |
7b33a0e0 PP |
260 | SET_TMP_PREFIX("length-field-path-"); |
261 | format_field_path(buf_ch, extended, tmp_prefix, | |
939190b3 | 262 | array_fc->length_field_path); |
7b33a0e0 | 263 | } |
57ffc2f1 | 264 | |
57ffc2f1 PP |
265 | break; |
266 | } | |
af0c18e3 | 267 | case BT_FIELD_CLASS_TYPE_VARIANT: |
57ffc2f1 | 268 | { |
10b7a2e4 PP |
269 | const struct bt_field_class_variant *var_fc = |
270 | (const void *) field_class; | |
7b33a0e0 | 271 | |
939190b3 | 272 | if (var_fc->common.named_fcs) { |
7b33a0e0 | 273 | BUF_APPEND(", %soption-count=%u", |
939190b3 | 274 | PRFIELD(var_fc->common.named_fcs->len)); |
7b33a0e0 PP |
275 | } |
276 | ||
939190b3 PP |
277 | if (var_fc->selector_fc) { |
278 | SET_TMP_PREFIX("selector-fc-"); | |
279 | format_field_class(buf_ch, extended, tmp_prefix, | |
280 | var_fc->selector_fc); | |
7b33a0e0 PP |
281 | } |
282 | ||
939190b3 | 283 | if (var_fc->selector_field_path) { |
7b33a0e0 PP |
284 | SET_TMP_PREFIX("selector-field-path-"); |
285 | format_field_path(buf_ch, extended, tmp_prefix, | |
939190b3 | 286 | var_fc->selector_field_path); |
7b33a0e0 | 287 | } |
57ffc2f1 | 288 | |
57ffc2f1 PP |
289 | break; |
290 | } | |
291 | default: | |
292 | break; | |
293 | } | |
294 | } | |
295 | ||
18acc6f8 | 296 | static inline void format_field_integer_extended(char **buf_ch, |
10b7a2e4 | 297 | const char *prefix, const struct bt_field *field) |
57ffc2f1 | 298 | { |
10b7a2e4 PP |
299 | const struct bt_field_integer *integer = (void *) field; |
300 | const struct bt_field_class_integer *field_class = | |
301 | (void *) field->class; | |
57ffc2f1 PP |
302 | const char *fmt = NULL; |
303 | ||
939190b3 | 304 | BT_ASSERT(field_class); |
a6918753 | 305 | |
939190b3 | 306 | if (field_class->base == BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_OCTAL) { |
57ffc2f1 | 307 | fmt = ", %svalue=%" PRIo64; |
939190b3 | 308 | } else if (field_class->base == BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_HEXADECIMAL) { |
57ffc2f1 PP |
309 | fmt = ", %svalue=%" PRIx64; |
310 | } | |
311 | ||
af0c18e3 PP |
312 | if (field_class->common.type == BT_FIELD_CLASS_TYPE_SIGNED_INTEGER || |
313 | field_class->common.type == BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION) { | |
57ffc2f1 PP |
314 | if (!fmt) { |
315 | fmt = ", %svalue=%" PRId64; | |
316 | } | |
317 | ||
7b33a0e0 | 318 | BUF_APPEND(fmt, PRFIELD(integer->value.i)); |
57ffc2f1 PP |
319 | } else { |
320 | if (!fmt) { | |
321 | fmt = ", %svalue=%" PRIu64; | |
322 | } | |
323 | ||
7b33a0e0 | 324 | BUF_APPEND(fmt, PRFIELD(integer->value.u)); |
57ffc2f1 PP |
325 | } |
326 | } | |
327 | ||
18acc6f8 | 328 | static inline void format_field(char **buf_ch, bool extended, |
10b7a2e4 | 329 | const char *prefix, const struct bt_field *field) |
57ffc2f1 | 330 | { |
7b33a0e0 | 331 | BUF_APPEND(", %sis-set=%d", PRFIELD(field->is_set)); |
57ffc2f1 PP |
332 | |
333 | if (extended) { | |
334 | BUF_APPEND(", %sis-frozen=%d", PRFIELD(field->frozen)); | |
335 | } | |
336 | ||
af0c18e3 | 337 | BUF_APPEND(", %sclass-addr=%p", PRFIELD(field->class)); |
a6918753 | 338 | |
939190b3 | 339 | if (!field->class) { |
a6918753 PP |
340 | return; |
341 | } | |
342 | ||
af0c18e3 PP |
343 | BUF_APPEND(", %sclass-type=%s", |
344 | PRFIELD(bt_common_field_class_type_string(field->class->type))); | |
57ffc2f1 | 345 | |
7b33a0e0 | 346 | if (!extended || !field->is_set) { |
57ffc2f1 PP |
347 | return; |
348 | } | |
349 | ||
af0c18e3 PP |
350 | switch (field->class->type) { |
351 | case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER: | |
352 | case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER: | |
353 | case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION: | |
354 | case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION: | |
57ffc2f1 | 355 | { |
18acc6f8 | 356 | format_field_integer_extended(buf_ch, prefix, field); |
57ffc2f1 PP |
357 | break; |
358 | } | |
af0c18e3 | 359 | case BT_FIELD_CLASS_TYPE_REAL: |
57ffc2f1 | 360 | { |
10b7a2e4 | 361 | const struct bt_field_real *real_field = (const void *) field; |
57ffc2f1 | 362 | |
7b33a0e0 | 363 | BUF_APPEND(", %svalue=%f", PRFIELD(real_field->value)); |
57ffc2f1 PP |
364 | break; |
365 | } | |
af0c18e3 | 366 | case BT_FIELD_CLASS_TYPE_STRING: |
57ffc2f1 | 367 | { |
10b7a2e4 | 368 | const struct bt_field_string *str = (const void *) field; |
57ffc2f1 | 369 | |
e42dd763 PP |
370 | if (str->buf) { |
371 | BT_ASSERT(str->buf->data); | |
a6918753 | 372 | BUF_APPEND(", %spartial-value=\"%.32s\"", |
e42dd763 | 373 | PRFIELD(str->buf->data)); |
a6918753 | 374 | } |
7b33a0e0 | 375 | |
57ffc2f1 PP |
376 | break; |
377 | } | |
af0c18e3 PP |
378 | case BT_FIELD_CLASS_TYPE_STATIC_ARRAY: |
379 | case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY: | |
57ffc2f1 | 380 | { |
10b7a2e4 | 381 | const struct bt_field_array *array_field = (const void *) field; |
57ffc2f1 | 382 | |
7b33a0e0 | 383 | BUF_APPEND(", %slength=%" PRIu64, PRFIELD(array_field->length)); |
a6918753 | 384 | |
7b33a0e0 | 385 | if (array_field->fields) { |
a6918753 | 386 | BUF_APPEND(", %sallocated-length=%u", |
7b33a0e0 | 387 | PRFIELD(array_field->fields->len)); |
a6918753 | 388 | } |
7b33a0e0 | 389 | |
57ffc2f1 PP |
390 | break; |
391 | } | |
af0c18e3 | 392 | case BT_FIELD_CLASS_TYPE_VARIANT: |
57ffc2f1 | 393 | { |
10b7a2e4 | 394 | const struct bt_field_variant *var_field = (const void *) field; |
a6918753 | 395 | |
7b33a0e0 PP |
396 | BUF_APPEND(", %sselected-field-index=%" PRIu64, |
397 | PRFIELD(var_field->selected_index)); | |
a6918753 PP |
398 | break; |
399 | } | |
400 | default: | |
401 | break; | |
402 | } | |
8deee039 PP |
403 | } |
404 | ||
57ffc2f1 | 405 | static inline void format_field_path(char **buf_ch, bool extended, |
10b7a2e4 | 406 | const char *prefix, const struct bt_field_path *field_path) |
57ffc2f1 PP |
407 | { |
408 | uint64_t i; | |
409 | ||
a6918753 PP |
410 | if (field_path->indexes) { |
411 | BT_ASSERT(field_path->indexes); | |
18acc6f8 PP |
412 | BUF_APPEND(", %sindex-count=%u", |
413 | PRFIELD(field_path->indexes->len)); | |
a6918753 | 414 | } |
57ffc2f1 | 415 | |
a6918753 | 416 | if (!extended || !field_path->indexes) { |
57ffc2f1 PP |
417 | return; |
418 | } | |
419 | ||
18acc6f8 PP |
420 | BUF_APPEND(", %spath=[%s", |
421 | PRFIELD(bt_common_scope_string(field_path->root))); | |
57ffc2f1 PP |
422 | |
423 | for (i = 0; i < field_path->indexes->len; i++) { | |
7b33a0e0 PP |
424 | uint64_t index = bt_field_path_get_index_by_index_inline( |
425 | field_path, i); | |
57ffc2f1 | 426 | |
7b33a0e0 | 427 | BUF_APPEND(", %" PRIu64, index); |
57ffc2f1 PP |
428 | } |
429 | ||
430 | BUF_APPEND("%s", "]"); | |
431 | } | |
432 | ||
10b7a2e4 PP |
433 | static inline void format_trace_class(char **buf_ch, bool extended, |
434 | const char *prefix, const struct bt_trace_class *trace_class) | |
57ffc2f1 | 435 | { |
18acc6f8 PP |
436 | char tmp_prefix[64]; |
437 | ||
10b7a2e4 PP |
438 | if (trace_class->name.value) { |
439 | BUF_APPEND(", %sname=\"%s\"", | |
440 | PRFIELD(trace_class->name.value)); | |
57ffc2f1 PP |
441 | } |
442 | ||
443 | if (!extended) { | |
444 | return; | |
445 | } | |
446 | ||
10b7a2e4 | 447 | BUF_APPEND(", %sis-frozen=%d", PRFIELD(trace_class->frozen)); |
57ffc2f1 | 448 | |
10b7a2e4 PP |
449 | if (trace_class->uuid.value) { |
450 | BUF_APPEND_UUID(trace_class->uuid.value); | |
a6918753 PP |
451 | } |
452 | ||
10b7a2e4 | 453 | if (trace_class->stream_classes) { |
a6918753 | 454 | BUF_APPEND(", %sstream-class-count=%u", |
10b7a2e4 | 455 | PRFIELD(trace_class->stream_classes->len)); |
a6918753 PP |
456 | } |
457 | ||
10b7a2e4 PP |
458 | BUF_APPEND(", %spacket-header-fc-addr=%p, " |
459 | "%sassigns-auto-sc-id=%d", | |
460 | PRFIELD(trace_class->packet_header_fc), | |
461 | PRFIELD(trace_class->assigns_automatic_stream_class_id)); | |
462 | SET_TMP_PREFIX("phf-pool-"); | |
463 | format_object_pool(buf_ch, extended, prefix, | |
464 | &trace_class->packet_header_field_pool); | |
465 | } | |
466 | ||
467 | static inline void format_trace(char **buf_ch, bool extended, | |
468 | const char *prefix, const struct bt_trace *trace) | |
469 | { | |
470 | char tmp_prefix[64]; | |
471 | ||
472 | if (trace->name.value) { | |
473 | BUF_APPEND(", %sname=\"%s\"", PRFIELD(trace->name.value)); | |
474 | } | |
475 | ||
476 | if (!extended) { | |
477 | return; | |
478 | } | |
479 | ||
480 | BUF_APPEND(", %sis-frozen=%d", PRFIELD(trace->frozen)); | |
481 | ||
a6918753 PP |
482 | if (trace->streams) { |
483 | BUF_APPEND(", %sstream-count=%u", | |
484 | PRFIELD(trace->streams->len)); | |
485 | } | |
486 | ||
10b7a2e4 PP |
487 | BUF_APPEND(", %sis-static=%d", PRFIELD(trace->is_static)); |
488 | ||
489 | if (!trace->class) { | |
490 | return; | |
491 | } | |
492 | ||
493 | BUF_APPEND(", %strace-class-addr=%p", PRFIELD(trace->class)); | |
494 | SET_TMP_PREFIX("trace-class-"); | |
495 | format_trace_class(buf_ch, false, tmp_prefix, trace->class); | |
8deee039 PP |
496 | } |
497 | ||
18acc6f8 | 498 | static inline void format_stream_class(char **buf_ch, bool extended, |
10b7a2e4 PP |
499 | const char *prefix, |
500 | const struct bt_stream_class *stream_class) | |
8deee039 | 501 | { |
10b7a2e4 | 502 | const struct bt_trace_class *trace_class; |
57ffc2f1 PP |
503 | char tmp_prefix[64]; |
504 | ||
7b33a0e0 | 505 | BUF_APPEND(", %sid=%" PRIu64, PRFIELD(stream_class->id)); |
57ffc2f1 | 506 | |
7b33a0e0 PP |
507 | if (stream_class->name.value) { |
508 | BUF_APPEND(", %sname=\"%s\"", | |
509 | PRFIELD(stream_class->name.value)); | |
57ffc2f1 PP |
510 | } |
511 | ||
512 | if (!extended) { | |
513 | return; | |
514 | } | |
515 | ||
516 | BUF_APPEND(", %sis-frozen=%d", PRFIELD(stream_class->frozen)); | |
a6918753 PP |
517 | |
518 | if (stream_class->event_classes) { | |
519 | BUF_APPEND(", %sevent-class-count=%u", | |
520 | PRFIELD(stream_class->event_classes->len)); | |
521 | } | |
522 | ||
939190b3 PP |
523 | BUF_APPEND(", %spacket-context-fc-addr=%p, " |
524 | "%sevent-header-fc-addr=%p, %sevent-common-context-fc-addr=%p", | |
525 | PRFIELD(stream_class->packet_context_fc), | |
526 | PRFIELD(stream_class->event_header_fc), | |
527 | PRFIELD(stream_class->event_common_context_fc)); | |
10b7a2e4 PP |
528 | trace_class = bt_stream_class_borrow_trace_class_inline(stream_class); |
529 | if (!trace_class) { | |
57ffc2f1 PP |
530 | return; |
531 | } | |
532 | ||
7b33a0e0 PP |
533 | BUF_APPEND(", %sassigns-auto-ec-id=%d, %sassigns-auto-stream-id=%d, " |
534 | "%spackets-have-discarded-ev-counter-snapshot=%d, " | |
535 | "%spackets-have-packet-counter-snapshot=%d, " | |
ecbb78c0 PP |
536 | "%spackets-have-default-begin-cs=%d, " |
537 | "%spackets-have-default-end-cs=%d", | |
7b33a0e0 PP |
538 | PRFIELD(stream_class->assigns_automatic_event_class_id), |
539 | PRFIELD(stream_class->assigns_automatic_stream_id), | |
540 | PRFIELD(stream_class->packets_have_discarded_event_counter_snapshot), | |
541 | PRFIELD(stream_class->packets_have_packet_counter_snapshot), | |
ecbb78c0 PP |
542 | PRFIELD(stream_class->packets_have_default_beginning_cs), |
543 | PRFIELD(stream_class->packets_have_default_end_cs)); | |
10b7a2e4 PP |
544 | BUF_APPEND(", %strace-class-addr=%p", PRFIELD(trace_class)); |
545 | SET_TMP_PREFIX("trace-class-"); | |
546 | format_trace_class(buf_ch, false, tmp_prefix, trace_class); | |
a6918753 PP |
547 | SET_TMP_PREFIX("ehf-pool-"); |
548 | format_object_pool(buf_ch, extended, prefix, | |
549 | &stream_class->event_header_field_pool); | |
f7c3ac09 PP |
550 | SET_TMP_PREFIX("pcf-pool-"); |
551 | format_object_pool(buf_ch, extended, prefix, | |
552 | &stream_class->packet_context_field_pool); | |
8deee039 PP |
553 | } |
554 | ||
18acc6f8 | 555 | static inline void format_event_class(char **buf_ch, bool extended, |
10b7a2e4 | 556 | const char *prefix, const struct bt_event_class *event_class) |
8deee039 | 557 | { |
10b7a2e4 PP |
558 | const struct bt_stream_class *stream_class; |
559 | const struct bt_trace_class *trace_class; | |
57ffc2f1 PP |
560 | char tmp_prefix[64]; |
561 | ||
7b33a0e0 | 562 | BUF_APPEND(", %sid=%" PRIu64, PRFIELD(event_class->id)); |
57ffc2f1 | 563 | |
7b33a0e0 | 564 | if (event_class->name.value) { |
18acc6f8 | 565 | BUF_APPEND(", %sname=\"%s\"", |
7b33a0e0 | 566 | PRFIELD(event_class->name.value)); |
57ffc2f1 PP |
567 | } |
568 | ||
569 | if (!extended) { | |
570 | return; | |
571 | } | |
572 | ||
7b33a0e0 PP |
573 | BUF_APPEND(", %sis-frozen=%d", PRFIELD(event_class->frozen)); |
574 | ||
575 | if (event_class->log_level.base.avail) { | |
576 | BUF_APPEND(", %slog-level=%s", | |
577 | PRFIELD(bt_common_event_class_log_level_string( | |
578 | (int) event_class->log_level.value))); | |
579 | } | |
57ffc2f1 | 580 | |
7b33a0e0 | 581 | if (event_class->emf_uri.value) { |
57ffc2f1 | 582 | BUF_APPEND(", %semf-uri=\"%s\"", |
7b33a0e0 | 583 | PRFIELD(event_class->emf_uri.value)); |
57ffc2f1 PP |
584 | } |
585 | ||
939190b3 PP |
586 | BUF_APPEND(", %sspecific-context-fc-addr=%p, %spayload-fc-addr=%p", |
587 | PRFIELD(event_class->specific_context_fc), | |
588 | PRFIELD(event_class->payload_fc)); | |
57ffc2f1 | 589 | |
10b7a2e4 | 590 | stream_class = bt_event_class_borrow_stream_class_const(event_class); |
57ffc2f1 PP |
591 | if (!stream_class) { |
592 | return; | |
593 | } | |
594 | ||
595 | BUF_APPEND(", %sstream-class-addr=%p", PRFIELD(stream_class)); | |
596 | SET_TMP_PREFIX("stream-class-"); | |
18acc6f8 | 597 | format_stream_class(buf_ch, false, tmp_prefix, stream_class); |
10b7a2e4 PP |
598 | trace_class = bt_stream_class_borrow_trace_class_inline(stream_class); |
599 | if (!trace_class) { | |
57ffc2f1 PP |
600 | return; |
601 | } | |
602 | ||
10b7a2e4 PP |
603 | BUF_APPEND(", %strace-class-addr=%p", PRFIELD(trace_class)); |
604 | SET_TMP_PREFIX("trace-class-"); | |
605 | format_trace_class(buf_ch, false, tmp_prefix, trace_class); | |
a6918753 PP |
606 | SET_TMP_PREFIX("event-pool-"); |
607 | format_object_pool(buf_ch, extended, prefix, &event_class->event_pool); | |
8deee039 PP |
608 | } |
609 | ||
18acc6f8 | 610 | static inline void format_stream(char **buf_ch, bool extended, |
10b7a2e4 | 611 | const char *prefix, const struct bt_stream *stream) |
8deee039 | 612 | { |
10b7a2e4 PP |
613 | const struct bt_stream_class *stream_class; |
614 | const struct bt_trace_class *trace_class = NULL; | |
615 | const struct bt_trace *trace = NULL; | |
57ffc2f1 PP |
616 | char tmp_prefix[64]; |
617 | ||
7b33a0e0 | 618 | BUF_APPEND(", %sid=%" PRIu64, PRFIELD(stream->id)); |
57ffc2f1 | 619 | |
7b33a0e0 PP |
620 | if (stream->name.value) { |
621 | BUF_APPEND(", %sname=\"%s\"", PRFIELD(stream->name.value)); | |
57ffc2f1 PP |
622 | } |
623 | ||
57ffc2f1 PP |
624 | if (!extended) { |
625 | return; | |
626 | } | |
627 | ||
10b7a2e4 PP |
628 | stream_class = bt_stream_borrow_class_const(stream); |
629 | if (stream_class) { | |
630 | BUF_APPEND(", %sstream-class-addr=%p", PRFIELD(stream_class)); | |
631 | SET_TMP_PREFIX("stream-class-"); | |
632 | format_stream_class(buf_ch, false, tmp_prefix, stream_class); | |
633 | trace_class = bt_stream_class_borrow_trace_class_inline(stream_class); | |
57ffc2f1 PP |
634 | } |
635 | ||
10b7a2e4 PP |
636 | if (trace_class) { |
637 | BUF_APPEND(", %strace-class-addr=%p", PRFIELD(trace_class)); | |
638 | SET_TMP_PREFIX("trace-class-"); | |
639 | format_trace_class(buf_ch, false, tmp_prefix, trace_class); | |
640 | } | |
641 | ||
642 | trace = bt_stream_borrow_trace_inline(stream); | |
643 | if (trace) { | |
644 | BUF_APPEND(", %strace-addr=%p", PRFIELD(trace)); | |
645 | SET_TMP_PREFIX("trace-"); | |
646 | format_trace(buf_ch, false, tmp_prefix, trace); | |
57ffc2f1 PP |
647 | } |
648 | ||
a6918753 PP |
649 | SET_TMP_PREFIX("packet-pool-"); |
650 | format_object_pool(buf_ch, extended, prefix, &stream->packet_pool); | |
8deee039 PP |
651 | } |
652 | ||
57ffc2f1 | 653 | static inline void format_packet(char **buf_ch, bool extended, |
10b7a2e4 | 654 | const char *prefix, const struct bt_packet *packet) |
57ffc2f1 | 655 | { |
10b7a2e4 PP |
656 | const struct bt_stream *stream; |
657 | const struct bt_trace_class *trace_class; | |
57ffc2f1 PP |
658 | char tmp_prefix[64]; |
659 | ||
660 | if (!extended) { | |
661 | return; | |
662 | } | |
663 | ||
664 | BUF_APPEND(", %sis-frozen=%d, %sheader-field-addr=%p, " | |
665 | "%scontext-field-addr=%p", | |
666 | PRFIELD(packet->frozen), | |
7b33a0e0 PP |
667 | PRFIELD(packet->header_field ? packet->header_field->field : NULL), |
668 | PRFIELD(packet->context_field ? packet->context_field->field : NULL)); | |
10b7a2e4 | 669 | stream = bt_packet_borrow_stream_const(packet); |
57ffc2f1 PP |
670 | if (!stream) { |
671 | return; | |
672 | } | |
673 | ||
ecbb78c0 PP |
674 | if (packet->default_beginning_cs) { |
675 | SET_TMP_PREFIX("default-begin-cs-"); | |
676 | format_clock_snapshot(buf_ch, true, tmp_prefix, | |
677 | packet->default_beginning_cs); | |
7b33a0e0 PP |
678 | } |
679 | ||
ecbb78c0 PP |
680 | if (packet->default_end_cs) { |
681 | SET_TMP_PREFIX("default-end-cs-"); | |
682 | format_clock_snapshot(buf_ch, true, tmp_prefix, | |
683 | packet->default_end_cs); | |
7b33a0e0 PP |
684 | } |
685 | ||
686 | if (packet->discarded_event_counter_snapshot.base.avail) { | |
687 | BUF_APPEND(", %sdiscarded-ev-counter-snapshot=%" PRIu64, | |
688 | PRFIELD(packet->discarded_event_counter_snapshot.value)); | |
689 | } | |
690 | ||
691 | if (packet->packet_counter_snapshot.base.avail) { | |
692 | BUF_APPEND(", %spacket-counter-snapshot=%" PRIu64, | |
693 | PRFIELD(packet->packet_counter_snapshot.value)); | |
694 | } | |
695 | ||
57ffc2f1 PP |
696 | BUF_APPEND(", %sstream-addr=%p", PRFIELD(stream)); |
697 | SET_TMP_PREFIX("stream-"); | |
698 | format_stream(buf_ch, false, tmp_prefix, stream); | |
10b7a2e4 PP |
699 | trace_class = (const struct bt_trace_class *) bt_object_borrow_parent(&stream->base); |
700 | if (!trace_class) { | |
57ffc2f1 PP |
701 | return; |
702 | } | |
703 | ||
10b7a2e4 PP |
704 | BUF_APPEND(", %strace-class-addr=%p", PRFIELD(trace_class)); |
705 | SET_TMP_PREFIX("trace-class-"); | |
706 | format_trace_class(buf_ch, false, tmp_prefix, trace_class); | |
57ffc2f1 PP |
707 | } |
708 | ||
18acc6f8 | 709 | static inline void format_event(char **buf_ch, bool extended, |
10b7a2e4 | 710 | const char *prefix, const struct bt_event *event) |
57ffc2f1 | 711 | { |
10b7a2e4 PP |
712 | const struct bt_packet *packet; |
713 | const struct bt_stream *stream; | |
714 | const struct bt_trace_class *trace_class; | |
715 | const struct bt_stream_class *stream_class; | |
57ffc2f1 PP |
716 | char tmp_prefix[64]; |
717 | ||
718 | if (!extended) { | |
719 | return; | |
720 | } | |
721 | ||
722 | BUF_APPEND(", %sis-frozen=%d, %sheader-field-addr=%p, " | |
7b33a0e0 | 723 | "%scommon-context-field-addr=%p, " |
834e9996 | 724 | "%sspecific-context-field-addr=%p, " |
7b33a0e0 | 725 | "%spayload-field-addr=%p, ", |
57ffc2f1 | 726 | PRFIELD(event->frozen), |
18acc6f8 PP |
727 | PRFIELD(event->header_field ? |
728 | event->header_field->field : NULL), | |
7b33a0e0 PP |
729 | PRFIELD(event->common_context_field), |
730 | PRFIELD(event->specific_context_field), | |
8deee039 PP |
731 | PRFIELD(event->payload_field)); |
732 | BUF_APPEND(", %sevent-class-addr=%p", PRFIELD(event->class)); | |
a6918753 PP |
733 | |
734 | if (!event->class) { | |
735 | return; | |
736 | } | |
737 | ||
57ffc2f1 | 738 | SET_TMP_PREFIX("event-class-"); |
18acc6f8 PP |
739 | format_event_class(buf_ch, false, tmp_prefix, event->class); |
740 | stream_class = bt_event_class_borrow_stream_class(event->class); | |
57ffc2f1 PP |
741 | if (stream_class) { |
742 | BUF_APPEND(", %sstream-class-addr=%p", PRFIELD(stream_class)); | |
743 | SET_TMP_PREFIX("stream-class-"); | |
18acc6f8 | 744 | format_stream_class(buf_ch, false, tmp_prefix, |
8deee039 | 745 | stream_class); |
57ffc2f1 | 746 | |
10b7a2e4 PP |
747 | trace_class = bt_stream_class_borrow_trace_class_inline( |
748 | stream_class); | |
749 | if (trace_class) { | |
750 | BUF_APPEND(", %strace-class-addr=%p", | |
751 | PRFIELD(trace_class)); | |
752 | SET_TMP_PREFIX("trace-class-"); | |
753 | format_trace_class(buf_ch, false, tmp_prefix, | |
754 | trace_class); | |
57ffc2f1 PP |
755 | } |
756 | } | |
8deee039 | 757 | |
ecbb78c0 PP |
758 | if (event->default_cs) { |
759 | SET_TMP_PREFIX("default-cs-"); | |
760 | format_clock_snapshot(buf_ch, true, tmp_prefix, | |
761 | event->default_cs); | |
7b33a0e0 PP |
762 | } |
763 | ||
10b7a2e4 | 764 | packet = bt_event_borrow_packet_const(event); |
57ffc2f1 PP |
765 | if (!packet) { |
766 | return; | |
767 | } | |
768 | ||
769 | BUF_APPEND(", %spacket-addr=%p", PRFIELD(packet)); | |
770 | SET_TMP_PREFIX("packet-"); | |
771 | format_packet(buf_ch, false, tmp_prefix, packet); | |
10b7a2e4 | 772 | stream = bt_packet_borrow_stream_const(packet); |
57ffc2f1 PP |
773 | if (!stream) { |
774 | return; | |
775 | } | |
776 | ||
777 | BUF_APPEND(", %sstream-addr=%p", PRFIELD(stream)); | |
778 | SET_TMP_PREFIX("stream-"); | |
779 | format_stream(buf_ch, false, tmp_prefix, stream); | |
780 | } | |
781 | ||
782 | static inline void format_clock_class(char **buf_ch, bool extended, | |
10b7a2e4 | 783 | const char *prefix, const struct bt_clock_class *clock_class) |
57ffc2f1 | 784 | { |
a6918753 PP |
785 | char tmp_prefix[64]; |
786 | ||
7b33a0e0 PP |
787 | if (clock_class->name.value) { |
788 | BUF_APPEND(", %sname=\"%s\"", PRFIELD(clock_class->name.value)); | |
789 | } | |
790 | ||
791 | BUF_APPEND(", %sfreq=%" PRIu64, PRFIELD(clock_class->frequency)); | |
57ffc2f1 PP |
792 | |
793 | if (!extended) { | |
794 | return; | |
795 | } | |
796 | ||
7b33a0e0 PP |
797 | if (clock_class->description.value) { |
798 | BUF_APPEND(", %spartial-descr=\"%.32s\"", | |
799 | PRFIELD(clock_class->description.value)); | |
800 | } | |
801 | ||
802 | if (clock_class->uuid.value) { | |
803 | BUF_APPEND_UUID(clock_class->uuid.value); | |
57ffc2f1 PP |
804 | } |
805 | ||
806 | BUF_APPEND(", %sis-frozen=%d, %sprecision=%" PRIu64 ", " | |
807 | "%soffset-s=%" PRId64 ", " | |
7b33a0e0 PP |
808 | "%soffset-cycles=%" PRIu64 ", %sis-absolute=%d, " |
809 | "%sbase-offset-ns=%" PRId64, | |
57ffc2f1 | 810 | PRFIELD(clock_class->frozen), PRFIELD(clock_class->precision), |
7b33a0e0 PP |
811 | PRFIELD(clock_class->offset_seconds), |
812 | PRFIELD(clock_class->offset_cycles), | |
813 | PRFIELD(clock_class->is_absolute), | |
814 | PRFIELD(clock_class->base_offset.value_ns)); | |
a6918753 | 815 | |
ecbb78c0 PP |
816 | SET_TMP_PREFIX("cs-pool-"); |
817 | format_object_pool(buf_ch, extended, prefix, &clock_class->cs_pool); | |
57ffc2f1 PP |
818 | } |
819 | ||
ecbb78c0 PP |
820 | static inline void format_clock_snapshot(char **buf_ch, bool extended, |
821 | const char *prefix, const struct bt_clock_snapshot *clock_snapshot) | |
57ffc2f1 PP |
822 | { |
823 | char tmp_prefix[64]; | |
7b33a0e0 | 824 | BUF_APPEND(", %svalue=%" PRIu64 ", %sns-from-origin=%" PRId64, |
ecbb78c0 PP |
825 | PRFIELD(clock_snapshot->value_cycles), |
826 | PRFIELD(clock_snapshot->ns_from_origin)); | |
57ffc2f1 PP |
827 | |
828 | if (!extended) { | |
829 | return; | |
830 | } | |
831 | ||
ecbb78c0 | 832 | BUF_APPEND(", %sis-set=%d", PRFIELD(clock_snapshot->is_set)); |
834e9996 | 833 | |
ecbb78c0 | 834 | if (clock_snapshot->clock_class) { |
834e9996 | 835 | BUF_APPEND(", %sclock-class-addr=%p", |
ecbb78c0 | 836 | PRFIELD(clock_snapshot->clock_class)); |
834e9996 PP |
837 | SET_TMP_PREFIX("clock-class-"); |
838 | format_clock_class(buf_ch, false, tmp_prefix, | |
ecbb78c0 | 839 | clock_snapshot->clock_class); |
834e9996 | 840 | } |
57ffc2f1 PP |
841 | } |
842 | ||
843 | static inline void format_value(char **buf_ch, bool extended, | |
10b7a2e4 | 844 | const char *prefix, const struct bt_value *value) |
57ffc2f1 PP |
845 | { |
846 | BUF_APPEND(", %stype=%s", | |
17582c6d | 847 | PRFIELD(bt_common_value_type_string(bt_value_get_type(value)))); |
57ffc2f1 PP |
848 | |
849 | if (!extended) { | |
850 | return; | |
851 | } | |
852 | ||
853 | switch (bt_value_get_type(value)) { | |
854 | case BT_VALUE_TYPE_BOOL: | |
855 | { | |
b5cdc106 | 856 | bt_bool val = bt_value_bool_get(value); |
57ffc2f1 | 857 | |
57ffc2f1 PP |
858 | BUF_APPEND(", %svalue=%d", PRFIELD(val)); |
859 | break; | |
860 | } | |
861 | case BT_VALUE_TYPE_INTEGER: | |
862 | { | |
b5cdc106 | 863 | int64_t val = bt_value_integer_get(value); |
57ffc2f1 | 864 | |
57ffc2f1 PP |
865 | BUF_APPEND(", %svalue=%" PRId64, PRFIELD(val)); |
866 | break; | |
867 | } | |
944421ed | 868 | case BT_VALUE_TYPE_REAL: |
57ffc2f1 | 869 | { |
b5cdc106 | 870 | double val = bt_value_real_get(value); |
57ffc2f1 | 871 | |
57ffc2f1 PP |
872 | BUF_APPEND(", %svalue=%f", PRFIELD(val)); |
873 | break; | |
874 | } | |
875 | case BT_VALUE_TYPE_STRING: | |
876 | { | |
b5cdc106 | 877 | const char *val = bt_value_string_get(value); |
57ffc2f1 | 878 | |
57ffc2f1 PP |
879 | BUF_APPEND(", %spartial-value=\"%.32s\"", PRFIELD(val)); |
880 | break; | |
881 | } | |
882 | case BT_VALUE_TYPE_ARRAY: | |
883 | { | |
44514773 | 884 | int64_t count = bt_value_array_get_size(value); |
57ffc2f1 | 885 | |
8b45963b | 886 | BT_ASSERT(count >= 0); |
57ffc2f1 PP |
887 | BUF_APPEND(", %selement-count=%" PRId64, PRFIELD(count)); |
888 | break; | |
889 | } | |
890 | case BT_VALUE_TYPE_MAP: | |
891 | { | |
44514773 | 892 | int64_t count = bt_value_map_get_size(value); |
57ffc2f1 | 893 | |
8b45963b | 894 | BT_ASSERT(count >= 0); |
57ffc2f1 PP |
895 | BUF_APPEND(", %selement-count=%" PRId64, PRFIELD(count)); |
896 | break; | |
897 | } | |
898 | default: | |
899 | break; | |
900 | } | |
901 | } | |
902 | ||
b09a5592 PP |
903 | static inline void format_message(char **buf_ch, bool extended, |
904 | const char *prefix, const struct bt_message *msg) | |
57ffc2f1 PP |
905 | { |
906 | char tmp_prefix[64]; | |
907 | ||
908 | BUF_APPEND(", %stype=%s", | |
b09a5592 | 909 | PRFIELD(bt_message_type_string(msg->type))); |
57ffc2f1 PP |
910 | |
911 | if (!extended) { | |
912 | return; | |
913 | } | |
914 | ||
f7c3ac09 | 915 | BUF_APPEND(", %sis-frozen=%d, %sgraph-addr=%p", |
b09a5592 | 916 | PRFIELD(msg->frozen), PRFIELD(msg->graph)); |
57ffc2f1 | 917 | |
b09a5592 PP |
918 | switch (msg->type) { |
919 | case BT_MESSAGE_TYPE_EVENT: | |
57ffc2f1 | 920 | { |
b09a5592 PP |
921 | const struct bt_message_event *msg_event = |
922 | (const void *) msg; | |
57ffc2f1 | 923 | |
b09a5592 | 924 | if (msg_event->event) { |
834e9996 | 925 | SET_TMP_PREFIX("event-"); |
b09a5592 | 926 | format_event(buf_ch, true, tmp_prefix, msg_event->event); |
834e9996 PP |
927 | } |
928 | ||
57ffc2f1 PP |
929 | break; |
930 | } | |
b09a5592 | 931 | case BT_MESSAGE_TYPE_STREAM_BEGINNING: |
57ffc2f1 | 932 | { |
b09a5592 PP |
933 | const struct bt_message_stream_beginning *msg_stream = |
934 | (const void *) msg; | |
57ffc2f1 | 935 | |
b09a5592 | 936 | if (msg_stream->stream) { |
834e9996 | 937 | SET_TMP_PREFIX("stream-"); |
b09a5592 | 938 | format_stream(buf_ch, true, tmp_prefix, msg_stream->stream); |
834e9996 PP |
939 | } |
940 | ||
57ffc2f1 PP |
941 | break; |
942 | } | |
b09a5592 | 943 | case BT_MESSAGE_TYPE_STREAM_END: |
57ffc2f1 | 944 | { |
b09a5592 PP |
945 | const struct bt_message_stream_end *msg_stream = |
946 | (const void *) msg; | |
57ffc2f1 | 947 | |
b09a5592 | 948 | if (msg_stream->stream) { |
834e9996 | 949 | SET_TMP_PREFIX("stream-"); |
b09a5592 | 950 | format_stream(buf_ch, true, tmp_prefix, msg_stream->stream); |
834e9996 PP |
951 | } |
952 | ||
57ffc2f1 PP |
953 | break; |
954 | } | |
b09a5592 | 955 | case BT_MESSAGE_TYPE_PACKET_BEGINNING: |
57ffc2f1 | 956 | { |
b09a5592 PP |
957 | const struct bt_message_packet_beginning *msg_packet = |
958 | (const void *) msg; | |
57ffc2f1 | 959 | |
b09a5592 | 960 | if (msg_packet->packet) { |
834e9996 | 961 | SET_TMP_PREFIX("packet-"); |
b09a5592 | 962 | format_packet(buf_ch, true, tmp_prefix, msg_packet->packet); |
834e9996 PP |
963 | } |
964 | ||
57ffc2f1 PP |
965 | break; |
966 | } | |
b09a5592 | 967 | case BT_MESSAGE_TYPE_PACKET_END: |
57ffc2f1 | 968 | { |
b09a5592 PP |
969 | const struct bt_message_packet_end *msg_packet = |
970 | (const void *) msg; | |
57ffc2f1 | 971 | |
b09a5592 | 972 | if (msg_packet->packet) { |
834e9996 | 973 | SET_TMP_PREFIX("packet-"); |
b09a5592 | 974 | format_packet(buf_ch, true, tmp_prefix, msg_packet->packet); |
834e9996 PP |
975 | } |
976 | ||
57ffc2f1 PP |
977 | break; |
978 | } | |
57ffc2f1 PP |
979 | default: |
980 | break; | |
981 | } | |
982 | } | |
983 | ||
984 | static inline void format_plugin_so_shared_lib_handle(char **buf_ch, | |
985 | const char *prefix, | |
10b7a2e4 | 986 | const struct bt_plugin_so_shared_lib_handle *handle) |
57ffc2f1 PP |
987 | { |
988 | BUF_APPEND(", %saddr=%p", PRFIELD(handle)); | |
989 | ||
990 | if (handle->path) { | |
834e9996 | 991 | BUF_APPEND(", %spath=\"%s\"", PRFIELD_GSTRING(handle->path)); |
57ffc2f1 PP |
992 | } |
993 | } | |
994 | ||
995 | static inline void format_component_class(char **buf_ch, bool extended, | |
10b7a2e4 PP |
996 | const char *prefix, |
997 | const struct bt_component_class *comp_class) | |
57ffc2f1 PP |
998 | { |
999 | char tmp_prefix[64]; | |
1000 | ||
1001 | BUF_APPEND(", %stype=%s, %sname=\"%s\"", | |
1002 | PRFIELD(bt_component_class_type_string(comp_class->type)), | |
834e9996 | 1003 | PRFIELD_GSTRING(comp_class->name)); |
57ffc2f1 PP |
1004 | |
1005 | if (comp_class->description) { | |
1006 | BUF_APPEND(", %spartial-descr=\"%.32s\"", | |
834e9996 | 1007 | PRFIELD_GSTRING(comp_class->description)); |
57ffc2f1 PP |
1008 | } |
1009 | ||
1010 | if (!extended) { | |
1011 | return; | |
1012 | } | |
1013 | ||
1014 | BUF_APPEND(", %sis-frozen=%d", PRFIELD(comp_class->frozen)); | |
1015 | ||
1016 | if (comp_class->so_handle) { | |
1017 | SET_TMP_PREFIX("so-handle-"); | |
1018 | format_plugin_so_shared_lib_handle(buf_ch, tmp_prefix, | |
1019 | comp_class->so_handle); | |
1020 | } | |
1021 | } | |
1022 | ||
1023 | static inline void format_component(char **buf_ch, bool extended, | |
10b7a2e4 | 1024 | const char *prefix, const struct bt_component *component) |
57ffc2f1 PP |
1025 | { |
1026 | char tmp_prefix[64]; | |
1027 | ||
834e9996 PP |
1028 | BUF_APPEND(", %sname=\"%s\"", |
1029 | PRFIELD_GSTRING(component->name)); | |
1030 | ||
1031 | if (component->class) { | |
1032 | SET_TMP_PREFIX("class-"); | |
1033 | format_component_class(buf_ch, extended, tmp_prefix, | |
1034 | component->class); | |
1035 | } | |
57ffc2f1 PP |
1036 | |
1037 | if (!extended) { | |
1038 | return; | |
1039 | } | |
1040 | ||
a6918753 PP |
1041 | if (component->input_ports) { |
1042 | BUF_APPEND(", %sinput-port-count=%u", | |
1043 | PRFIELD(component->input_ports->len)); | |
1044 | } | |
1045 | ||
1046 | if (component->output_ports) { | |
1047 | BUF_APPEND(", %soutput-port-count=%u", | |
1048 | PRFIELD(component->output_ports->len)); | |
1049 | } | |
57ffc2f1 PP |
1050 | } |
1051 | ||
1052 | static inline void format_port(char **buf_ch, bool extended, | |
10b7a2e4 | 1053 | const char *prefix, const struct bt_port *port) |
57ffc2f1 PP |
1054 | { |
1055 | char tmp_prefix[64]; | |
1056 | ||
1057 | BUF_APPEND(", %stype=%s, %sname=\"%s\"", | |
1058 | PRFIELD(bt_port_type_string(port->type)), | |
834e9996 | 1059 | PRFIELD_GSTRING(port->name)); |
57ffc2f1 PP |
1060 | |
1061 | if (!extended) { | |
1062 | return; | |
1063 | } | |
1064 | ||
1065 | if (port->connection) { | |
1066 | SET_TMP_PREFIX("conn-"); | |
1067 | format_connection(buf_ch, false, tmp_prefix, port->connection); | |
1068 | } | |
1069 | } | |
1070 | ||
1071 | static inline void format_connection(char **buf_ch, bool extended, | |
10b7a2e4 | 1072 | const char *prefix, const struct bt_connection *connection) |
57ffc2f1 PP |
1073 | { |
1074 | char tmp_prefix[64]; | |
1075 | ||
1076 | if (!extended) { | |
1077 | return; | |
1078 | } | |
1079 | ||
1080 | if (connection->upstream_port) { | |
1081 | SET_TMP_PREFIX("upstream-port-"); | |
1082 | format_port(buf_ch, false, tmp_prefix, | |
1083 | connection->upstream_port); | |
1084 | } | |
1085 | ||
1086 | if (connection->downstream_port) { | |
1087 | SET_TMP_PREFIX("downstream-port-"); | |
1088 | format_port(buf_ch, false, tmp_prefix, | |
1089 | connection->downstream_port); | |
1090 | } | |
1091 | } | |
1092 | ||
1093 | static inline void format_graph(char **buf_ch, bool extended, | |
10b7a2e4 | 1094 | const char *prefix, const struct bt_graph *graph) |
57ffc2f1 | 1095 | { |
f7c3ac09 PP |
1096 | char tmp_prefix[64]; |
1097 | ||
57ffc2f1 PP |
1098 | BUF_APPEND(", %sis-canceled=%d", PRFIELD(graph->canceled)); |
1099 | ||
1100 | if (!extended) { | |
1101 | return; | |
1102 | } | |
1103 | ||
a6918753 PP |
1104 | if (graph->components) { |
1105 | BUF_APPEND(", %scomp-count=%u", | |
1106 | PRFIELD(graph->components->len)); | |
1107 | } | |
1108 | ||
1109 | if (graph->connections) { | |
1110 | BUF_APPEND(", %sconn-count=%u", | |
1111 | PRFIELD(graph->connections->len)); | |
1112 | } | |
f7c3ac09 PP |
1113 | |
1114 | SET_TMP_PREFIX("en-pool-"); | |
1115 | format_object_pool(buf_ch, extended, prefix, | |
b09a5592 | 1116 | &graph->event_msg_pool); |
f7c3ac09 PP |
1117 | SET_TMP_PREFIX("pbn-pool-"); |
1118 | format_object_pool(buf_ch, extended, prefix, | |
b09a5592 | 1119 | &graph->packet_begin_msg_pool); |
f7c3ac09 PP |
1120 | SET_TMP_PREFIX("pen-pool-"); |
1121 | format_object_pool(buf_ch, extended, prefix, | |
b09a5592 | 1122 | &graph->packet_end_msg_pool); |
57ffc2f1 PP |
1123 | } |
1124 | ||
b09a5592 | 1125 | static inline void format_message_iterator(char **buf_ch, |
57ffc2f1 | 1126 | bool extended, const char *prefix, |
b09a5592 | 1127 | const struct bt_message_iterator *iterator) |
57ffc2f1 PP |
1128 | { |
1129 | const char *type; | |
1130 | char tmp_prefix[64]; | |
1131 | ||
b09a5592 PP |
1132 | if (iterator->type == BT_MESSAGE_ITERATOR_TYPE_SELF_COMPONENT_PORT_INPUT) { |
1133 | type = "BT_MESSAGE_ITERATOR_TYPE_SELF_COMPONENT_PORT_INPUT"; | |
1134 | } else if (iterator->type == BT_MESSAGE_ITERATOR_TYPE_PORT_OUTPUT) { | |
1135 | type = "BT_MESSAGE_ITERATOR_TYPE_PORT_OUTPUT"; | |
57ffc2f1 PP |
1136 | } else { |
1137 | type = "(unknown)"; | |
1138 | } | |
1139 | ||
1140 | BUF_APPEND(", %stype=%s", PRFIELD(type)); | |
1141 | ||
1142 | switch (iterator->type) { | |
b09a5592 | 1143 | case BT_MESSAGE_ITERATOR_TYPE_SELF_COMPONENT_PORT_INPUT: |
57ffc2f1 | 1144 | { |
b09a5592 | 1145 | const struct bt_self_component_port_input_message_iterator * |
10b7a2e4 | 1146 | port_in_iter = (const void *) iterator; |
57ffc2f1 | 1147 | |
834e9996 | 1148 | if (port_in_iter->upstream_component) { |
57ffc2f1 PP |
1149 | SET_TMP_PREFIX("upstream-comp-"); |
1150 | format_component(buf_ch, false, tmp_prefix, | |
834e9996 | 1151 | port_in_iter->upstream_component); |
57ffc2f1 PP |
1152 | } |
1153 | ||
834e9996 | 1154 | if (port_in_iter->upstream_port) { |
57ffc2f1 PP |
1155 | SET_TMP_PREFIX("upstream-port-"); |
1156 | format_port(buf_ch, false, tmp_prefix, | |
834e9996 | 1157 | port_in_iter->upstream_port); |
57ffc2f1 PP |
1158 | } |
1159 | ||
834e9996 | 1160 | if (port_in_iter->connection) { |
57ffc2f1 PP |
1161 | SET_TMP_PREFIX("upstream-conn-"); |
1162 | format_connection(buf_ch, false, tmp_prefix, | |
834e9996 | 1163 | port_in_iter->connection); |
57ffc2f1 PP |
1164 | } |
1165 | break; | |
1166 | } | |
b09a5592 | 1167 | case BT_MESSAGE_ITERATOR_TYPE_PORT_OUTPUT: |
57ffc2f1 | 1168 | { |
b09a5592 | 1169 | const struct bt_port_output_message_iterator *port_out_iter = |
10b7a2e4 | 1170 | (const void *) iterator; |
57ffc2f1 | 1171 | |
834e9996 PP |
1172 | if (port_out_iter->graph) { |
1173 | SET_TMP_PREFIX("graph-"); | |
1174 | format_graph(buf_ch, false, tmp_prefix, | |
1175 | port_out_iter->graph); | |
1176 | } | |
1177 | ||
1178 | if (port_out_iter->colander) { | |
1179 | SET_TMP_PREFIX("colander-comp-"); | |
1180 | format_component(buf_ch, false, tmp_prefix, | |
1181 | (void *) port_out_iter->colander); | |
1182 | } | |
1183 | ||
57ffc2f1 PP |
1184 | break; |
1185 | } | |
1186 | default: | |
1187 | break; | |
1188 | } | |
1189 | } | |
1190 | ||
1191 | static inline void format_plugin(char **buf_ch, bool extended, | |
3a2cb327 | 1192 | const char *prefix, const struct bt_plugin *plugin) |
57ffc2f1 PP |
1193 | { |
1194 | char tmp_prefix[64]; | |
1195 | ||
1196 | BUF_APPEND(", %stype=%s", PRFIELD(bt_plugin_type_string(plugin->type))); | |
1197 | ||
1198 | if (plugin->info.path_set) { | |
1199 | BUF_APPEND(", %spath=\"%s\"", | |
834e9996 | 1200 | PRFIELD_GSTRING(plugin->info.path)); |
57ffc2f1 PP |
1201 | } |
1202 | ||
1203 | if (plugin->info.name_set) { | |
1204 | BUF_APPEND(", %sname=\"%s\"", | |
834e9996 | 1205 | PRFIELD_GSTRING(plugin->info.name)); |
57ffc2f1 PP |
1206 | } |
1207 | ||
1208 | if (!extended) { | |
1209 | return; | |
1210 | } | |
1211 | ||
1212 | if (plugin->info.author_set) { | |
1213 | BUF_APPEND(", %sauthor=\"%s\"", | |
834e9996 | 1214 | PRFIELD_GSTRING(plugin->info.author)); |
57ffc2f1 PP |
1215 | } |
1216 | ||
1217 | if (plugin->info.license_set) { | |
1218 | BUF_APPEND(", %slicense=\"%s\"", | |
834e9996 | 1219 | PRFIELD_GSTRING(plugin->info.license)); |
57ffc2f1 PP |
1220 | } |
1221 | ||
1222 | if (plugin->info.version_set) { | |
1223 | BUF_APPEND(", %sversion=%u.%u.%u%s", | |
1224 | PRFIELD(plugin->info.version.major), | |
1225 | plugin->info.version.minor, | |
1226 | plugin->info.version.patch, | |
1227 | plugin->info.version.extra ? | |
1228 | plugin->info.version.extra->str : ""); | |
1229 | } | |
1230 | ||
834e9996 PP |
1231 | BUF_APPEND(", %ssrc-comp-class-count=%u, %sflt-comp-class-count=%u, " |
1232 | "%ssink-comp-class-count=%u", | |
1233 | PRFIELD(plugin->src_comp_classes->len), | |
1234 | PRFIELD(plugin->flt_comp_classes->len), | |
1235 | PRFIELD(plugin->sink_comp_classes->len)); | |
57ffc2f1 PP |
1236 | |
1237 | if (plugin->spec_data) { | |
10b7a2e4 PP |
1238 | const struct bt_plugin_so_spec_data *spec_data = |
1239 | (const void *) plugin->spec_data; | |
57ffc2f1 PP |
1240 | |
1241 | if (spec_data->shared_lib_handle) { | |
1242 | SET_TMP_PREFIX("so-handle-"); | |
1243 | format_plugin_so_shared_lib_handle(buf_ch, tmp_prefix, | |
1244 | spec_data->shared_lib_handle); | |
1245 | } | |
1246 | } | |
1247 | } | |
1248 | ||
57ffc2f1 PP |
1249 | static inline void handle_conversion_specifier_bt(void *priv_data, |
1250 | char **buf_ch, size_t avail_size, | |
1251 | const char **out_fmt_ch, va_list *args) | |
1252 | { | |
1253 | const char *fmt_ch = *out_fmt_ch; | |
1254 | bool extended = false; | |
1255 | char prefix[64]; | |
1256 | char *prefix_ch = prefix; | |
10b7a2e4 | 1257 | const void *obj; |
57ffc2f1 PP |
1258 | |
1259 | /* skip "%!" */ | |
1260 | fmt_ch += 2; | |
1261 | ||
7b33a0e0 PP |
1262 | if (*fmt_ch == 'u') { |
1263 | /* UUID */ | |
1264 | obj = va_arg(*args, void *); | |
1265 | format_uuid(buf_ch, obj); | |
1266 | goto update_fmt; | |
1267 | } | |
1268 | ||
57ffc2f1 PP |
1269 | if (*fmt_ch == '[') { |
1270 | /* local prefix */ | |
1271 | fmt_ch++; | |
1272 | ||
1273 | while (true) { | |
1274 | if (*fmt_ch == ']') { | |
1275 | *prefix_ch = '\0'; | |
1276 | fmt_ch++; | |
1277 | break; | |
1278 | } | |
1279 | ||
1280 | *prefix_ch = *fmt_ch; | |
1281 | prefix_ch++; | |
1282 | fmt_ch++; | |
1283 | } | |
1284 | } | |
1285 | ||
1286 | *prefix_ch = '\0'; | |
1287 | ||
1288 | if (*fmt_ch == '+') { | |
1289 | extended = true; | |
1290 | fmt_ch++; | |
1291 | } | |
1292 | ||
1293 | obj = va_arg(*args, void *); | |
1294 | BUF_APPEND("%saddr=%p", prefix, obj); | |
1295 | ||
1296 | if (!obj) { | |
1297 | goto update_fmt; | |
1298 | } | |
1299 | ||
18acc6f8 PP |
1300 | switch (*fmt_ch) { |
1301 | case 'F': | |
939190b3 | 1302 | format_field_class(buf_ch, extended, prefix, obj); |
57ffc2f1 | 1303 | break; |
18acc6f8 PP |
1304 | case 'f': |
1305 | format_field(buf_ch, extended, prefix, obj); | |
1306 | break; | |
1307 | case 'P': | |
1308 | format_field_path(buf_ch, extended, prefix, obj); | |
1309 | break; | |
1310 | case 'E': | |
1311 | format_event_class(buf_ch, extended, prefix, obj); | |
1312 | break; | |
1313 | case 'e': | |
1314 | format_event(buf_ch, extended, prefix, obj); | |
1315 | break; | |
1316 | case 'S': | |
1317 | format_stream_class(buf_ch, extended, prefix, obj); | |
57ffc2f1 | 1318 | break; |
18acc6f8 PP |
1319 | case 's': |
1320 | format_stream(buf_ch, extended, prefix, obj); | |
1321 | break; | |
1322 | case 'a': | |
1323 | format_packet(buf_ch, extended, prefix, obj); | |
1324 | break; | |
1325 | case 't': | |
1326 | format_trace(buf_ch, extended, prefix, obj); | |
1327 | break; | |
10b7a2e4 PP |
1328 | case 'T': |
1329 | format_trace_class(buf_ch, extended, prefix, obj); | |
1330 | break; | |
18acc6f8 PP |
1331 | case 'K': |
1332 | format_clock_class(buf_ch, extended, prefix, obj); | |
1333 | break; | |
1334 | case 'k': | |
ecbb78c0 | 1335 | format_clock_snapshot(buf_ch, extended, prefix, obj); |
18acc6f8 PP |
1336 | break; |
1337 | case 'v': | |
1338 | format_value(buf_ch, extended, prefix, obj); | |
1339 | break; | |
1340 | case 'n': | |
b09a5592 | 1341 | format_message(buf_ch, extended, prefix, obj); |
18acc6f8 PP |
1342 | break; |
1343 | case 'i': | |
b09a5592 | 1344 | format_message_iterator(buf_ch, extended, prefix, obj); |
18acc6f8 PP |
1345 | break; |
1346 | case 'C': | |
1347 | format_component_class(buf_ch, extended, prefix, obj); | |
1348 | break; | |
1349 | case 'c': | |
1350 | format_component(buf_ch, extended, prefix, obj); | |
1351 | break; | |
1352 | case 'p': | |
1353 | format_port(buf_ch, extended, prefix, obj); | |
1354 | break; | |
1355 | case 'x': | |
1356 | format_connection(buf_ch, extended, prefix, obj); | |
1357 | break; | |
7b33a0e0 | 1358 | case 'l': |
18acc6f8 PP |
1359 | format_plugin(buf_ch, extended, prefix, obj); |
1360 | break; | |
1361 | case 'g': | |
1362 | format_graph(buf_ch, extended, prefix, obj); | |
1363 | break; | |
1364 | case 'o': | |
1365 | format_object_pool(buf_ch, extended, prefix, obj); | |
1366 | break; | |
1367 | case 'O': | |
1368 | format_object(buf_ch, extended, prefix, obj); | |
1369 | break; | |
1370 | default: | |
1371 | abort(); | |
57ffc2f1 PP |
1372 | } |
1373 | ||
1374 | update_fmt: | |
1375 | fmt_ch++; | |
1376 | *out_fmt_ch = fmt_ch; | |
1377 | } | |
1378 | ||
1379 | BT_HIDDEN | |
1380 | void bt_lib_log(const char *func, const char *file, unsigned line, | |
1381 | int lvl, const char *tag, const char *fmt, ...) | |
1382 | { | |
1383 | va_list args; | |
1384 | ||
8b45963b | 1385 | BT_ASSERT(fmt); |
57ffc2f1 PP |
1386 | va_start(args, fmt); |
1387 | bt_common_custom_vsnprintf(lib_logging_buf, LIB_LOGGING_BUF_SIZE, '!', | |
1388 | handle_conversion_specifier_bt, NULL, fmt, &args); | |
1389 | va_end(args); | |
1390 | _bt_log_write_d(func, file, line, lvl, tag, "%s", lib_logging_buf); | |
1391 | } |