From: Jérémie Galarneau Date: Wed, 10 Jun 2020 19:39:47 +0000 (-0400) Subject: liblttng-ctl: use lttng_payload for serialize/create_from_buffer X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=c0a66c84b5b2484b75798aec7543b680b4d4ab6c;hp=c0a66c84b5b2484b75798aec7543b680b4d4ab6c liblttng-ctl: use lttng_payload for serialize/create_from_buffer 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 Change-Id: Id378d8b5a3376a074ab138a60733377e39a24133 ---