From: Jonathan Rajotte Date: Wed, 12 Jan 2022 23:18:08 +0000 (-0500) Subject: Fix: liblttng-ctl comm: lttng_event_field is not packed X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=b2d6883965b19c6b6cb47acac952a7ab3de88c11;hp=b2d6883965b19c6b6cb47acac952a7ab3de88c11;p=lttng-tools.git Fix: liblttng-ctl comm: lttng_event_field is not packed Observed issue ============== For MI testing where the lttng-sessiond is 64 bit and the lttng CLI is 32 bit, the tracepoint field listing fails with partial garbage output. The size of the struct differs between bitness for x86-64 and x86 leading to serialization/deserialization problem across client (liblttng-ctl) and lttng-sessiond. sizeof(struct lttng_event_field): x86: 1136 x86-64: 1144 The struct cannot be marked as LTTNG_PACKED since it is part of the API. Solution ======== Adopt a similar pattern to the new APIs with a "serialize" & "create_from_buffer" approach. The only particularity is that we need to flatten the event_field on listing. Most of the complexity is moved to `src/common/event.c` Known drawbacks ========= None. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I280d9809d110237574e2606ee93a7aeba41e704e ---