From mboxrd@z Thu Jan 1 00:00:00 1970 From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers) Date: Thu, 18 Apr 2019 15:41:58 -0400 (EDT) Subject: [lttng-dev] [RFC PATCH lttng-tools 10/18] Add serialized versions of lttng_event_context structs In-Reply-To: <20190418161850.1536-11-ylamarre@efficios.com> References: <20190418161850.1536-1-ylamarre@efficios.com> <20190418161850.1536-11-ylamarre@efficios.com> Message-ID: <1217725376.1553.1555616518918.JavaMail.zimbra@efficios.com> ----- On Apr 18, 2019, at 12:18 PM, Yannick Lamarre ylamarre at efficios.com wrote: > Serialized versions of lttng_event_context and lttng_event_perf_counter_ctx are > packed structures to be used in communication protocols for consistent > sizes across platforms. The serialized versions are stripped of pointers > and padding. > > Pointers are removed since their size can vary on platforms supporting > variable sized registers (x86-64). Same question as prior commit about the explanation here. > Padding is also removed since it defeats the purpose of a packed struct. Same question as prior commit about padding purpose. How do we intend to extend this in the future ? We should document this plan. Thanks, Mathieu > > Signed-off-by: Yannick Lamarre > --- > include/lttng/event-internal.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/include/lttng/event-internal.h b/include/lttng/event-internal.h > index f8130e3b..25a88448 100644 > --- a/include/lttng/event-internal.h > +++ b/include/lttng/event-internal.h > @@ -27,6 +27,17 @@ > > struct lttng_userspace_probe_location; > > +struct lttng_event_perf_counter_ctx_serialized { > + uint32_t type; > + uint64_t config; > + char name[LTTNG_SYMBOL_NAME_LEN]; > +} LTTNG_PACKED; > + > +struct lttng_event_context_serialized { > + uint32_t ctx; /* enum lttng_event_context_type */ > + struct lttng_event_perf_counter_ctx_serialized perf_counter; > +} LTTNG_PACKED; > + > struct lttng_event_extended { > /* > * exclusions and filter_expression are only set when the lttng_event > -- > 2.11.0 > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com