Rename C++ header files to .hpp Rename all C++ header files (include/**/*-internal.h, src/**/*.h except argpar and msgpack, some headers in tests) to have the .hpp extension. Doing so highlights that we include some C++ header files in some test files still compiled as C. This is ok for now, as the files they include don't actually contain C++ code incompatible with C yet, but they could eventually. This is something we can fix later. Change-Id: I8bf326b6b2946a3e26704f3ef3ac5831bbe9bc26 Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
liblttng-ctl: use export list to define exported symbols Symbols are currently exported by default by liblttng-ctl.so (usable by other shared libraries / programs using liblttng-ctl.so), so we must use LTTNG_HIDDEN on all symbols that are meant to be internal to liblttng-ctl.so. Of course, this is easy to forget, so over the years many symbols that were not meant to be exported were exported, and must now stay exported to avoid breaking the ABI. As explained here [1], a better method is to make symbols hidden by default, and mark those we want to be exported as such. I have tried to use this, but when subsequently converting the code to C++, I have noticed that some symbols related to the STL were exported anyway, which is bad. The other alternative, implemented in this patch, is to use an explicit symbol export list [2], using libtool's -export-symbols (which uses the linker's -version-script option). Only the symbols listed here are exported. So, in practice, this patch: - Adds an liblttng-ctl.sym file with the list of exported symbols and adjusts the Makefile to use the -export-symbol option - Removes LTTNG_HIDDEN and all its uses abidiff shows no changes for liblttng-ctl.so between before and after this patch. [1] https://gcc.gnu.org/wiki/Visibility [2] https://www.gnu.org/software/libtool/manual/libtool.html#Link-mode Change-Id: I5d8c558303894b0ad8113c6e52f79a053bb580e1 Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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 <jeremie.galarneau@efficios.com> Change-Id: Id378d8b5a3376a074ab138a60733377e39a24133
actions: introduce start session action This patch introduces the API for the "start session" action. A start session action is created using the lttng_action_start_session_create function. It is mandatory to set a session name using lttng_action_start_session_set_session_name before using the action in a trigger. The patch adds the code for serializing the action and deserializing it on the sessiond side, but not the code for executing it. Change-Id: I90598e25a461ccabcf7dc327aaa73b3d35e203af Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>