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))
94 * Returns offset where to write in metadata array, or negative error value on error.
97 ssize_t
metadata_reserve(struct ust_registry_session
*session
, size_t len
)
99 size_t new_len
= session
->metadata_len
+ len
;
100 size_t new_alloc_len
= new_len
;
101 size_t old_alloc_len
= session
->metadata_alloc_len
;
104 if (new_alloc_len
> (UINT32_MAX
>> 1))
106 if ((old_alloc_len
<< 1) > (UINT32_MAX
>> 1))
109 if (new_alloc_len
> old_alloc_len
) {
113 max_t(size_t, 1U << get_count_order(new_alloc_len
), old_alloc_len
<< 1);
114 newptr
= realloc(session
->metadata
, new_alloc_len
);
117 session
->metadata
= newptr
;
118 /* We zero directly the memory from start of allocation. */
119 memset(&session
->metadata
[old_alloc_len
], 0, new_alloc_len
- old_alloc_len
);
120 session
->metadata_alloc_len
= new_alloc_len
;
122 ret
= session
->metadata_len
;
123 session
->metadata_len
+= len
;
128 int metadata_file_append(struct ust_registry_session
*session
,
129 const char *str
, size_t len
)
133 if (session
->metadata_fd
< 0) {
136 /* Write to metadata file */
137 written
= lttng_write(session
->metadata_fd
, str
, len
);
138 if (written
!= len
) {
145 * We have exclusive access to our metadata buffer (protected by the
146 * ust_lock), so we can do racy operations such as looking for
147 * remaining space left in packet and write, since mutual exclusion
148 * protects us from concurrent writes.
151 int lttng_metadata_printf(struct ust_registry_session
*session
,
152 const char *fmt
, ...)
161 ret
= vasprintf(&str
, fmt
, ap
);
167 offset
= metadata_reserve(session
, len
);
172 memcpy(&session
->metadata
[offset
], str
, len
);
173 ret
= metadata_file_append(session
, str
, len
);
175 PERROR("Error appending to metadata file");
178 DBG3("Append to metadata: \"%s\"", str
);
187 int print_tabs(struct ust_registry_session
*session
, size_t nesting
)
191 for (i
= 0; i
< nesting
; i
++) {
194 ret
= lttng_metadata_printf(session
, " ");
203 void sanitize_ctf_identifier(char *out
, const char *in
)
207 for (i
= 0; i
< LTTNG_UST_SYM_NAME_LEN
; i
++) {
221 int print_escaped_ctf_string(struct ust_registry_session
*session
, const char *string
)
229 while (cur
!= '\0') {
232 ret
= lttng_metadata_printf(session
, "%s", "\\n");
236 ret
= lttng_metadata_printf(session
, "%c", '\\');
240 /* We still print the current char */
243 ret
= lttng_metadata_printf(session
, "%c", cur
);
257 /* Called with session registry mutex held. */
259 int ust_metadata_enum_statedump(struct ust_registry_session
*session
,
260 const char *enum_name
,
262 const struct ustctl_integer_type
*container_type
,
263 const char *field_name
, size_t *iter_field
, size_t nesting
)
265 struct ust_registry_enum
*reg_enum
;
266 const struct ustctl_enum_entry
*entries
;
270 char identifier
[LTTNG_UST_SYM_NAME_LEN
];
273 reg_enum
= ust_registry_lookup_enum_by_id(session
, enum_name
, enum_id
);
275 /* reg_enum can still be used because session registry mutex is held. */
280 entries
= reg_enum
->entries
;
281 nr_entries
= reg_enum
->nr_entries
;
283 ret
= print_tabs(session
, nesting
);
287 ret
= lttng_metadata_printf(session
,
288 "enum : integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u; } {\n",
289 container_type
->size
,
290 container_type
->alignment
,
291 container_type
->signedness
,
292 (container_type
->encoding
== ustctl_encode_none
)
294 : (container_type
->encoding
== ustctl_encode_UTF8
)
297 container_type
->base
);
302 /* Dump all entries */
303 for (i
= 0; i
< nr_entries
; i
++) {
304 const struct ustctl_enum_entry
*entry
= &entries
[i
];
307 ret
= print_tabs(session
, nesting
);
311 ret
= lttng_metadata_printf(session
,
316 len
= strlen(entry
->string
);
317 /* Escape the character '"' */
318 for (j
= 0; j
< len
; j
++) {
319 char c
= entry
->string
[j
];
323 ret
= lttng_metadata_printf(session
,
327 ret
= lttng_metadata_printf(session
,
331 ret
= lttng_metadata_printf(session
,
339 ret
= lttng_metadata_printf(session
, "\"");
344 if (entry
->u
.extra
.options
&
345 USTCTL_UST_ENUM_ENTRY_OPTION_IS_AUTO
) {
346 ret
= lttng_metadata_printf(session
, ",\n");
351 ret
= lttng_metadata_printf(session
,
357 if (entry
->start
.signedness
) {
358 ret
= lttng_metadata_printf(session
,
359 "%lld", (long long) entry
->start
.value
);
361 ret
= lttng_metadata_printf(session
,
362 "%llu", entry
->start
.value
);
368 if (entry
->start
.signedness
== entry
->end
.signedness
&&
369 entry
->start
.value
==
371 ret
= lttng_metadata_printf(session
, ",\n");
373 if (entry
->end
.signedness
) {
374 ret
= lttng_metadata_printf(session
,
376 (long long) entry
->end
.value
);
378 ret
= lttng_metadata_printf(session
,
389 sanitize_ctf_identifier(identifier
, field_name
);
390 ret
= print_tabs(session
, nesting
);
394 ret
= lttng_metadata_printf(session
, "} _%s;\n",
402 int _lttng_variant_statedump(struct ust_registry_session
*session
,
403 const struct ustctl_field
*fields
, size_t nr_fields
,
404 size_t *iter_field
, size_t nesting
)
406 const struct ustctl_field
*variant
= &fields
[*iter_field
];
407 uint32_t nr_choices
, i
;
409 char identifier
[LTTNG_UST_SYM_NAME_LEN
];
411 if (variant
->type
.atype
!= ustctl_atype_variant
) {
415 nr_choices
= variant
->type
.u
.variant
.nr_choices
;
417 sanitize_ctf_identifier(identifier
, variant
->type
.u
.variant
.tag_name
);
418 ret
= print_tabs(session
, nesting
);
422 ret
= lttng_metadata_printf(session
,
429 for (i
= 0; i
< nr_choices
; i
++) {
430 if (*iter_field
>= nr_fields
) {
434 ret
= _lttng_field_statedump(session
,
436 iter_field
, nesting
+ 1);
441 sanitize_ctf_identifier(identifier
, variant
->name
);
442 ret
= print_tabs(session
, nesting
);
446 ret
= lttng_metadata_printf(session
,
457 int _lttng_field_statedump(struct ust_registry_session
*session
,
458 const struct ustctl_field
*fields
, size_t nr_fields
,
459 size_t *iter_field
, size_t nesting
)
462 const char *bo_be
= " byte_order = be;";
463 const char *bo_le
= " byte_order = le;";
464 const char *bo_native
= "";
465 const char *bo_reverse
;
466 const struct ustctl_field
*field
;
468 if (*iter_field
>= nr_fields
) {
472 field
= &fields
[*iter_field
];
474 if (session
->byte_order
== BIG_ENDIAN
) {
480 switch (field
->type
.atype
) {
481 case ustctl_atype_integer
:
482 ret
= print_tabs(session
, nesting
);
486 ret
= lttng_metadata_printf(session
,
487 "integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } _%s;\n",
488 field
->type
.u
.basic
.integer
.size
,
489 field
->type
.u
.basic
.integer
.alignment
,
490 field
->type
.u
.basic
.integer
.signedness
,
491 (field
->type
.u
.basic
.integer
.encoding
== ustctl_encode_none
)
493 : (field
->type
.u
.basic
.integer
.encoding
== ustctl_encode_UTF8
)
496 field
->type
.u
.basic
.integer
.base
,
497 field
->type
.u
.basic
.integer
.reverse_byte_order
? bo_reverse
: bo_native
,
501 case ustctl_atype_enum
:
502 ret
= ust_metadata_enum_statedump(session
,
503 field
->type
.u
.basic
.enumeration
.name
,
504 field
->type
.u
.basic
.enumeration
.id
,
505 &field
->type
.u
.basic
.enumeration
.container_type
,
506 field
->name
, iter_field
, nesting
);
508 case ustctl_atype_float
:
509 ret
= print_tabs(session
, nesting
);
513 ret
= lttng_metadata_printf(session
,
514 "floating_point { exp_dig = %u; mant_dig = %u; align = %u;%s } _%s;\n",
515 field
->type
.u
.basic
._float
.exp_dig
,
516 field
->type
.u
.basic
._float
.mant_dig
,
517 field
->type
.u
.basic
._float
.alignment
,
518 field
->type
.u
.basic
.integer
.reverse_byte_order
? bo_reverse
: bo_native
,
522 case ustctl_atype_array
:
524 const struct ustctl_basic_type
*elem_type
;
526 ret
= print_tabs(session
, nesting
);
530 elem_type
= &field
->type
.u
.array
.elem_type
;
531 ret
= lttng_metadata_printf(session
,
532 "integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } _%s[%u];\n",
533 elem_type
->u
.basic
.integer
.size
,
534 elem_type
->u
.basic
.integer
.alignment
,
535 elem_type
->u
.basic
.integer
.signedness
,
536 (elem_type
->u
.basic
.integer
.encoding
== ustctl_encode_none
)
538 : (elem_type
->u
.basic
.integer
.encoding
== ustctl_encode_UTF8
)
541 elem_type
->u
.basic
.integer
.base
,
542 elem_type
->u
.basic
.integer
.reverse_byte_order
? bo_reverse
: bo_native
,
543 field
->name
, field
->type
.u
.array
.length
);
547 case ustctl_atype_sequence
:
549 const struct ustctl_basic_type
*elem_type
;
550 const struct ustctl_basic_type
*length_type
;
552 elem_type
= &field
->type
.u
.sequence
.elem_type
;
553 length_type
= &field
->type
.u
.sequence
.length_type
;
554 ret
= print_tabs(session
, nesting
);
558 ret
= lttng_metadata_printf(session
,
559 "integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } __%s_length;\n",
560 length_type
->u
.basic
.integer
.size
,
561 (unsigned int) length_type
->u
.basic
.integer
.alignment
,
562 length_type
->u
.basic
.integer
.signedness
,
563 (length_type
->u
.basic
.integer
.encoding
== ustctl_encode_none
)
565 : ((length_type
->u
.basic
.integer
.encoding
== ustctl_encode_UTF8
)
568 length_type
->u
.basic
.integer
.base
,
569 length_type
->u
.basic
.integer
.reverse_byte_order
? bo_reverse
: bo_native
,
575 ret
= print_tabs(session
, nesting
);
579 ret
= lttng_metadata_printf(session
,
580 "integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } _%s[ __%s_length ];\n",
581 elem_type
->u
.basic
.integer
.size
,
582 (unsigned int) elem_type
->u
.basic
.integer
.alignment
,
583 elem_type
->u
.basic
.integer
.signedness
,
584 (elem_type
->u
.basic
.integer
.encoding
== ustctl_encode_none
)
586 : ((elem_type
->u
.basic
.integer
.encoding
== ustctl_encode_UTF8
)
589 elem_type
->u
.basic
.integer
.base
,
590 elem_type
->u
.basic
.integer
.reverse_byte_order
? bo_reverse
: bo_native
,
597 case ustctl_atype_string
:
598 /* Default encoding is UTF8 */
599 ret
= print_tabs(session
, nesting
);
603 ret
= lttng_metadata_printf(session
,
605 field
->type
.u
.basic
.string
.encoding
== ustctl_encode_ASCII
?
606 " { encoding = ASCII; }" : "",
610 case ustctl_atype_variant
:
611 ret
= _lttng_variant_statedump(session
, fields
, nr_fields
, iter_field
, nesting
);
616 case ustctl_atype_struct
:
617 ret
= print_tabs(session
, nesting
);
621 ret
= lttng_metadata_printf(session
,
634 int _lttng_context_metadata_statedump(struct ust_registry_session
*session
,
635 size_t nr_ctx_fields
,
636 struct ustctl_field
*ctx
)
644 if (i
>= nr_ctx_fields
) {
647 ret
= _lttng_field_statedump(session
, ctx
,
648 nr_ctx_fields
, &i
, 2);
657 int _lttng_fields_metadata_statedump(struct ust_registry_session
*session
,
658 struct ust_registry_event
*event
)
664 if (i
>= event
->nr_fields
) {
667 ret
= _lttng_field_statedump(session
, event
->fields
,
668 event
->nr_fields
, &i
, 2);
677 * Should be called with session registry mutex held.
679 int ust_metadata_event_statedump(struct ust_registry_session
*session
,
680 struct ust_registry_channel
*chan
,
681 struct ust_registry_event
*event
)
685 /* Don't dump metadata events */
686 if (chan
->chan_id
== -1U)
689 ret
= lttng_metadata_printf(session
,
693 " stream_id = %u;\n",
700 ret
= lttng_metadata_printf(session
,
702 event
->loglevel_value
);
706 if (event
->model_emf_uri
) {
707 ret
= lttng_metadata_printf(session
,
708 " model.emf.uri = \"%s\";\n",
709 event
->model_emf_uri
);
714 ret
= lttng_metadata_printf(session
,
715 " fields := struct {\n"
720 ret
= _lttng_fields_metadata_statedump(session
, event
);
724 ret
= lttng_metadata_printf(session
,
729 event
->metadata_dumped
= 1;
736 * Should be called with session registry mutex held.
738 int ust_metadata_channel_statedump(struct ust_registry_session
*session
,
739 struct ust_registry_channel
*chan
)
743 /* Don't dump metadata events */
744 if (chan
->chan_id
== -1U)
747 if (!chan
->header_type
)
750 ret
= lttng_metadata_printf(session
,
753 " event.header := %s;\n"
754 " packet.context := struct packet_context;\n",
756 chan
->header_type
== USTCTL_CHANNEL_HEADER_COMPACT
?
757 "struct event_header_compact" :
758 "struct event_header_large");
762 if (chan
->ctx_fields
) {
763 ret
= lttng_metadata_printf(session
,
764 " event.context := struct {\n");
768 ret
= _lttng_context_metadata_statedump(session
,
773 if (chan
->ctx_fields
) {
774 ret
= lttng_metadata_printf(session
,
780 ret
= lttng_metadata_printf(session
,
782 /* Flag success of metadata dump. */
783 chan
->metadata_dumped
= 1;
790 int _lttng_stream_packet_context_declare(struct ust_registry_session
*session
)
792 return lttng_metadata_printf(session
,
793 "struct packet_context {\n"
794 " uint64_clock_monotonic_t timestamp_begin;\n"
795 " uint64_clock_monotonic_t timestamp_end;\n"
796 " uint64_t content_size;\n"
797 " uint64_t packet_size;\n"
798 " uint64_t packet_seq_num;\n"
799 " unsigned long events_discarded;\n"
800 " uint32_t cpu_id;\n"
808 * id 31 is reserved to indicate an extended header.
811 * id: range: 0 - 65534.
812 * id 65535 is reserved to indicate an extended header.
815 int _lttng_event_header_declare(struct ust_registry_session
*session
)
817 return lttng_metadata_printf(session
,
818 "struct event_header_compact {\n"
819 " enum : uint5_t { compact = 0 ... 30, extended = 31 } id;\n"
822 " uint27_clock_monotonic_t timestamp;\n"
826 " uint64_clock_monotonic_t timestamp;\n"
831 "struct event_header_large {\n"
832 " enum : uint16_t { compact = 0 ... 65534, extended = 65535 } id;\n"
835 " uint32_clock_monotonic_t timestamp;\n"
839 " uint64_clock_monotonic_t timestamp;\n"
843 session
->uint32_t_alignment
,
844 session
->uint16_t_alignment
849 * The offset between monotonic and realtime clock can be negative if
850 * the system sets the REALTIME clock to 0 after boot.
853 int measure_single_clock_offset(struct offset_sample
*sample
)
855 uint64_t monotonic_avg
, monotonic
[2], measure_delta
, realtime
;
856 uint64_t tcf
= trace_clock_freq();
857 struct timespec rts
= { 0, 0 };
860 monotonic
[0] = trace_clock_read64();
861 ret
= lttng_clock_gettime(CLOCK_REALTIME
, &rts
);
865 monotonic
[1] = trace_clock_read64();
866 measure_delta
= monotonic
[1] - monotonic
[0];
867 if (measure_delta
> sample
->measure_delta
) {
869 * Discard value if it took longer to read than the best
874 monotonic_avg
= (monotonic
[0] + monotonic
[1]) >> 1;
875 realtime
= (uint64_t) rts
.tv_sec
* tcf
;
876 if (tcf
== NSEC_PER_SEC
) {
877 realtime
+= rts
.tv_nsec
;
879 realtime
+= (uint64_t) rts
.tv_nsec
* tcf
/ NSEC_PER_SEC
;
881 sample
->offset
= (int64_t) realtime
- monotonic_avg
;
882 sample
->measure_delta
= measure_delta
;
887 * Approximation of NTP time of day to clock monotonic correlation,
888 * taken at start of trace. Keep the measurement that took the less time
889 * to complete, thus removing imprecision caused by preemption.
890 * May return a negative offset.
893 int64_t measure_clock_offset(void)
896 struct offset_sample offset_best_sample
= {
898 .measure_delta
= UINT64_MAX
,
901 for (i
= 0; i
< NR_CLOCK_OFFSET_SAMPLES
; i
++) {
902 if (measure_single_clock_offset(&offset_best_sample
)) {
906 return offset_best_sample
.offset
;
910 int print_metadata_session_information(struct ust_registry_session
*registry
)
913 struct ltt_session
*session
= NULL
;
914 char creation_datetime
[ISO8601_STR_LEN
];
917 session
= session_find_by_id(registry
->tracing_id
);
923 /* Print the trace name */
924 ret
= lttng_metadata_printf(registry
, " trace_name = \"");
930 * This is necessary since the creation time is present in the session
931 * name when it is generated.
933 if (session
->has_auto_generated_name
) {
934 ret
= print_escaped_ctf_string(registry
, DEFAULT_SESSION_NAME
);
936 ret
= print_escaped_ctf_string(registry
, session
->name
);
942 ret
= lttng_metadata_printf(registry
, "\";\n");
947 /* Prepare creation time */
948 ret
= time_to_iso8601_str(session
->creation_time
, creation_datetime
,
949 sizeof(creation_datetime
));
954 /* Output the reste of the information */
955 ret
= lttng_metadata_printf(registry
,
956 " trace_creation_datetime = \"%s\";\n"
957 " hostname = \"%s\";\n",
958 creation_datetime
, session
->hostname
);
965 session_put(session
);
972 int print_metadata_app_information(struct ust_registry_session
*registry
,
976 char datetime
[ISO8601_STR_LEN
];
983 ret
= time_to_iso8601_str(
984 app
->registration_time
, datetime
, sizeof(datetime
));
989 ret
= lttng_metadata_printf(registry
,
990 " tracer_patchlevel = %u;\n"
992 " procname = \"%s\";\n"
993 " vpid_datetime = \"%s\";\n",
994 app
->version
.patchlevel
, (int) app
->pid
, app
->name
,
1002 * Should be called with session registry mutex held.
1004 int ust_metadata_session_statedump(struct ust_registry_session
*session
,
1005 struct ust_app
*app
,
1009 char uuid_s
[UUID_STR_LEN
],
1010 clock_uuid_s
[UUID_STR_LEN
];
1015 lttng_uuid_to_str(session
->uuid
, uuid_s
);
1018 ret
= lttng_metadata_printf(session
,
1019 "/* CTF %u.%u */\n\n",
1026 ret
= lttng_metadata_printf(session
,
1027 "typealias integer { size = 8; align = %u; signed = false; } := uint8_t;\n"
1028 "typealias integer { size = 16; align = %u; signed = false; } := uint16_t;\n"
1029 "typealias integer { size = 32; align = %u; signed = false; } := uint32_t;\n"
1030 "typealias integer { size = 64; align = %u; signed = false; } := uint64_t;\n"
1031 "typealias integer { size = %u; align = %u; signed = false; } := unsigned long;\n"
1032 "typealias integer { size = 5; align = 1; signed = false; } := uint5_t;\n"
1033 "typealias integer { size = 27; align = 1; signed = false; } := uint27_t;\n"
1039 " byte_order = %s;\n"
1040 " packet.header := struct {\n"
1041 " uint32_t magic;\n"
1042 " uint8_t uuid[16];\n"
1043 " uint32_t stream_id;\n"
1044 " uint64_t stream_instance_id;\n"
1047 session
->uint8_t_alignment
,
1048 session
->uint16_t_alignment
,
1049 session
->uint32_t_alignment
,
1050 session
->uint64_t_alignment
,
1051 session
->bits_per_long
,
1052 session
->long_alignment
,
1056 session
->byte_order
== BIG_ENDIAN
? "be" : "le"
1061 ret
= lttng_metadata_printf(session
,
1063 " domain = \"ust\";\n"
1064 " tracer_name = \"lttng-ust\";\n"
1065 " tracer_major = %u;\n"
1066 " tracer_minor = %u;\n"
1067 " tracer_buffering_scheme = \"%s\";\n"
1068 " tracer_buffering_id = %u;\n"
1069 " architecture_bit_width = %u;\n",
1072 app
? "pid" : "uid",
1073 app
? (int) app
->pid
: (int) session
->tracing_uid
,
1074 session
->bits_per_long
);
1079 ret
= print_metadata_session_information(session
);
1085 * If per-application registry, we can output extra information
1086 * about the application.
1088 ret
= print_metadata_app_information(session
, app
);
1093 ret
= lttng_metadata_printf(session
,
1100 ret
= lttng_metadata_printf(session
,
1102 " name = \"%s\";\n",
1108 if (!trace_clock_uuid(clock_uuid_s
)) {
1109 ret
= lttng_metadata_printf(session
,
1110 " uuid = \"%s\";\n",
1117 ret
= lttng_metadata_printf(session
,
1118 " description = \"%s\";\n"
1119 " freq = %" PRIu64
"; /* Frequency, in Hz */\n"
1120 " /* clock value offset from Epoch is: offset * (1/freq) */\n"
1121 " offset = %" PRId64
";\n"
1123 trace_clock_description(),
1125 measure_clock_offset()
1130 ret
= lttng_metadata_printf(session
,
1131 "typealias integer {\n"
1132 " size = 27; align = 1; signed = false;\n"
1133 " map = clock.%s.value;\n"
1134 "} := uint27_clock_monotonic_t;\n"
1136 "typealias integer {\n"
1137 " size = 32; align = %u; signed = false;\n"
1138 " map = clock.%s.value;\n"
1139 "} := uint32_clock_monotonic_t;\n"
1141 "typealias integer {\n"
1142 " size = 64; align = %u; signed = false;\n"
1143 " map = clock.%s.value;\n"
1144 "} := uint64_clock_monotonic_t;\n\n",
1146 session
->uint32_t_alignment
,
1148 session
->uint64_t_alignment
,
1154 ret
= _lttng_stream_packet_context_declare(session
);
1158 ret
= _lttng_event_header_declare(session
);