Cleanup: always use sysconf to get the page size Use 'sysconf(_SC_PAGE_SIZE)' across the code base which is works on all our supported platforms. Change-Id: I4231d45e0b03301de1274c0a5a4903cd17b4a80a Signed-off-by: Michael Jeanson <mjeanson@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>
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>
Fix: handle negative (unlimited) system stack size limits This also changes the stack size selection policy to select the largest of: 1) default pthread stack size (dictated by libc) 2) system soft limit 3) 2 MB This is bounded by the system's hard limit on stack size. If this limit is smaller than 2 MB, the default size mentionned in pthread_create(3) for Linux, we warn the user that the daemons may be unreliable and advise bumping this limit. Note that is is most likely possible to operate the daemons with way less than 2MB of stack space. However, this was not extensively tested. Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: Set thread stack size to ulimit soft value Some libc don't honor the limit set for the stack size and use their own empirically chosen static value. Detect this behavior by checking if the current stack size is smally than the soft limit and in that case set the pthread stack size to soft limit value. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: define _LGPL_SOURCE in C files Defining this in headers is a bad practice, since the header is not necessarily the first in the include list. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: split UST per UID/PID default values The default per UID subbuffer size are changed from 4096 bytes to 131072 bytes (128k). The rest have the same values as before. Some DEFAULT_CHANNEL_* macros are prefixed with an underscore making sure they are not used elsewhere in the code base and only domain specific values are used. Fixes #524 Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Add default subbuf sizes getter functions This patch adds functions to retrieve defaults subbuf sizes. It uses the DEFAULT_*_SUBBUF_SIZE defines from defaults.h but also make sure that the values are at least as big as the page size. The functions are defined as static inline in defaults.h. Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca> Signed-off-by: David Goulet <dgoulet@efficios.com>