Document nested type alignment field
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 12 Apr 2021 13:30:05 +0000 (09:30 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 12 Apr 2021 13:35:03 +0000 (09:35 -0400)
Clarify that the alignment field for structure, sequence, and array
types is a minimum alignment.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: If0f7d24742741957085742c3a68db0b964e22a67

include/lttng/ust-events.h

index ceb9cb379c533c792d3f5c9edbda698cf6138065..2232212fed73f7a55ff71a717b2bcbd0e0a2c5a9 100644 (file)
@@ -174,12 +174,19 @@ struct lttng_ust_type_enum {
        const struct lttng_ust_type_common *container_type;
 };
 
+/*
+ * The alignment field in structure, array, and sequence types is a
+ * minimum alignment requirement. The actual alignment of a type may be
+ * larger than this explicit alignment value if its nested types have a
+ * larger alignment.
+ */
+
 struct lttng_ust_type_array {
        struct lttng_ust_type_common parent;
        uint32_t struct_size;
        const struct lttng_ust_type_common *elem_type;
-       unsigned int length;                    /* Num. elems. */
-       unsigned int alignment;
+       unsigned int length;            /* Num. elems. */
+       unsigned int alignment;         /* Minimum alignment for this type. */
        enum lttng_ust_string_encoding encoding;
 };
 
@@ -188,7 +195,7 @@ struct lttng_ust_type_sequence {
        uint32_t struct_size;
        const char *length_name;        /* Length field name. */
        const struct lttng_ust_type_common *elem_type;
-       unsigned int alignment;         /* Alignment before elements. */
+       unsigned int alignment;         /* Minimum alignment before elements. */
        enum lttng_ust_string_encoding encoding;
 };
 
@@ -197,7 +204,7 @@ struct lttng_ust_type_struct {
        uint32_t struct_size;
        unsigned int nr_fields;
        const struct lttng_ust_event_field **fields;    /* Array of pointers to fields. */
-       unsigned int alignment;
+       unsigned int alignment;         /* Minimum alignment for this type. */
 };
 
 /*
This page took 0.025959 seconds and 4 git commands to generate.