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 <ylama...@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@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to