From 578e68ec82a889d3864e90ddc203d69360362110 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Genevi=C3=A8ve=20Bastien?= Date: Tue, 12 Jul 2016 12:21:51 -0400 Subject: [PATCH] Fix: endianness for the container type of enum MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If the endianness is specified for an enumeration, it should be written in the metadata like for any other integer type. Signed-off-by: Geneviève Bastien Signed-off-by: Mathieu Desnoyers --- lttng-events.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lttng-events.c b/lttng-events.c index 455b790f..176908bf 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -1909,7 +1909,7 @@ int _lttng_enum_statedump(struct lttng_session *session, if (ret) goto end; ret = lttng_metadata_printf(session, - "enum : integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u; } {\n", + "enum : integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } {\n", container_type->size, container_type->alignment, container_type->signedness, @@ -1918,7 +1918,13 @@ int _lttng_enum_statedump(struct lttng_session *session, : (container_type->encoding == lttng_encode_UTF8) ? "UTF8" : "ASCII", - container_type->base); + container_type->base, +#if __BYTE_ORDER == __BIG_ENDIAN + container_type->reverse_byte_order ? " byte_order = le;" : "" +#else + container_type->reverse_byte_order ? " byte_order = be;" : "" +#endif + ); if (ret) goto end; /* Dump all entries */ -- 2.34.1