4 * LTTng-UST metadata generation
6 * Copyright (C) 2010-2013 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License, version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include <common/common.h>
31 #include <common/time.h>
33 #include "ust-registry.h"
34 #include "ust-clock.h"
38 #define max_t(type, a, b) ((type) ((a) > (b) ? (a) : (b)))
41 #define NR_CLOCK_OFFSET_SAMPLES 10
43 struct offset_sample
{
44 int64_t offset
; /* correlation offset */
45 uint64_t measure_delta
; /* lower is better */
49 int _lttng_field_statedump(struct ust_registry_session
*session
,
50 const struct ustctl_field
*fields
, size_t nr_fields
,
51 size_t *iter_field
, size_t nesting
);
54 int fls(unsigned int x
)
60 if (!(x
& 0xFFFF0000U
)) {
64 if (!(x
& 0xFF000000U
)) {
68 if (!(x
& 0xF0000000U
)) {
72 if (!(x
& 0xC0000000U
)) {
76 if (!(x
& 0x80000000U
)) {
83 int get_count_order(unsigned int count
)
87 order
= fls(count
) - 1;
88 if (count
& (count
- 1)) {
96 * Returns offset where to write in metadata array, or negative error value on error.
99 ssize_t
metadata_reserve(struct ust_registry_session
*session
, size_t len
)
101 size_t new_len
= session
->metadata_len
+ len
;
102 size_t new_alloc_len
= new_len
;
103 size_t old_alloc_len
= session
->metadata_alloc_len
;
106 if (new_alloc_len
> (UINT32_MAX
>> 1))
108 if ((old_alloc_len
<< 1) > (UINT32_MAX
>> 1))
111 if (new_alloc_len
> old_alloc_len
) {
115 max_t(size_t, 1U << get_count_order(new_alloc_len
), old_alloc_len
<< 1);
116 newptr
= realloc(session
->metadata
, new_alloc_len
);
119 session
->metadata
= newptr
;
120 /* We zero directly the memory from start of allocation. */
121 memset(&session
->metadata
[old_alloc_len
], 0, new_alloc_len
- old_alloc_len
);
122 session
->metadata_alloc_len
= new_alloc_len
;
124 ret
= session
->metadata_len
;
125 session
->metadata_len
+= len
;
130 int metadata_file_append(struct ust_registry_session
*session
,
131 const char *str
, size_t len
)
135 if (session
->metadata_fd
< 0) {
138 /* Write to metadata file */
139 written
= lttng_write(session
->metadata_fd
, str
, len
);
140 if (written
!= len
) {
147 * We have exclusive access to our metadata buffer (protected by the
148 * ust_lock), so we can do racy operations such as looking for
149 * remaining space left in packet and write, since mutual exclusion
150 * protects us from concurrent writes.
153 int lttng_metadata_printf(struct ust_registry_session
*session
,
154 const char *fmt
, ...)
163 ret
= vasprintf(&str
, fmt
, ap
);
169 offset
= metadata_reserve(session
, len
);
174 memcpy(&session
->metadata
[offset
], str
, len
);
175 ret
= metadata_file_append(session
, str
, len
);
177 PERROR("Error appending to metadata file");
180 DBG3("Append to metadata: \"%s\"", str
);
189 int print_tabs(struct ust_registry_session
*session
, size_t nesting
)
193 for (i
= 0; i
< nesting
; i
++) {
196 ret
= lttng_metadata_printf(session
, " ");
205 void sanitize_ctf_identifier(char *out
, const char *in
)
209 for (i
= 0; i
< LTTNG_UST_SYM_NAME_LEN
; i
++) {
223 int print_escaped_ctf_string(struct ust_registry_session
*session
, const char *string
)
231 while (cur
!= '\0') {
234 ret
= lttng_metadata_printf(session
, "%s", "\\n");
238 ret
= lttng_metadata_printf(session
, "%c", '\\');
242 /* We still print the current char */
245 ret
= lttng_metadata_printf(session
, "%c", cur
);
259 /* Called with session registry mutex held. */
261 int ust_metadata_enum_statedump(struct ust_registry_session
*session
,
262 const char *enum_name
,
264 const struct ustctl_integer_type
*container_type
,
265 const char *field_name
, size_t *iter_field
, size_t nesting
)
267 struct ust_registry_enum
*reg_enum
;
268 const struct ustctl_enum_entry
*entries
;
272 char identifier
[LTTNG_UST_SYM_NAME_LEN
];
275 reg_enum
= ust_registry_lookup_enum_by_id(session
, enum_name
, enum_id
);
277 /* reg_enum can still be used because session registry mutex is held. */
282 entries
= reg_enum
->entries
;
283 nr_entries
= reg_enum
->nr_entries
;
285 ret
= print_tabs(session
, nesting
);
289 ret
= lttng_metadata_printf(session
,
290 "enum : integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u; } {\n",
291 container_type
->size
,
292 container_type
->alignment
,
293 container_type
->signedness
,
294 (container_type
->encoding
== ustctl_encode_none
)
296 : (container_type
->encoding
== ustctl_encode_UTF8
)
299 container_type
->base
);
304 /* Dump all entries */
305 for (i
= 0; i
< nr_entries
; i
++) {
306 const struct ustctl_enum_entry
*entry
= &entries
[i
];
309 ret
= print_tabs(session
, nesting
);
313 ret
= lttng_metadata_printf(session
,
318 len
= strlen(entry
->string
);
319 /* Escape the character '"' */
320 for (j
= 0; j
< len
; j
++) {
321 char c
= entry
->string
[j
];
325 ret
= lttng_metadata_printf(session
,
329 ret
= lttng_metadata_printf(session
,
333 ret
= lttng_metadata_printf(session
,
341 ret
= lttng_metadata_printf(session
, "\"");
346 if (entry
->u
.extra
.options
&
347 USTCTL_UST_ENUM_ENTRY_OPTION_IS_AUTO
) {
348 ret
= lttng_metadata_printf(session
, ",\n");
353 ret
= lttng_metadata_printf(session
,
359 if (entry
->start
.signedness
) {
360 ret
= lttng_metadata_printf(session
,
361 "%lld", (long long) entry
->start
.value
);
363 ret
= lttng_metadata_printf(session
,
364 "%llu", entry
->start
.value
);
370 if (entry
->start
.signedness
== entry
->end
.signedness
&&
371 entry
->start
.value
==
373 ret
= lttng_metadata_printf(session
, ",\n");
375 if (entry
->end
.signedness
) {
376 ret
= lttng_metadata_printf(session
,
378 (long long) entry
->end
.value
);
380 ret
= lttng_metadata_printf(session
,
391 sanitize_ctf_identifier(identifier
, field_name
);
392 ret
= print_tabs(session
, nesting
);
396 ret
= lttng_metadata_printf(session
, "} _%s;\n",
404 int _lttng_variant_statedump(struct ust_registry_session
*session
,
405 const struct ustctl_field
*fields
, size_t nr_fields
,
406 size_t *iter_field
, size_t nesting
)
408 const struct ustctl_field
*variant
= &fields
[*iter_field
];
409 uint32_t nr_choices
, i
;
411 char identifier
[LTTNG_UST_SYM_NAME_LEN
];
413 if (variant
->type
.atype
!= ustctl_atype_variant
) {
417 nr_choices
= variant
->type
.u
.variant
.nr_choices
;
419 sanitize_ctf_identifier(identifier
, variant
->type
.u
.variant
.tag_name
);
420 ret
= print_tabs(session
, nesting
);
424 ret
= lttng_metadata_printf(session
,
431 for (i
= 0; i
< nr_choices
; i
++) {
432 if (*iter_field
>= nr_fields
) {
436 ret
= _lttng_field_statedump(session
,
438 iter_field
, nesting
+ 1);
443 sanitize_ctf_identifier(identifier
, variant
->name
);
444 ret
= print_tabs(session
, nesting
);
448 ret
= lttng_metadata_printf(session
,
459 int _lttng_field_statedump(struct ust_registry_session
*session
,
460 const struct ustctl_field
*fields
, size_t nr_fields
,
461 size_t *iter_field
, size_t nesting
)
464 const char *bo_be
= " byte_order = be;";
465 const char *bo_le
= " byte_order = le;";
466 const char *bo_native
= "";
467 const char *bo_reverse
;
468 const struct ustctl_field
*field
;
470 if (*iter_field
>= nr_fields
) {
474 field
= &fields
[*iter_field
];
476 if (session
->byte_order
== BIG_ENDIAN
) {
482 switch (field
->type
.atype
) {
483 case ustctl_atype_integer
:
484 ret
= print_tabs(session
, nesting
);
488 ret
= lttng_metadata_printf(session
,
489 "integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } _%s;\n",
490 field
->type
.u
.basic
.integer
.size
,
491 field
->type
.u
.basic
.integer
.alignment
,
492 field
->type
.u
.basic
.integer
.signedness
,
493 (field
->type
.u
.basic
.integer
.encoding
== ustctl_encode_none
)
495 : (field
->type
.u
.basic
.integer
.encoding
== ustctl_encode_UTF8
)
498 field
->type
.u
.basic
.integer
.base
,
499 field
->type
.u
.basic
.integer
.reverse_byte_order
? bo_reverse
: bo_native
,
503 case ustctl_atype_enum
:
504 ret
= ust_metadata_enum_statedump(session
,
505 field
->type
.u
.basic
.enumeration
.name
,
506 field
->type
.u
.basic
.enumeration
.id
,
507 &field
->type
.u
.basic
.enumeration
.container_type
,
508 field
->name
, iter_field
, nesting
);
510 case ustctl_atype_float
:
511 ret
= print_tabs(session
, nesting
);
515 ret
= lttng_metadata_printf(session
,
516 "floating_point { exp_dig = %u; mant_dig = %u; align = %u;%s } _%s;\n",
517 field
->type
.u
.basic
._float
.exp_dig
,
518 field
->type
.u
.basic
._float
.mant_dig
,
519 field
->type
.u
.basic
._float
.alignment
,
520 field
->type
.u
.basic
.integer
.reverse_byte_order
? bo_reverse
: bo_native
,
524 case ustctl_atype_array
:
526 const struct ustctl_basic_type
*elem_type
;
528 ret
= print_tabs(session
, nesting
);
532 elem_type
= &field
->type
.u
.array
.elem_type
;
533 ret
= lttng_metadata_printf(session
,
534 "integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } _%s[%u];\n",
535 elem_type
->u
.basic
.integer
.size
,
536 elem_type
->u
.basic
.integer
.alignment
,
537 elem_type
->u
.basic
.integer
.signedness
,
538 (elem_type
->u
.basic
.integer
.encoding
== ustctl_encode_none
)
540 : (elem_type
->u
.basic
.integer
.encoding
== ustctl_encode_UTF8
)
543 elem_type
->u
.basic
.integer
.base
,
544 elem_type
->u
.basic
.integer
.reverse_byte_order
? bo_reverse
: bo_native
,
545 field
->name
, field
->type
.u
.array
.length
);
549 case ustctl_atype_sequence
:
551 const struct ustctl_basic_type
*elem_type
;
552 const struct ustctl_basic_type
*length_type
;
554 elem_type
= &field
->type
.u
.sequence
.elem_type
;
555 length_type
= &field
->type
.u
.sequence
.length_type
;
556 ret
= print_tabs(session
, nesting
);
560 ret
= lttng_metadata_printf(session
,
561 "integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } __%s_length;\n",
562 length_type
->u
.basic
.integer
.size
,
563 (unsigned int) length_type
->u
.basic
.integer
.alignment
,
564 length_type
->u
.basic
.integer
.signedness
,
565 (length_type
->u
.basic
.integer
.encoding
== ustctl_encode_none
)
567 : ((length_type
->u
.basic
.integer
.encoding
== ustctl_encode_UTF8
)
570 length_type
->u
.basic
.integer
.base
,
571 length_type
->u
.basic
.integer
.reverse_byte_order
? bo_reverse
: bo_native
,
577 ret
= print_tabs(session
, nesting
);
581 ret
= lttng_metadata_printf(session
,
582 "integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } _%s[ __%s_length ];\n",
583 elem_type
->u
.basic
.integer
.size
,
584 (unsigned int) elem_type
->u
.basic
.integer
.alignment
,
585 elem_type
->u
.basic
.integer
.signedness
,
586 (elem_type
->u
.basic
.integer
.encoding
== ustctl_encode_none
)
588 : ((elem_type
->u
.basic
.integer
.encoding
== ustctl_encode_UTF8
)
591 elem_type
->u
.basic
.integer
.base
,
592 elem_type
->u
.basic
.integer
.reverse_byte_order
? bo_reverse
: bo_native
,
599 case ustctl_atype_string
:
600 /* Default encoding is UTF8 */
601 ret
= print_tabs(session
, nesting
);
605 ret
= lttng_metadata_printf(session
,
607 field
->type
.u
.basic
.string
.encoding
== ustctl_encode_ASCII
?
608 " { encoding = ASCII; }" : "",
612 case ustctl_atype_variant
:
613 ret
= _lttng_variant_statedump(session
, fields
, nr_fields
, iter_field
, nesting
);
618 case ustctl_atype_struct
:
619 ret
= print_tabs(session
, nesting
);
623 ret
= lttng_metadata_printf(session
,
636 int _lttng_context_metadata_statedump(struct ust_registry_session
*session
,
637 size_t nr_ctx_fields
,
638 struct ustctl_field
*ctx
)
646 if (i
>= nr_ctx_fields
) {
649 ret
= _lttng_field_statedump(session
, ctx
,
650 nr_ctx_fields
, &i
, 2);
659 int _lttng_fields_metadata_statedump(struct ust_registry_session
*session
,
660 struct ust_registry_event
*event
)
666 if (i
>= event
->nr_fields
) {
669 ret
= _lttng_field_statedump(session
, event
->fields
,
670 event
->nr_fields
, &i
, 2);
679 * Should be called with session registry mutex held.
681 int ust_metadata_event_statedump(struct ust_registry_session
*session
,
682 struct ust_registry_channel
*chan
,
683 struct ust_registry_event
*event
)
687 /* Don't dump metadata events */
688 if (chan
->chan_id
== -1U)
691 ret
= lttng_metadata_printf(session
,
695 " stream_id = %u;\n",
702 ret
= lttng_metadata_printf(session
,
704 event
->loglevel_value
);
708 if (event
->model_emf_uri
) {
709 ret
= lttng_metadata_printf(session
,
710 " model.emf.uri = \"%s\";\n",
711 event
->model_emf_uri
);
716 ret
= lttng_metadata_printf(session
,
717 " fields := struct {\n"
722 ret
= _lttng_fields_metadata_statedump(session
, event
);
726 ret
= lttng_metadata_printf(session
,
731 event
->metadata_dumped
= 1;
738 * Should be called with session registry mutex held.
740 int ust_metadata_channel_statedump(struct ust_registry_session
*session
,
741 struct ust_registry_channel
*chan
)
745 /* Don't dump metadata events */
746 if (chan
->chan_id
== -1U)
749 if (!chan
->header_type
)
752 ret
= lttng_metadata_printf(session
,
755 " event.header := %s;\n"
756 " packet.context := struct packet_context;\n",
758 chan
->header_type
== USTCTL_CHANNEL_HEADER_COMPACT
?
759 "struct event_header_compact" :
760 "struct event_header_large");
764 if (chan
->ctx_fields
) {
765 ret
= lttng_metadata_printf(session
,
766 " event.context := struct {\n");
770 ret
= _lttng_context_metadata_statedump(session
,
775 if (chan
->ctx_fields
) {
776 ret
= lttng_metadata_printf(session
,
782 ret
= lttng_metadata_printf(session
,
784 /* Flag success of metadata dump. */
785 chan
->metadata_dumped
= 1;
792 int _lttng_stream_packet_context_declare(struct ust_registry_session
*session
)
794 return lttng_metadata_printf(session
,
795 "struct packet_context {\n"
796 " uint64_clock_monotonic_t timestamp_begin;\n"
797 " uint64_clock_monotonic_t timestamp_end;\n"
798 " uint64_t content_size;\n"
799 " uint64_t packet_size;\n"
800 " uint64_t packet_seq_num;\n"
801 " unsigned long events_discarded;\n"
802 " uint32_t cpu_id;\n"
810 * id 31 is reserved to indicate an extended header.
813 * id: range: 0 - 65534.
814 * id 65535 is reserved to indicate an extended header.
817 int _lttng_event_header_declare(struct ust_registry_session
*session
)
819 return lttng_metadata_printf(session
,
820 "struct event_header_compact {\n"
821 " enum : uint5_t { compact = 0 ... 30, extended = 31 } id;\n"
824 " uint27_clock_monotonic_t timestamp;\n"
828 " uint64_clock_monotonic_t timestamp;\n"
833 "struct event_header_large {\n"
834 " enum : uint16_t { compact = 0 ... 65534, extended = 65535 } id;\n"
837 " uint32_clock_monotonic_t timestamp;\n"
841 " uint64_clock_monotonic_t timestamp;\n"
845 session
->uint32_t_alignment
,
846 session
->uint16_t_alignment
851 * The offset between monotonic and realtime clock can be negative if
852 * the system sets the REALTIME clock to 0 after boot.
855 int measure_single_clock_offset(struct offset_sample
*sample
)
857 uint64_t monotonic_avg
, monotonic
[2], measure_delta
, realtime
;
858 uint64_t tcf
= trace_clock_freq();
859 struct timespec rts
= { 0, 0 };
862 monotonic
[0] = trace_clock_read64();
863 ret
= lttng_clock_gettime(CLOCK_REALTIME
, &rts
);
867 monotonic
[1] = trace_clock_read64();
868 measure_delta
= monotonic
[1] - monotonic
[0];
869 if (measure_delta
> sample
->measure_delta
) {
871 * Discard value if it took longer to read than the best
876 monotonic_avg
= (monotonic
[0] + monotonic
[1]) >> 1;
877 realtime
= (uint64_t) rts
.tv_sec
* tcf
;
878 if (tcf
== NSEC_PER_SEC
) {
879 realtime
+= rts
.tv_nsec
;
881 realtime
+= (uint64_t) rts
.tv_nsec
* tcf
/ NSEC_PER_SEC
;
883 sample
->offset
= (int64_t) realtime
- monotonic_avg
;
884 sample
->measure_delta
= measure_delta
;
889 * Approximation of NTP time of day to clock monotonic correlation,
890 * taken at start of trace. Keep the measurement that took the less time
891 * to complete, thus removing imprecision caused by preemption.
892 * May return a negative offset.
895 int64_t measure_clock_offset(void)
898 struct offset_sample offset_best_sample
= {
900 .measure_delta
= UINT64_MAX
,
903 for (i
= 0; i
< NR_CLOCK_OFFSET_SAMPLES
; i
++) {
904 if (measure_single_clock_offset(&offset_best_sample
)) {
908 return offset_best_sample
.offset
;
912 int print_metadata_session_information(struct ust_registry_session
*registry
)
915 struct ltt_session
*session
= NULL
;
916 char creation_datetime
[ISO8601_STR_LEN
];
919 session
= session_find_by_id(registry
->tracing_id
);
925 /* Print the trace name */
926 ret
= lttng_metadata_printf(registry
, " trace_name = \"");
932 * This is necessary since the creation time is present in the session
933 * name when it is generated.
935 if (session
->has_auto_generated_name
) {
936 ret
= print_escaped_ctf_string(registry
, DEFAULT_SESSION_NAME
);
938 ret
= print_escaped_ctf_string(registry
, session
->name
);
944 ret
= lttng_metadata_printf(registry
, "\";\n");
949 /* Prepare creation time */
950 ret
= time_to_iso8601_str(session
->creation_time
, creation_datetime
,
951 sizeof(creation_datetime
));
956 /* Output the reste of the information */
957 ret
= lttng_metadata_printf(registry
,
958 " trace_creation_datetime = \"%s\";\n"
959 " hostname = \"%s\";\n",
960 creation_datetime
, session
->hostname
);
967 session_put(session
);
974 int print_metadata_app_information(struct ust_registry_session
*registry
,
978 char datetime
[ISO8601_STR_LEN
];
985 ret
= time_to_iso8601_str(
986 app
->registration_time
, datetime
, sizeof(datetime
));
991 ret
= lttng_metadata_printf(registry
,
992 " tracer_patchlevel = %u;\n"
994 " procname = \"%s\";\n"
995 " vpid_datetime = \"%s\";\n",
996 app
->version
.patchlevel
, (int) app
->pid
, app
->name
,
1004 * Should be called with session registry mutex held.
1006 int ust_metadata_session_statedump(struct ust_registry_session
*session
,
1007 struct ust_app
*app
,
1011 char uuid_s
[UUID_STR_LEN
],
1012 clock_uuid_s
[UUID_STR_LEN
];
1017 lttng_uuid_to_str(session
->uuid
, uuid_s
);
1020 ret
= lttng_metadata_printf(session
,
1021 "/* CTF %u.%u */\n\n",
1028 ret
= lttng_metadata_printf(session
,
1029 "typealias integer { size = 8; align = %u; signed = false; } := uint8_t;\n"
1030 "typealias integer { size = 16; align = %u; signed = false; } := uint16_t;\n"
1031 "typealias integer { size = 32; align = %u; signed = false; } := uint32_t;\n"
1032 "typealias integer { size = 64; align = %u; signed = false; } := uint64_t;\n"
1033 "typealias integer { size = %u; align = %u; signed = false; } := unsigned long;\n"
1034 "typealias integer { size = 5; align = 1; signed = false; } := uint5_t;\n"
1035 "typealias integer { size = 27; align = 1; signed = false; } := uint27_t;\n"
1041 " byte_order = %s;\n"
1042 " packet.header := struct {\n"
1043 " uint32_t magic;\n"
1044 " uint8_t uuid[16];\n"
1045 " uint32_t stream_id;\n"
1046 " uint64_t stream_instance_id;\n"
1049 session
->uint8_t_alignment
,
1050 session
->uint16_t_alignment
,
1051 session
->uint32_t_alignment
,
1052 session
->uint64_t_alignment
,
1053 session
->bits_per_long
,
1054 session
->long_alignment
,
1058 session
->byte_order
== BIG_ENDIAN
? "be" : "le"
1063 ret
= lttng_metadata_printf(session
,
1065 " domain = \"ust\";\n"
1066 " tracer_name = \"lttng-ust\";\n"
1067 " tracer_major = %u;\n"
1068 " tracer_minor = %u;\n"
1069 " tracer_buffering_scheme = \"%s\";\n"
1070 " tracer_buffering_id = %u;\n"
1071 " architecture_bit_width = %u;\n",
1074 app
? "pid" : "uid",
1075 app
? (int) app
->pid
: (int) session
->tracing_uid
,
1076 session
->bits_per_long
);
1081 ret
= print_metadata_session_information(session
);
1087 * If per-application registry, we can output extra information
1088 * about the application.
1090 ret
= print_metadata_app_information(session
, app
);
1095 ret
= lttng_metadata_printf(session
,
1102 ret
= lttng_metadata_printf(session
,
1104 " name = \"%s\";\n",
1110 if (!trace_clock_uuid(clock_uuid_s
)) {
1111 ret
= lttng_metadata_printf(session
,
1112 " uuid = \"%s\";\n",
1119 ret
= lttng_metadata_printf(session
,
1120 " description = \"%s\";\n"
1121 " freq = %" PRIu64
"; /* Frequency, in Hz */\n"
1122 " /* clock value offset from Epoch is: offset * (1/freq) */\n"
1123 " offset = %" PRId64
";\n"
1125 trace_clock_description(),
1127 measure_clock_offset()
1132 ret
= lttng_metadata_printf(session
,
1133 "typealias integer {\n"
1134 " size = 27; align = 1; signed = false;\n"
1135 " map = clock.%s.value;\n"
1136 "} := uint27_clock_monotonic_t;\n"
1138 "typealias integer {\n"
1139 " size = 32; align = %u; signed = false;\n"
1140 " map = clock.%s.value;\n"
1141 "} := uint32_clock_monotonic_t;\n"
1143 "typealias integer {\n"
1144 " size = 64; align = %u; signed = false;\n"
1145 " map = clock.%s.value;\n"
1146 "} := uint64_clock_monotonic_t;\n\n",
1148 session
->uint32_t_alignment
,
1150 session
->uint64_t_alignment
,
1156 ret
= _lttng_stream_packet_context_declare(session
);
1160 ret
= _lttng_event_header_declare(session
);