X-Git-Url: http://git.liburcu.org/?p=lttng-ust.git;a=blobdiff_plain;f=include%2Flttng%2Fust-tracepoint-event.h;fp=include%2Flttng%2Fust-tracepoint-event.h;h=c3275d46e82454ffb52e98e611c45a11bc5104a5;hp=29a017b0f0e7521549ea3c5a13b179347a7fd00d;hb=816f2fd94bf6f083dbf2362c0d70a9828a863850;hpb=743dc9e5810f508f597609b9ce2114ebf2b89470 diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 29a017b0..c3275d46 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #undef tp_list_for_each_entry_rcu @@ -317,18 +318,24 @@ size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, _TP_ARGS case 2: \ { \ union { _type t; int16_t v; } __tmp = { (_type) (_src) }; \ + if (_byte_order != BYTE_ORDER) \ + __tmp.v = bswap_16(__tmp.v); \ __ctf_tmp_int64 = (int64_t) __tmp.v; \ break; \ } \ case 4: \ { \ union { _type t; int32_t v; } __tmp = { (_type) (_src) }; \ + if (_byte_order != BYTE_ORDER) \ + __tmp.v = bswap_32(__tmp.v); \ __ctf_tmp_int64 = (int64_t) __tmp.v; \ break; \ } \ case 8: \ { \ union { _type t; int64_t v; } __tmp = { (_type) (_src) }; \ + if (_byte_order != BYTE_ORDER) \ + __tmp.v = bswap_64(__tmp.v); \ __ctf_tmp_int64 = (int64_t) __tmp.v; \ break; \ } \ @@ -348,18 +355,24 @@ size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, _TP_ARGS case 2: \ { \ union { _type t; uint16_t v; } __tmp = { (_type) (_src) }; \ + if (_byte_order != BYTE_ORDER) \ + __tmp.v = bswap_16(__tmp.v); \ __ctf_tmp_uint64 = (uint64_t) __tmp.v; \ break; \ } \ case 4: \ { \ union { _type t; uint32_t v; } __tmp = { (_type) (_src) }; \ + if (_byte_order != BYTE_ORDER) \ + __tmp.v = bswap_32(__tmp.v); \ __ctf_tmp_uint64 = (uint64_t) __tmp.v; \ break; \ } \ case 8: \ { \ union { _type t; uint64_t v; } __tmp = { (_type) (_src) }; \ + if (_byte_order != BYTE_ORDER) \ + __tmp.v = bswap_64(__tmp.v); \ __ctf_tmp_uint64 = (uint64_t) __tmp.v; \ break; \ } \