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>
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>
Dynamic payload for relayd create session command Move away from static constant defined char array. Perform the length check based on constant defined value on reception. Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Use non-blocking recvmsg() for data/ctrl connections of lttng-relayd The relay daemon's use of blocking network I/O can cause severe performance degradation when interacting with unresponsive peers. This patch changes the recvmsg() calls to use the MSG_DONTWAIT flag which makes the call non-blocking. The connection classes are modified to handle the partial reception of buffers. The sendmsg() calls are still blocking, but this is assumed to represent a fairly minimal risk of actually blocking given that the control protocol's replies consist of 4-byte status codes. A similar approach could be used to make the live connections non-blocking as that side may also suffer from the same resiliancy problems. So far, no users have reported this problem so it is not prioritised. Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: Relay daemon ownership and reference counting The ownership and reference counting of the relay daemon is unclear and buggy in many ways. It is the cause of memory corruptions, double-free, leaks, segmentation faults, observed in various conditions. Fix this situation by introducing a clear ownership and reference counting scheme for this daemon. See doc/relayd-architecture.txt for details. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Implement the relayd live features The live-reading feature allows a user to read the trace while it is being recorded. In order to work, this feature requires the trace to be streamed to lttng-relayd. Then, a viewer can connect to the relayd, list the sessions, attach to one, and start reading the data. The live-reading protocol, enforces the viewer to read all the metadata before trying to read the trace, and checks all the streams for new activity at a user-defined rate (configured by the new --live parameter during the session creation). Signed-off-by: Julien Desfossez <jdesfossez@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Relayd add_stream command handle tracefile rotation Extend the relayd_add_stream structure to pass the tracefile_size and tracefile_count parameters required to handle the tracefile rotation. Signed-off-by: Julien Desfossez <jdesfossez@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>