2 * Copyright 2018 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.
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
23 #define BT_LOG_TAG "LIB-LOGGING"
33 #include <babeltrace/common-internal.h>
34 #include <babeltrace/lib-logging-internal.h>
35 #include <babeltrace/values-internal.h>
36 #include <babeltrace/object-pool-internal.h>
37 #include <babeltrace/ctf-ir/field-types-internal.h>
38 #include <babeltrace/ctf-ir/fields-internal.h>
39 #include <babeltrace/ctf-ir/event-class-internal.h>
40 #include <babeltrace/ctf-ir/event-internal.h>
41 #include <babeltrace/ctf-ir/packet-internal.h>
42 #include <babeltrace/ctf-ir/stream-class-internal.h>
43 #include <babeltrace/ctf-ir/stream-internal.h>
44 #include <babeltrace/ctf-ir/trace-internal.h>
45 #include <babeltrace/ctf-ir/clock-class-internal.h>
46 #include <babeltrace/ctf-ir/clock-value-internal.h>
47 #include <babeltrace/ctf-ir/field-path-internal.h>
48 #include <babeltrace/ctf-ir/utils-internal.h>
49 #include <babeltrace/ctf-writer/field-types-internal.h>
50 #include <babeltrace/ctf-writer/fields-internal.h>
51 #include <babeltrace/ctf-writer/event-internal.h>
52 #include <babeltrace/ctf-writer/stream-class-internal.h>
53 #include <babeltrace/ctf-writer/stream-internal.h>
54 #include <babeltrace/ctf-writer/trace-internal.h>
55 #include <babeltrace/ctf-writer/clock-internal.h>
56 #include <babeltrace/ctf-writer/writer-internal.h>
57 #include <babeltrace/graph/clock-class-priority-map-internal.h>
58 #include <babeltrace/graph/component-class-internal.h>
59 #include <babeltrace/graph/component-class-sink-colander-internal.h>
60 #include <babeltrace/graph/component-filter-internal.h>
61 #include <babeltrace/graph/component-internal.h>
62 #include <babeltrace/graph/component-sink-internal.h>
63 #include <babeltrace/graph/component-source-internal.h>
64 #include <babeltrace/graph/connection-internal.h>
65 #include <babeltrace/graph/graph-internal.h>
66 #include <babeltrace/graph/notification-discarded-elements-internal.h>
67 #include <babeltrace/graph/notification-event-internal.h>
68 #include <babeltrace/graph/notification-inactivity-internal.h>
69 #include <babeltrace/graph/notification-internal.h>
70 #include <babeltrace/graph/notification-iterator-internal.h>
71 #include <babeltrace/graph/notification-packet-internal.h>
72 #include <babeltrace/graph/notification-stream-internal.h>
73 #include <babeltrace/graph/port-internal.h>
74 #include <babeltrace/plugin/plugin-internal.h>
75 #include <babeltrace/plugin/plugin-so-internal.h>
77 #define LIB_LOGGING_BUF_SIZE (4096 * 4)
79 static char __thread lib_logging_buf
[LIB_LOGGING_BUF_SIZE
];
81 #define BUF_APPEND(_fmt, ...) \
84 size_t _size = LIB_LOGGING_BUF_SIZE - \
85 (size_t) (*buf_ch - lib_logging_buf); \
86 _count = snprintf(*buf_ch, _size, (_fmt), __VA_ARGS__); \
87 BT_ASSERT(_count >= 0); \
88 *buf_ch += MIN(_count, _size); \
89 if (*buf_ch >= lib_logging_buf + LIB_LOGGING_BUF_SIZE - 1) { \
94 #define BUF_APPEND_UUID(_uuid) \
95 BUF_APPEND(", %suuid=\"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\"", \
97 (unsigned int) (_uuid)[0], \
98 (unsigned int) (_uuid)[1], \
99 (unsigned int) (_uuid)[2], \
100 (unsigned int) (_uuid)[3], \
101 (unsigned int) (_uuid)[4], \
102 (unsigned int) (_uuid)[5], \
103 (unsigned int) (_uuid)[6], \
104 (unsigned int) (_uuid)[7], \
105 (unsigned int) (_uuid)[8], \
106 (unsigned int) (_uuid)[9], \
107 (unsigned int) (_uuid)[10], \
108 (unsigned int) (_uuid)[11], \
109 (unsigned int) (_uuid)[12], \
110 (unsigned int) (_uuid)[13], \
111 (unsigned int) (_uuid)[14], \
112 (unsigned int) (_uuid)[15])
114 #define PRFIELD(_expr) prefix, (_expr)
116 #define SET_TMP_PREFIX(_prefix2) \
118 strcpy(tmp_prefix, prefix); \
119 strcat(tmp_prefix, (_prefix2)); \
122 typedef void (*format_func
)(char **, bool, const char *, void *);
124 static inline void format_component(char **buf_ch
, bool extended
,
125 const char *prefix
, struct bt_component
*component
);
127 static inline void format_port(char **buf_ch
, bool extended
,
128 const char *prefix
, struct bt_port
*port
);
130 static inline void format_connection(char **buf_ch
, bool extended
,
131 const char *prefix
, struct bt_connection
*connection
);
133 static inline void format_object(char **buf_ch
, bool extended
,
134 const char *prefix
, struct bt_object
*obj
)
136 BUF_APPEND(", %sref-count=%llu", prefix
, obj
->ref_count
);
139 static inline void format_object_pool(char **buf_ch
, bool extended
,
140 const char *prefix
, struct bt_object_pool
*pool
)
142 BUF_APPEND(", %ssize=%zu", PRFIELD(pool
->size
));
145 BUF_APPEND(", %scap=%u", PRFIELD(pool
->objects
->len
));
149 static inline void format_field_type_common(char **buf_ch
, bool extended
,
150 const char *prefix
, struct bt_field_type_common
*field_type
)
152 BUF_APPEND(", %stype-id=%s, %salignment=%u",
153 PRFIELD(bt_common_field_type_id_string(field_type
->id
)),
154 PRFIELD(field_type
->alignment
));
157 BUF_APPEND(", %sis-frozen=%d", PRFIELD(field_type
->frozen
));
162 if (field_type
->id
== BT_FIELD_TYPE_ID_UNKNOWN
) {
166 switch (field_type
->id
) {
167 case BT_FIELD_TYPE_ID_INTEGER
:
169 struct bt_field_type_common_integer
*integer
=
170 BT_FROM_COMMON(field_type
);
172 BUF_APPEND(", %ssize=%u, %sis-signed=%d, %sbyte-order=%s, "
173 "%sbase=%d, %sencoding=%s, "
174 "%smapped-clock-class-addr=%p",
175 PRFIELD(integer
->size
), PRFIELD(integer
->is_signed
),
176 PRFIELD(bt_common_byte_order_string(integer
->user_byte_order
)),
177 PRFIELD(integer
->base
),
178 PRFIELD(bt_common_string_encoding_string(integer
->encoding
)),
179 PRFIELD(integer
->mapped_clock_class
));
181 if (integer
->mapped_clock_class
) {
182 BUF_APPEND(", %smapped-clock-class-name=\"%s\"",
183 PRFIELD(bt_clock_class_get_name(integer
->mapped_clock_class
)));
187 case BT_FIELD_TYPE_ID_FLOAT
:
189 struct bt_field_type_common_floating_point
*flt
=
190 BT_FROM_COMMON(field_type
);
192 BUF_APPEND(", %sexp-dig=%u, %smant-dig=%u, %sbyte-order=%s",
193 PRFIELD(flt
->exp_dig
), PRFIELD(flt
->mant_dig
),
194 PRFIELD(bt_common_byte_order_string(flt
->user_byte_order
)));
197 case BT_FIELD_TYPE_ID_ENUM
:
199 struct bt_field_type_common_enumeration
*enm
=
200 BT_FROM_COMMON(field_type
);
202 BUF_APPEND(", %smapping-count=%u",
203 PRFIELD(enm
->entries
->len
));
206 case BT_FIELD_TYPE_ID_STRING
:
208 struct bt_field_type_common_string
*str
=
209 BT_FROM_COMMON(field_type
);
211 BUF_APPEND(", %sencoding=%s",
212 PRFIELD(bt_common_string_encoding_string(str
->encoding
)));
215 case BT_FIELD_TYPE_ID_STRUCT
:
217 struct bt_field_type_common_structure
*structure
=
218 BT_FROM_COMMON(field_type
);
220 BUF_APPEND(", %sfield-count=%u",
221 PRFIELD(structure
->fields
->len
));
224 case BT_FIELD_TYPE_ID_SEQUENCE
:
226 struct bt_field_type_common_sequence
*seq
=
227 BT_FROM_COMMON(field_type
);
229 BUF_APPEND(", %slength-ft-addr=\"%s\", %selem-ft-addr=%p",
230 PRFIELD(seq
->length_field_name
->str
),
231 PRFIELD(seq
->element_ft
));
234 case BT_FIELD_TYPE_ID_VARIANT
:
236 struct bt_field_type_common_variant
*variant
=
237 BT_FROM_COMMON(field_type
);
239 BUF_APPEND(", %stag-name=\"%s\", %sfield-count=%u",
240 PRFIELD(variant
->tag_name
->str
),
241 PRFIELD(variant
->choices
->len
));
249 static inline void format_field_type(char **buf_ch
, bool extended
,
250 const char *prefix
, struct bt_field_type
*field_type
)
252 format_field_type_common(buf_ch
, extended
, prefix
,
253 (void *) field_type
);
256 static inline void format_writer_field_type(char **buf_ch
, bool extended
,
257 const char *prefix
, struct bt_ctf_field_type
*field_type
)
259 format_field_type_common(buf_ch
, extended
, prefix
,
260 (void *) field_type
);
263 static inline void format_field_common_integer_extended(char **buf_ch
,
264 const char *prefix
, struct bt_field_common
*field
)
266 struct bt_field_common_integer
*integer
= BT_FROM_COMMON(field
);
267 struct bt_field_type_common_integer
*field_type
=
268 BT_FROM_COMMON(field
->type
);
269 const char *fmt
= NULL
;
271 BT_ASSERT(field_type
);
273 if (field_type
->base
== 8) {
274 fmt
= ", %svalue=%" PRIo64
;
275 } else if (field_type
->base
== 16) {
276 fmt
= ", %svalue=%" PRIx64
;
279 if (field_type
->is_signed
) {
281 fmt
= ", %svalue=%" PRId64
;
284 BUF_APPEND(fmt
, PRFIELD(integer
->payload
.signd
));
287 fmt
= ", %svalue=%" PRIu64
;
290 BUF_APPEND(fmt
, PRFIELD(integer
->payload
.unsignd
));
294 static inline void format_field_common(char **buf_ch
, bool extended
,
295 const char *prefix
, struct bt_field_common
*field
)
297 BUF_APPEND(", %sis-set=%d", PRFIELD(field
->payload_set
));
300 BUF_APPEND(", %sis-frozen=%d", PRFIELD(field
->frozen
));
303 BUF_APPEND(", %stype-addr=%p", PRFIELD(field
->type
));
309 BUF_APPEND(", %stype-id=%s",
310 PRFIELD(bt_common_field_type_id_string(field
->type
->id
)));
312 if (!extended
|| field
->type
->id
== BT_FIELD_TYPE_ID_UNKNOWN
||
313 !field
->payload_set
) {
317 switch (field
->type
->id
) {
318 case BT_FIELD_TYPE_ID_INTEGER
:
320 format_field_common_integer_extended(buf_ch
, prefix
, field
);
323 case BT_FIELD_TYPE_ID_FLOAT
:
325 struct bt_field_common_floating_point
*flt
=
326 BT_FROM_COMMON(field
);
328 BUF_APPEND(", %svalue=%f", PRFIELD(flt
->payload
));
331 case BT_FIELD_TYPE_ID_STRING
:
333 struct bt_field_common_string
*str
=
334 BT_FROM_COMMON(field
);
337 BT_ASSERT(str
->buf
->data
);
338 BUF_APPEND(", %spartial-value=\"%.32s\"",
339 PRFIELD(str
->buf
->data
));
344 case BT_FIELD_TYPE_ID_SEQUENCE
:
346 struct bt_field_common_sequence
*seq
=
347 BT_FROM_COMMON(field
);
349 BUF_APPEND(", %slength=%" PRIu64
, PRFIELD(seq
->length
));
352 BUF_APPEND(", %sallocated-length=%u",
353 PRFIELD(seq
->elements
->len
));
357 case BT_FIELD_TYPE_ID_VARIANT
:
359 struct bt_field_common_variant
*variant
=
360 BT_FROM_COMMON(field
);
362 BUF_APPEND(", %scur-field-addr=%p",
363 PRFIELD(variant
->current_field
));
371 static inline void format_field(char **buf_ch
, bool extended
,
372 const char *prefix
, struct bt_field
*field
)
374 struct bt_field_common
*common_field
= (void *) field
;
376 format_field_common(buf_ch
, extended
, prefix
, (void *) field
);
382 if (!common_field
->type
) {
386 switch (common_field
->type
->id
) {
387 case BT_FIELD_TYPE_ID_ENUM
:
389 struct bt_field_common_integer
*integer
= (void *) field
;
390 struct bt_field_type_common_enumeration
*enum_ft
=
391 BT_FROM_COMMON(common_field
->type
);
393 if (enum_ft
->container_ft
) {
394 if (enum_ft
->container_ft
->is_signed
) {
395 BUF_APPEND(", %svalue=%" PRId64
,
396 PRFIELD(integer
->payload
.signd
));
398 BUF_APPEND(", %svalue=%" PRIu64
,
399 PRFIELD(integer
->payload
.unsignd
));
409 static inline void format_writer_field(char **buf_ch
, bool extended
,
410 const char *prefix
, struct bt_ctf_field
*field
)
412 struct bt_field_common
*common_field
= (void *) field
;
414 format_field_common(buf_ch
, extended
, prefix
, (void *) field
);
420 if (!common_field
->type
) {
424 switch (common_field
->type
->id
) {
425 case BT_FIELD_TYPE_ID_ENUM
:
427 struct bt_ctf_field_enumeration
*enumeration
= (void *) field
;
429 if (enumeration
->container
) {
430 format_writer_field(buf_ch
, extended
, prefix
,
431 (void *) enumeration
->container
);
435 case BT_FIELD_TYPE_ID_VARIANT
:
437 struct bt_ctf_field_variant
*variant
= (void *) field
;
439 BUF_APPEND(", %stag-field-addr=%p", PRFIELD(variant
->tag
));
447 static inline void format_field_path(char **buf_ch
, bool extended
,
448 const char *prefix
, struct bt_field_path
*field_path
)
452 if (field_path
->indexes
) {
453 BT_ASSERT(field_path
->indexes
);
454 BUF_APPEND(", %sindex-count=%u", PRFIELD(field_path
->indexes
->len
));
457 if (!extended
|| !field_path
->indexes
) {
461 BUF_APPEND(", %spath=[%s", PRFIELD(bt_common_scope_string(field_path
->root
)));
463 for (i
= 0; i
< field_path
->indexes
->len
; i
++) {
464 int index
= g_array_index(field_path
->indexes
, int, i
);
466 BUF_APPEND(", %d", index
);
469 BUF_APPEND("%s", "]");
472 static inline void format_trace_common(char **buf_ch
, bool extended
,
473 const char *prefix
, struct bt_trace_common
*trace
)
476 BUF_APPEND(", %sname=\"%s\"", PRFIELD(trace
->name
->str
));
483 BUF_APPEND(", %sis-frozen=%d", PRFIELD(trace
->frozen
));
485 if (trace
->uuid_set
) {
486 BUF_APPEND_UUID(trace
->uuid
);
489 if (trace
->clock_classes
) {
490 BUF_APPEND(", %sclock-class-count=%u",
491 PRFIELD(trace
->clock_classes
->len
));
494 if (trace
->stream_classes
) {
495 BUF_APPEND(", %sstream-class-count=%u",
496 PRFIELD(trace
->stream_classes
->len
));
499 if (trace
->streams
) {
500 BUF_APPEND(", %sstream-count=%u",
501 PRFIELD(trace
->streams
->len
));
504 BUF_APPEND(", %spacket-header-ft-addr=%p",
505 PRFIELD(trace
->packet_header_field_type
));
508 static inline void format_trace(char **buf_ch
, bool extended
,
509 const char *prefix
, struct bt_trace
*trace
)
513 format_trace_common(buf_ch
, extended
, prefix
, BT_TO_COMMON(trace
));
519 BUF_APPEND(", %sis-static=%d", PRFIELD(trace
->is_static
));
520 SET_TMP_PREFIX("phf-pool-");
521 format_object_pool(buf_ch
, extended
, prefix
,
522 &trace
->packet_header_field_pool
);
525 static inline void format_writer_trace(char **buf_ch
, bool extended
,
526 const char *prefix
, struct bt_ctf_trace
*trace
)
528 format_trace_common(buf_ch
, extended
, prefix
, BT_TO_COMMON(trace
));
531 static inline void format_stream_class_common(char **buf_ch
, bool extended
,
532 const char *prefix
, struct bt_stream_class_common
*stream_class
,
533 format_func trace_format_func
)
535 struct bt_trace_common
*trace
;
538 if (stream_class
->id_set
) {
539 BUF_APPEND(", %sid=%" PRId64
, PRFIELD(stream_class
->id
));
542 if (stream_class
->name
) {
543 BUF_APPEND(", %sname=\"%s\"", PRFIELD(stream_class
->name
->str
));
550 BUF_APPEND(", %sis-frozen=%d", PRFIELD(stream_class
->frozen
));
552 if (stream_class
->event_classes
) {
553 BUF_APPEND(", %sevent-class-count=%u",
554 PRFIELD(stream_class
->event_classes
->len
));
557 BUF_APPEND(", %spacket-context-ft-addr=%p, "
558 "%sevent-header-ft-addr=%p, %sevent-context-ft-addr=%p",
559 PRFIELD(stream_class
->packet_context_field_type
),
560 PRFIELD(stream_class
->event_header_field_type
),
561 PRFIELD(stream_class
->event_context_field_type
));
562 trace
= bt_stream_class_common_borrow_trace(stream_class
);
567 BUF_APPEND(", %strace-addr=%p", PRFIELD(trace
));
568 SET_TMP_PREFIX("trace-");
569 trace_format_func(buf_ch
, false, tmp_prefix
, trace
);
572 static inline void format_stream_class(char **buf_ch
, bool extended
,
573 const char *prefix
, struct bt_stream_class
*stream_class
)
577 format_stream_class_common(buf_ch
, extended
, prefix
,
578 BT_TO_COMMON(stream_class
), (format_func
) format_trace
);
584 SET_TMP_PREFIX("ehf-pool-");
585 format_object_pool(buf_ch
, extended
, prefix
,
586 &stream_class
->event_header_field_pool
);
587 SET_TMP_PREFIX("pcf-pool-");
588 format_object_pool(buf_ch
, extended
, prefix
,
589 &stream_class
->packet_context_field_pool
);
592 static inline void format_writer_stream_class(char **buf_ch
, bool extended
,
593 const char *prefix
, struct bt_ctf_stream_class
*stream_class
)
595 format_stream_class_common(buf_ch
, extended
, prefix
,
596 BT_TO_COMMON(stream_class
), (format_func
) format_writer_trace
);
598 if (extended
&& stream_class
->clock
) {
599 BUF_APPEND(", %sctf-writer-clock-addr=%p, "
600 "%sctf-writer-clock-name=\"%s\"",
601 PRFIELD(stream_class
->clock
),
602 PRFIELD(bt_clock_class_get_name(
603 BT_TO_COMMON(stream_class
->clock
->clock_class
))));
607 static inline void format_event_class_common(char **buf_ch
, bool extended
,
608 const char *prefix
, struct bt_event_class_common
*event_class
,
609 format_func format_stream_class_func
,
610 format_func format_trace_func
)
612 struct bt_stream_class_common
*stream_class
;
613 struct bt_trace_common
*trace
;
616 BUF_APPEND(", %sid=%" PRId64
, PRFIELD(event_class
->id
));
618 if (event_class
->name
) {
619 BUF_APPEND(", %sname=\"%s\"", PRFIELD(event_class
->name
->str
));
626 BUF_APPEND(", %sis-frozen=%d, %slog-level=%s",
627 PRFIELD(event_class
->frozen
),
628 PRFIELD(bt_common_event_class_log_level_string(event_class
->log_level
)));
630 if (event_class
->emf_uri
) {
631 BUF_APPEND(", %semf-uri=\"%s\"",
632 PRFIELD(event_class
->emf_uri
->str
));
635 BUF_APPEND(", %scontext-ft-addr=%p, %spayload-ft-addr=%p",
636 PRFIELD(event_class
->context_field_type
),
637 PRFIELD(event_class
->payload_field_type
));
639 stream_class
= bt_event_class_common_borrow_stream_class(event_class
);
644 BUF_APPEND(", %sstream-class-addr=%p", PRFIELD(stream_class
));
645 SET_TMP_PREFIX("stream-class-");
646 format_stream_class_func(buf_ch
, false, tmp_prefix
, stream_class
);
647 trace
= bt_stream_class_common_borrow_trace(stream_class
);
652 BUF_APPEND(", %strace-addr=%p", PRFIELD(trace
));
653 SET_TMP_PREFIX("trace-");
654 format_trace_func(buf_ch
, false, tmp_prefix
, trace
);
657 static inline void format_event_class(char **buf_ch
, bool extended
,
658 const char *prefix
, struct bt_event_class
*event_class
)
662 format_event_class_common(buf_ch
, extended
, prefix
,
663 BT_TO_COMMON(event_class
), (format_func
) format_stream_class
,
664 (format_func
) format_trace
);
670 SET_TMP_PREFIX("event-pool-");
671 format_object_pool(buf_ch
, extended
, prefix
, &event_class
->event_pool
);
674 static inline void format_writer_event_class(char **buf_ch
, bool extended
,
675 const char *prefix
, struct bt_ctf_event_class
*event_class
)
677 format_event_class_common(buf_ch
, extended
, prefix
,
678 BT_TO_COMMON(event_class
),
679 (format_func
) format_writer_stream_class
,
680 (format_func
) format_writer_trace
);
683 static inline void format_stream_common(char **buf_ch
, bool extended
,
684 const char *prefix
, struct bt_stream_common
*stream
,
685 format_func format_stream_class_func
,
686 format_func format_trace_func
)
688 struct bt_stream_class_common
*stream_class
;
689 struct bt_trace_common
*trace
;
692 BUF_APPEND(", %sid=%" PRId64
, PRFIELD(stream
->id
));
695 BUF_APPEND(", %sname=\"%s\"", PRFIELD(stream
->name
->str
));
702 stream_class
= bt_stream_common_borrow_class(stream
);
707 BUF_APPEND(", %sstream-class-addr=%p", PRFIELD(stream_class
));
708 SET_TMP_PREFIX("stream-class-");
709 format_stream_class_func(buf_ch
, false, tmp_prefix
, stream_class
);
710 trace
= bt_stream_class_common_borrow_trace(stream_class
);
715 trace
= (void *) bt_object_borrow_parent(&stream
->base
);
720 BUF_APPEND(", %strace-addr=%p", PRFIELD(trace
));
721 SET_TMP_PREFIX("trace-");
722 format_trace_common(buf_ch
, false, tmp_prefix
, trace
);
725 static inline void format_stream(char **buf_ch
, bool extended
,
726 const char *prefix
, struct bt_stream
*stream
)
730 format_stream_common(buf_ch
, extended
, prefix
, BT_TO_COMMON(stream
),
731 (format_func
) format_stream_class
,
732 (format_func
) format_trace
);
733 SET_TMP_PREFIX("packet-pool-");
734 format_object_pool(buf_ch
, extended
, prefix
, &stream
->packet_pool
);
737 static inline void format_writer_stream(char **buf_ch
, bool extended
,
738 const char *prefix
, struct bt_ctf_stream
*stream
)
740 format_stream_common(buf_ch
, extended
, prefix
, BT_TO_COMMON(stream
),
741 (format_func
) format_writer_stream_class
,
742 (format_func
) format_writer_trace
);
744 BUF_APPEND(", %sheader-field-addr=%p, %scontext-field-addr=%p"
745 ", %sfd=%d, %smmap-offset=%zu, "
746 "%smmap-base-offset=%zu, %spacket-size=%" PRIu64
", "
747 "%soffset=%" PRId64
", %sevent-count=%u, "
748 "%sflushed-packet-count=%u, "
749 "%sdiscarded-event-count=%" PRIu64
", "
750 "%ssize=%" PRIu64
", %slast-ts-end=%" PRIu64
,
751 PRFIELD(stream
->packet_header
),
752 PRFIELD(stream
->packet_context
),
753 PRFIELD(stream
->pos
.fd
),
754 PRFIELD((size_t) stream
->pos
.mmap_offset
),
755 PRFIELD((size_t) stream
->pos
.mmap_base_offset
),
756 PRFIELD(stream
->pos
.packet_size
),
757 PRFIELD(stream
->pos
.offset
),
758 PRFIELD(stream
->events
->len
),
759 PRFIELD(stream
->flushed_packet_count
),
760 PRFIELD(stream
->discarded_events
),
761 PRFIELD(stream
->size
), PRFIELD(stream
->last_ts_end
));
763 if (stream
->events
) {
764 BUF_APPEND(", %sevent-count=%u", PRFIELD(stream
->events
->len
));
767 BUF_APPEND(", %sheader-field-addr=%p, %scontext-field-addr=%p"
768 ", %sfd=%d, %smmap-offset=%zu, "
769 "%smmap-base-offset=%zu, %spacket-size=%" PRIu64
", "
770 "%soffset=%" PRId64
", "
771 "%sflushed-packet-count=%u, "
772 "%sdiscarded-event-count=%" PRIu64
", "
773 "%ssize=%" PRIu64
", %slast-ts-end=%" PRIu64
,
774 PRFIELD(stream
->packet_header
),
775 PRFIELD(stream
->packet_context
),
776 PRFIELD(stream
->pos
.fd
),
777 PRFIELD((size_t) stream
->pos
.mmap_offset
),
778 PRFIELD((size_t) stream
->pos
.mmap_base_offset
),
779 PRFIELD(stream
->pos
.packet_size
),
780 PRFIELD(stream
->pos
.offset
),
781 PRFIELD(stream
->flushed_packet_count
),
782 PRFIELD(stream
->discarded_events
),
783 PRFIELD(stream
->size
), PRFIELD(stream
->last_ts_end
));
786 static inline void format_packet(char **buf_ch
, bool extended
,
787 const char *prefix
, struct bt_packet
*packet
)
789 struct bt_stream
*stream
;
790 struct bt_trace
*trace
;
797 BUF_APPEND(", %sis-frozen=%d, %sheader-field-addr=%p, "
798 "%scontext-field-addr=%p",
799 PRFIELD(packet
->frozen
),
800 PRFIELD(packet
->header
? packet
->header
->field
: NULL
),
801 PRFIELD(packet
->context
));
802 stream
= bt_packet_borrow_stream(packet
);
807 BUF_APPEND(", %sstream-addr=%p", PRFIELD(stream
));
808 SET_TMP_PREFIX("stream-");
809 format_stream(buf_ch
, false, tmp_prefix
, stream
);
810 trace
= (struct bt_trace
*) bt_object_borrow_parent(&stream
->common
.base
);
815 BUF_APPEND(", %strace-addr=%p", PRFIELD(trace
));
816 SET_TMP_PREFIX("trace-");
817 format_trace(buf_ch
, false, tmp_prefix
, trace
);
820 static inline void format_event_common(char **buf_ch
, bool extended
,
821 const char *prefix
, struct bt_event_common
*event
,
822 format_func format_event_class_func
,
823 format_func format_stream_class_func
,
824 format_func format_trace_func
)
826 struct bt_trace_common
*trace
;
827 struct bt_stream_class_common
*stream_class
;
834 BUF_APPEND(", %sis-frozen=%d, %sheader-field-addr=%p, "
835 "%sstream-context-field-addr=%p, "
836 "%scontext-field-addr=%p, %spayload-field-addr=%p, ",
837 PRFIELD(event
->frozen
),
838 PRFIELD(event
->header_field
? event
->header_field
->field
: NULL
),
839 PRFIELD(event
->stream_event_context_field
),
840 PRFIELD(event
->context_field
),
841 PRFIELD(event
->payload_field
));
842 BUF_APPEND(", %sevent-class-addr=%p", PRFIELD(event
->class));
848 SET_TMP_PREFIX("event-class-");
849 format_event_class_func(buf_ch
, false, tmp_prefix
, event
->class);
850 stream_class
= bt_event_class_common_borrow_stream_class(event
->class);
852 BUF_APPEND(", %sstream-class-addr=%p", PRFIELD(stream_class
));
853 SET_TMP_PREFIX("stream-class-");
854 format_stream_class_func(buf_ch
, false, tmp_prefix
,
857 trace
= bt_stream_class_common_borrow_trace(stream_class
);
859 BUF_APPEND(", %strace-addr=%p", PRFIELD(trace
));
860 SET_TMP_PREFIX("trace-");
861 format_trace_func(buf_ch
, false, tmp_prefix
, trace
);
866 static inline void format_event(char **buf_ch
, bool extended
,
867 const char *prefix
, struct bt_event
*event
)
869 struct bt_packet
*packet
;
870 struct bt_stream
*stream
;
873 format_event_common(buf_ch
, extended
, prefix
, BT_TO_COMMON(event
),
874 (format_func
) format_event_class
,
875 (format_func
) format_stream_class
, (format_func
) format_trace
);
881 if (event
->clock_values
) {
882 BUF_APPEND(", %sclock-value-count=%u",
883 PRFIELD(g_hash_table_size(event
->clock_values
)));
886 packet
= bt_event_borrow_packet(event
);
891 BUF_APPEND(", %spacket-addr=%p", PRFIELD(packet
));
892 SET_TMP_PREFIX("packet-");
893 format_packet(buf_ch
, false, tmp_prefix
, packet
);
894 stream
= bt_packet_borrow_stream(packet
);
899 BUF_APPEND(", %sstream-addr=%p", PRFIELD(stream
));
900 SET_TMP_PREFIX("stream-");
901 format_stream(buf_ch
, false, tmp_prefix
, stream
);
904 static inline void format_writer_event(char **buf_ch
, bool extended
,
905 const char *prefix
, struct bt_event
*event
)
907 format_event_common(buf_ch
, extended
, prefix
, BT_TO_COMMON(event
),
908 (format_func
) format_writer_event_class
,
909 (format_func
) format_writer_stream_class
,
910 (format_func
) format_writer_trace
);
913 static inline void format_clock_class(char **buf_ch
, bool extended
,
914 const char *prefix
, struct bt_clock_class
*clock_class
)
918 BUF_APPEND(", %sname=\"%s\", %sfreq=%" PRIu64
,
919 PRFIELD(clock_class
->name
->str
),
920 PRFIELD(clock_class
->frequency
));
926 if (clock_class
->description
) {
927 BUF_APPEND(", %spartial-description=\"%.32s\"",
928 PRFIELD(clock_class
->description
->str
));
931 BUF_APPEND(", %sis-frozen=%d, %sprecision=%" PRIu64
", "
932 "%soffset-s=%" PRId64
", "
933 "%soffset-cycles=%" PRId64
", %sis-absolute=%d",
934 PRFIELD(clock_class
->frozen
), PRFIELD(clock_class
->precision
),
935 PRFIELD(clock_class
->offset_s
), PRFIELD(clock_class
->offset
),
936 PRFIELD(clock_class
->absolute
));
938 if (clock_class
->uuid_set
) {
939 BUF_APPEND_UUID(clock_class
->uuid
);
942 SET_TMP_PREFIX("cv-pool-");
943 format_object_pool(buf_ch
, extended
, prefix
, &clock_class
->cv_pool
);
946 static inline void format_clock_value(char **buf_ch
, bool extended
,
947 const char *prefix
, struct bt_clock_value
*clock_value
)
950 BUF_APPEND(", %svalue=%" PRIu64
", %sns-from-epoch=%" PRId64
,
951 PRFIELD(clock_value
->value
),
952 PRFIELD(clock_value
->ns_from_epoch
));
958 BUF_APPEND(", %sis-frozen=%d, %sis-set=%d",
959 PRFIELD(clock_value
->frozen
), PRFIELD(clock_value
->is_set
));
960 BUF_APPEND(", %sclock-class-addr=%p",
961 PRFIELD(clock_value
->clock_class
));
962 SET_TMP_PREFIX("clock-class-");
963 format_clock_class(buf_ch
, false, tmp_prefix
, clock_value
->clock_class
);
966 static inline void format_value(char **buf_ch
, bool extended
,
967 const char *prefix
, struct bt_value
*value
)
969 BUF_APPEND(", %stype=%s",
970 PRFIELD(bt_value_type_string(bt_value_get_type(value
))));
976 switch (bt_value_get_type(value
)) {
977 case BT_VALUE_TYPE_BOOL
:
981 (void) bt_value_bool_get(value
, &val
);
982 BUF_APPEND(", %svalue=%d", PRFIELD(val
));
985 case BT_VALUE_TYPE_INTEGER
:
989 (void) bt_value_integer_get(value
, &val
);
990 BUF_APPEND(", %svalue=%" PRId64
, PRFIELD(val
));
993 case BT_VALUE_TYPE_FLOAT
:
997 (void) bt_value_float_get(value
, &val
);
998 BUF_APPEND(", %svalue=%f", PRFIELD(val
));
1001 case BT_VALUE_TYPE_STRING
:
1005 (void) bt_value_string_get(value
, &val
);
1006 BUF_APPEND(", %spartial-value=\"%.32s\"", PRFIELD(val
));
1009 case BT_VALUE_TYPE_ARRAY
:
1011 int64_t count
= bt_value_array_size(value
);
1013 BT_ASSERT(count
>= 0);
1014 BUF_APPEND(", %selement-count=%" PRId64
, PRFIELD(count
));
1017 case BT_VALUE_TYPE_MAP
:
1019 int64_t count
= bt_value_map_size(value
);
1021 BT_ASSERT(count
>= 0);
1022 BUF_APPEND(", %selement-count=%" PRId64
, PRFIELD(count
));
1030 static inline void format_notification(char **buf_ch
, bool extended
,
1031 const char *prefix
, struct bt_notification
*notif
)
1033 char tmp_prefix
[64];
1035 BUF_APPEND(", %stype=%s",
1036 PRFIELD(bt_notification_type_string(notif
->type
)));
1042 BUF_APPEND(", %sis-frozen=%d, %sgraph-addr=%p",
1043 PRFIELD(notif
->frozen
), PRFIELD(notif
->graph
));
1045 switch (notif
->type
) {
1046 case BT_NOTIFICATION_TYPE_EVENT
:
1048 struct bt_notification_event
*notif_event
= (void *) notif
;
1050 SET_TMP_PREFIX("event-");
1051 format_event(buf_ch
, true, tmp_prefix
, notif_event
->event
);
1053 if (!notif_event
->cc_prio_map
) {
1057 BUF_APPEND(", %scc-prio-map-addr=%p, %scc-prio-map-cc-count=%u",
1058 PRFIELD(notif_event
->cc_prio_map
),
1059 PRFIELD(notif_event
->cc_prio_map
->entries
->len
));
1062 case BT_NOTIFICATION_TYPE_INACTIVITY
:
1064 struct bt_notification_inactivity
*notif_inactivity
=
1067 if (!notif_inactivity
->cc_prio_map
) {
1071 BUF_APPEND(", %scc-prio-map-addr=%p, %scc-prio-map-cc-count=%u",
1072 PRFIELD(notif_inactivity
->cc_prio_map
),
1073 PRFIELD(notif_inactivity
->cc_prio_map
->entries
->len
));
1076 case BT_NOTIFICATION_TYPE_STREAM_BEGIN
:
1078 struct bt_notification_stream_begin
*notif_stream
=
1081 SET_TMP_PREFIX("stream-");
1082 format_stream(buf_ch
, true, tmp_prefix
, notif_stream
->stream
);
1085 case BT_NOTIFICATION_TYPE_STREAM_END
:
1087 struct bt_notification_stream_end
*notif_stream
=
1090 SET_TMP_PREFIX("stream-");
1091 format_stream(buf_ch
, true, tmp_prefix
, notif_stream
->stream
);
1094 case BT_NOTIFICATION_TYPE_PACKET_BEGIN
:
1096 struct bt_notification_packet_begin
*notif_packet
=
1099 SET_TMP_PREFIX("packet-");
1100 format_packet(buf_ch
, true, tmp_prefix
, notif_packet
->packet
);
1103 case BT_NOTIFICATION_TYPE_PACKET_END
:
1105 struct bt_notification_packet_end
*notif_packet
=
1108 SET_TMP_PREFIX("packet-");
1109 format_packet(buf_ch
, true, tmp_prefix
, notif_packet
->packet
);
1112 case BT_NOTIFICATION_TYPE_DISCARDED_EVENTS
:
1113 case BT_NOTIFICATION_TYPE_DISCARDED_PACKETS
:
1115 struct bt_notification_discarded_elements
*notif_discarded
=
1118 BUF_APPEND(", %scount=%" PRId64
,
1119 PRFIELD(notif_discarded
->count
));
1121 if (notif_discarded
->begin_clock_value
) {
1122 SET_TMP_PREFIX("begin-clock-value-");
1123 format_clock_value(buf_ch
, true, tmp_prefix
,
1124 notif_discarded
->begin_clock_value
);
1127 if (notif_discarded
->end_clock_value
) {
1128 SET_TMP_PREFIX("end-clock-value-");
1129 format_clock_value(buf_ch
, true, tmp_prefix
,
1130 notif_discarded
->end_clock_value
);
1139 static inline void format_plugin_so_shared_lib_handle(char **buf_ch
,
1141 struct bt_plugin_so_shared_lib_handle
*handle
)
1143 BUF_APPEND(", %saddr=%p", PRFIELD(handle
));
1146 BUF_APPEND(", %spath=\"%s\"", PRFIELD(handle
->path
->str
));
1150 static inline void format_component_class(char **buf_ch
, bool extended
,
1151 const char *prefix
, struct bt_component_class
*comp_class
)
1153 char tmp_prefix
[64];
1155 BUF_APPEND(", %stype=%s, %sname=\"%s\"",
1156 PRFIELD(bt_component_class_type_string(comp_class
->type
)),
1157 PRFIELD(comp_class
->name
? comp_class
->name
->str
: NULL
));
1159 if (comp_class
->description
) {
1160 BUF_APPEND(", %spartial-descr=\"%.32s\"",
1161 PRFIELD(comp_class
->description
->str
));
1168 BUF_APPEND(", %sis-frozen=%d", PRFIELD(comp_class
->frozen
));
1170 if (comp_class
->so_handle
) {
1171 SET_TMP_PREFIX("so-handle-");
1172 format_plugin_so_shared_lib_handle(buf_ch
, tmp_prefix
,
1173 comp_class
->so_handle
);
1177 static inline void format_component(char **buf_ch
, bool extended
,
1178 const char *prefix
, struct bt_component
*component
)
1180 char tmp_prefix
[64];
1182 BUF_APPEND(", %sname=\"%s\"", PRFIELD(component
->name
->str
));
1183 SET_TMP_PREFIX("class-");
1184 format_component_class(buf_ch
, extended
, tmp_prefix
, component
->class);
1190 if (component
->input_ports
) {
1191 BUF_APPEND(", %sinput-port-count=%u",
1192 PRFIELD(component
->input_ports
->len
));
1195 if (component
->output_ports
) {
1196 BUF_APPEND(", %soutput-port-count=%u",
1197 PRFIELD(component
->output_ports
->len
));
1201 static inline void format_port(char **buf_ch
, bool extended
,
1202 const char *prefix
, struct bt_port
*port
)
1204 char tmp_prefix
[64];
1206 BUF_APPEND(", %stype=%s, %sname=\"%s\"",
1207 PRFIELD(bt_port_type_string(port
->type
)),
1208 PRFIELD(port
->name
->str
));
1214 if (port
->connection
) {
1215 SET_TMP_PREFIX("conn-");
1216 format_connection(buf_ch
, false, tmp_prefix
, port
->connection
);
1220 static inline void format_connection(char **buf_ch
, bool extended
,
1221 const char *prefix
, struct bt_connection
*connection
)
1223 char tmp_prefix
[64];
1229 if (connection
->upstream_port
) {
1230 SET_TMP_PREFIX("upstream-port-");
1231 format_port(buf_ch
, false, tmp_prefix
,
1232 connection
->upstream_port
);
1235 if (connection
->downstream_port
) {
1236 SET_TMP_PREFIX("downstream-port-");
1237 format_port(buf_ch
, false, tmp_prefix
,
1238 connection
->downstream_port
);
1242 static inline void format_graph(char **buf_ch
, bool extended
,
1243 const char *prefix
, struct bt_graph
*graph
)
1245 char tmp_prefix
[64];
1247 BUF_APPEND(", %sis-canceled=%d", PRFIELD(graph
->canceled
));
1253 if (graph
->components
) {
1254 BUF_APPEND(", %scomp-count=%u",
1255 PRFIELD(graph
->components
->len
));
1258 if (graph
->connections
) {
1259 BUF_APPEND(", %sconn-count=%u",
1260 PRFIELD(graph
->connections
->len
));
1263 SET_TMP_PREFIX("en-pool-");
1264 format_object_pool(buf_ch
, extended
, prefix
,
1265 &graph
->event_notif_pool
);
1266 SET_TMP_PREFIX("pbn-pool-");
1267 format_object_pool(buf_ch
, extended
, prefix
,
1268 &graph
->packet_begin_notif_pool
);
1269 SET_TMP_PREFIX("pen-pool-");
1270 format_object_pool(buf_ch
, extended
, prefix
,
1271 &graph
->packet_end_notif_pool
);
1274 static inline void format_notification_iterator(char **buf_ch
,
1275 bool extended
, const char *prefix
,
1276 struct bt_notification_iterator
*iterator
)
1279 char tmp_prefix
[64];
1281 if (iterator
->type
== BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION
) {
1282 type
= "BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION";
1283 } else if (iterator
->type
== BT_NOTIFICATION_ITERATOR_TYPE_OUTPUT_PORT
) {
1284 type
= "BT_NOTIFICATION_ITERATOR_TYPE_OUTPUT_PORT";
1289 BUF_APPEND(", %stype=%s", PRFIELD(type
));
1291 switch (iterator
->type
) {
1292 case BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION
:
1294 struct bt_notification_iterator_private_connection
*
1295 iter_priv_conn
= (void *) iterator
;
1297 if (iter_priv_conn
->upstream_component
) {
1298 SET_TMP_PREFIX("upstream-comp-");
1299 format_component(buf_ch
, false, tmp_prefix
,
1300 iter_priv_conn
->upstream_component
);
1303 if (iter_priv_conn
->upstream_port
) {
1304 SET_TMP_PREFIX("upstream-port-");
1305 format_port(buf_ch
, false, tmp_prefix
,
1306 iter_priv_conn
->upstream_port
);
1309 if (iter_priv_conn
->connection
) {
1310 SET_TMP_PREFIX("upstream-conn-");
1311 format_connection(buf_ch
, false, tmp_prefix
,
1312 iter_priv_conn
->connection
);
1316 case BT_NOTIFICATION_ITERATOR_TYPE_OUTPUT_PORT
:
1318 struct bt_notification_iterator_output_port
*iter_output_port
=
1321 SET_TMP_PREFIX("graph-");
1322 format_graph(buf_ch
, false, tmp_prefix
,
1323 iter_output_port
->graph
);
1324 SET_TMP_PREFIX("colander-comp-");
1325 format_component(buf_ch
, false, tmp_prefix
,
1326 iter_output_port
->colander
);
1334 static inline void format_plugin(char **buf_ch
, bool extended
,
1335 const char *prefix
, struct bt_plugin
*plugin
)
1337 char tmp_prefix
[64];
1339 BUF_APPEND(", %stype=%s", PRFIELD(bt_plugin_type_string(plugin
->type
)));
1341 if (plugin
->info
.path_set
) {
1342 BUF_APPEND(", %spath=\"%s\"",
1343 PRFIELD(plugin
->info
.path
->str
));
1346 if (plugin
->info
.name_set
) {
1347 BUF_APPEND(", %sname=\"%s\"",
1348 PRFIELD(plugin
->info
.name
->str
));
1355 if (plugin
->info
.author_set
) {
1356 BUF_APPEND(", %sauthor=\"%s\"",
1357 PRFIELD(plugin
->info
.author
->str
));
1360 if (plugin
->info
.license_set
) {
1361 BUF_APPEND(", %slicense=\"%s\"",
1362 PRFIELD(plugin
->info
.license
->str
));
1365 if (plugin
->info
.version_set
) {
1366 BUF_APPEND(", %sversion=%u.%u.%u%s",
1367 PRFIELD(plugin
->info
.version
.major
),
1368 plugin
->info
.version
.minor
,
1369 plugin
->info
.version
.patch
,
1370 plugin
->info
.version
.extra
?
1371 plugin
->info
.version
.extra
->str
: "");
1374 BUF_APPEND(", %sis-frozen=%d, %scomp-class-count=%u",
1375 PRFIELD(plugin
->frozen
),
1376 PRFIELD(plugin
->comp_classes
->len
));
1378 if (plugin
->spec_data
) {
1379 struct bt_plugin_so_spec_data
*spec_data
=
1380 (void *) plugin
->spec_data
;
1382 if (spec_data
->shared_lib_handle
) {
1383 SET_TMP_PREFIX("so-handle-");
1384 format_plugin_so_shared_lib_handle(buf_ch
, tmp_prefix
,
1385 spec_data
->shared_lib_handle
);
1390 static inline void format_ctf_writer(char **buf_ch
, bool extended
,
1391 const char *prefix
, struct bt_ctf_writer
*writer
)
1396 static inline void format_stream_class_common_common(char **buf_ch
,
1397 bool extended
, const char *prefix
,
1398 struct bt_stream_class_common
*stream_class
)
1400 format_stream_class_common(buf_ch
, extended
, prefix
, stream_class
,
1401 (format_func
) format_trace_common
);
1404 static inline void format_event_class_common_common(char **buf_ch
,
1405 bool extended
, const char *prefix
,
1406 struct bt_event_class_common
*event_class
)
1408 format_event_class_common(buf_ch
, extended
, prefix
, event_class
,
1409 (format_func
) format_stream_class_common
,
1410 (format_func
) format_trace_common
);
1413 static inline void format_event_common_common(char **buf_ch
,
1414 bool extended
, const char *prefix
,
1415 struct bt_event_common
*event
)
1417 format_event_common(buf_ch
, extended
, prefix
, event
,
1418 (format_func
) format_event_class_common
,
1419 (format_func
) format_stream_class_common
,
1420 (format_func
) format_trace_common
);
1423 static inline void format_stream_common_common(char **buf_ch
, bool extended
,
1424 const char *prefix
, struct bt_stream_common
*stream
)
1426 format_stream_common(buf_ch
, extended
, prefix
, stream
,
1427 (format_func
) format_stream_class_common
,
1428 (format_func
) format_trace_common
);
1431 static inline void handle_conversion_specifier_bt(void *priv_data
,
1432 char **buf_ch
, size_t avail_size
,
1433 const char **out_fmt_ch
, va_list *args
)
1435 const char *fmt_ch
= *out_fmt_ch
;
1436 bool extended
= false;
1438 char *prefix_ch
= prefix
;
1444 } cat
= CAT_DEFAULT
;
1449 if (*fmt_ch
== '[') {
1454 if (*fmt_ch
== ']') {
1460 *prefix_ch
= *fmt_ch
;
1468 if (*fmt_ch
== '+') {
1473 if (*fmt_ch
== 'w') {
1476 } else if (*fmt_ch
== '_') {
1481 obj
= va_arg(*args
, void *);
1482 BUF_APPEND("%saddr=%p", prefix
, obj
);
1492 format_field_type(buf_ch
, extended
, prefix
, obj
);
1495 format_field(buf_ch
, extended
, prefix
, obj
);
1498 format_field_path(buf_ch
, extended
, prefix
, obj
);
1501 format_event_class(buf_ch
, extended
, prefix
, obj
);
1504 format_event(buf_ch
, extended
, prefix
, obj
);
1507 format_stream_class(buf_ch
, extended
, prefix
, obj
);
1510 format_stream(buf_ch
, extended
, prefix
, obj
);
1513 format_packet(buf_ch
, extended
, prefix
, obj
);
1516 format_trace(buf_ch
, extended
, prefix
, obj
);
1519 format_clock_class(buf_ch
, extended
, prefix
, obj
);
1522 format_clock_value(buf_ch
, extended
, prefix
, obj
);
1525 format_value(buf_ch
, extended
, prefix
, obj
);
1528 format_notification(buf_ch
, extended
, prefix
, obj
);
1531 format_notification_iterator(buf_ch
, extended
, prefix
, obj
);
1534 format_component_class(buf_ch
, extended
, prefix
, obj
);
1537 format_component(buf_ch
, extended
, prefix
, obj
);
1540 format_port(buf_ch
, extended
, prefix
, obj
);
1543 format_connection(buf_ch
, extended
, prefix
, obj
);
1546 format_plugin(buf_ch
, extended
, prefix
, obj
);
1549 format_graph(buf_ch
, extended
, prefix
, obj
);
1552 format_object_pool(buf_ch
, extended
, prefix
, obj
);
1555 format_object(buf_ch
, extended
, prefix
, obj
);
1564 format_writer_field_type(buf_ch
, extended
, prefix
, obj
);
1567 format_writer_field(buf_ch
, extended
, prefix
, obj
);
1570 format_writer_event_class(buf_ch
, extended
, prefix
, obj
);
1573 format_writer_event(buf_ch
, extended
, prefix
, obj
);
1576 format_writer_stream_class(buf_ch
, extended
, prefix
, obj
);
1579 format_writer_stream(buf_ch
, extended
, prefix
, obj
);
1582 format_writer_trace(buf_ch
, extended
, prefix
, obj
);
1585 format_ctf_writer(buf_ch
, extended
, prefix
, obj
);
1594 format_field_type_common(buf_ch
, extended
, prefix
, obj
);
1597 format_field_common(buf_ch
, extended
, prefix
, obj
);
1600 format_event_class_common_common(buf_ch
, extended
, prefix
, obj
);
1603 format_event_common_common(buf_ch
, extended
, prefix
, obj
);
1606 format_stream_class_common_common(buf_ch
, extended
, prefix
, obj
);
1609 format_stream_common_common(buf_ch
, extended
, prefix
, obj
);
1612 format_trace_common(buf_ch
, extended
, prefix
, obj
);
1622 *out_fmt_ch
= fmt_ch
;
1626 void bt_lib_log(const char *func
, const char *file
, unsigned line
,
1627 int lvl
, const char *tag
, const char *fmt
, ...)
1632 va_start(args
, fmt
);
1633 bt_common_custom_vsnprintf(lib_logging_buf
, LIB_LOGGING_BUF_SIZE
, '!',
1634 handle_conversion_specifier_bt
, NULL
, fmt
, &args
);
1636 _bt_log_write_d(func
, file
, line
, lvl
, tag
, "%s", lib_logging_buf
);