[RFC,lttng-tools,16/18] Add serialized versionsof lttng_event structs
Commit Message
Serialized version of lttng_snapshot_output is a packed structure to be
used in communication protocols for consistent size across platforms.
The serialized version is stripped of pointers and padding.
Pointers are removed since their size can vary on platforms supporting
variable sized registers (x86-64).
Padding is also removed since it defeats the purpose of a packed struct.
Signed-off-by: Yannick Lamarre <ylamarre at efficios.com>
---
include/lttng/snapshot-internal.h | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
----- On Apr 18, 2019, at 12:18 PM, Yannick Lamarre ylamarre at efficios.com wrote:
> Serialized version of lttng_snapshot_output is a packed structure to be
> used in communication protocols for consistent size across platforms.
> The serialized version is stripped of pointers and padding.
>
> Pointers are removed since their size can vary on platforms supporting
> variable sized registers (x86-64).
> Padding is also removed since it defeats the purpose of a packed struct.
Same questions about explanation of "variable sized registers" and how
we extend without padding as prior commits.
Thanks,
Mathieu
>
> Signed-off-by: Yannick Lamarre <ylamarre at efficios.com>
> ---
> include/lttng/snapshot-internal.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/lttng/snapshot-internal.h
> b/include/lttng/snapshot-internal.h
> index b7391c22..bf9dfbe4 100644
> --- a/include/lttng/snapshot-internal.h
> +++ b/include/lttng/snapshot-internal.h
> @@ -45,6 +45,14 @@ struct lttng_snapshot_output {
> char data_url[PATH_MAX];
> };
>
> +struct lttng_snapshot_output_serialized {
> + uint32_t id;
> + uint64_t max_size;
> + char name[LTTNG_NAME_MAX];
> + char ctrl_url[PATH_MAX];
> + char data_url[PATH_MAX];
> +} LTTNG_PACKED;
> +
> /*
> * Snapshot output list object opaque to the user.
> */
> --
> 2.11.0
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
@@ -45,6 +45,14 @@ struct lttng_snapshot_output {
char data_url[PATH_MAX];
};
+struct lttng_snapshot_output_serialized {
+ uint32_t id;
+ uint64_t max_size;
+ char name[LTTNG_NAME_MAX];
+ char ctrl_url[PATH_MAX];
+ char data_url[PATH_MAX];
+} LTTNG_PACKED;
+
/*
* Snapshot output list object opaque to the user.
*/