liblttng-ctl: use lttng_payload for serialize/create_from_buffer
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 10 Jun 2020 19:39:47 +0000 (15:39 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 11 Jun 2020 22:14:39 +0000 (18:14 -0400)
Some objects used in the sessiond <-> liblttng-ctl communication (e.g.
such as userspace probe event rule) contain file descriptors that
must be carried accross process boundaries (fd passing).

Since those objects are often nested within a higher-level object
hierarchy, it makes sense to adapt the existing
serialize/create_from_buffer interface to use an lttng_payload.

An lttng_payload contains a dynamic buffer and an array of file
descriptors. Objects are expected to push their file descriptors in the
payload in the same way they currently push the bytes of their binary
representation in a dynamic buffer.

Conversely, an lttng_payload_view interface is added and contains a
buffer_view and an iterator which allows objects to ̀ pop` a file
descriptors when appropriate.

Tests are added to validate the FD consumption behaviour depending
on the origin of payload views (root view or descendant view).

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Id378d8b5a3376a074ab138a60733377e39a24133


No differences found
This page took 0.025813 seconds and 5 git commands to generate.