Clean-up: run format-cpp on the tree The original re-format commit missed a number of files that were caught by format-cpp. Hopefully this is the last large reformat commit for a while. Change-Id: I493ee6d9fe6187e0bd087c68ed346af69c929c1e Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib: compile liblttng-ctl as C++ Same as the previous commits, but compile the liblttng-ctl library as C++ code (while still offering a C interface). Some exported global variables (for example in deprecated-symbols.cpp) have to be made non-const, otherwise we get: CXX deprecated-symbols.lo /home/simark/src/lttng-tools/src/lib/lttng-ctl/deprecated-symbols.cpp:21:33: error: ‘visibility’ attribute ignored [-Werror=attributes] 21 | LTTNG_EXPORT const char * const config_element_pid_tracker; | ^~~~~~~~~~~~~~~~~~~~~~~~~~ I think this is related to the fact that const global variables automatically have internal linkage in C++. Despite using -export-symbols in src/lib/lttng-ctl/Makefile.am, some new ELF symbols become exposed. It could be related to this, in the ld man page: --retain-symbols-file does not discard undefined symbols, or symbols needed for relocations. One new symbol I see, for example, is `_Z16connect_sessiondv`. Looking at liblttng-ctl.so, I indeed see a relocation for this symbol: 000000000010b778 0000053e00000007 R_X86_64_JUMP_SLOT 00000000000314a2 _Z16connect_sessiondv + 0 And that would explain why the linker keeps that symbol visible. This is related to the entry for this function in the procedure linkage table. I'm not entirely sure why these functions didn't generate a PLT entry in C, but do in C++. To avoid these new symbols, build everything with -fvisibility=hidden and -fvisibility-inlines-hidden, and tag functions we really want to export with LTTNG_EXPORT, a new macro defined to __attribute__((visibility("default"))). This macro is publicly visible, because it has to be used in distributed header files (although it's of no use for users of liblttng-ctl). Change-Id: Ie51bf0a2edfb87e5f46f9c39eed5309d9f8c41d6 Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
action: Mark parameter of lttng_action_get_type as const Remove lttng_action_get_type_const as it is no longer needed. Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Change-Id: I1525bc2c89eb37ab3e75d915c6ff50bd2a7f5d21
actions: introduce action group This patch introduces action groups as a new kind of action. When creating a trigger, it is only possible to attach a single action. Action groups allow users to attach more than one action. A group is created using lttng_action_group_create. Actions are added to it using lttng_action_group_add_action. The group can then be used in a trigger, like any other action. The operations required to be implemented by actions (serialize, create_from_buffer, validate) are implemented by executing the operation on all elements. Current limitations are: - To avoid any cycle, it is not possible to add a group inside a group. Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Change-Id: I2ae6aed21d9a6b45510d37a435773b1bd7d76528
actions: introduce snapshot session action This patch introduces the API for the "snapshot session" action. A snapshot session action is created using the lttng_action_snapshot_session_create function. It is mandatory to set a session name using lttng_action_snapshot_session_set_session_name before using the action in a trigger. It is possible, but optional, to provide a snapshot name with lttng_action_snapshot_session_set_snapshot_name. 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: I2b76680d44bf69eb705f2a238fffef2519b82534 Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
actions: introduce rotate session action This patch introduces the API for the "rotate session" action. A rotate session action is created using the lttng_action_rotate_session_create function. It is mandatory to set a session name using lttng_action_rotate_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: I8ed1a71a00deaa6abafaff703a8980c2c7598bda Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
actions: introduce stop session action This patch introduces the API for the "stop session" action. A stop session action is created using the lttng_action_stop_session_create function. It is mandatory to set a session name using lttng_action_stop_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: Ie00d744340f85f15a333680cf86d3882bd612d1a Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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>
Move to kernel style SPDX license identifiers The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. See https://spdx.org/ids-how for details. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Change-Id: I62e7038e191a061286abcef5550b58f5ee67149d Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>