X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fdefaults.cpp;fp=src%2Fcommon%2Fdefaults.cpp;h=05a8b9cfa0baa4febfa5015621bc13a62e9135d7;hp=d79e42a6b63b5a35490f42798412b98c68417d59;hb=28ab034a2c3582d07d3423d2d746731f87d3969f;hpb=52e345b9ac912d033c2a2c25a170a01cf209839d diff --git a/src/common/defaults.cpp b/src/common/defaults.cpp index d79e42a6b..05a8b9cfa 100644 --- a/src/common/defaults.cpp +++ b/src/common/defaults.cpp @@ -6,16 +6,16 @@ */ #define _LGPL_SOURCE -#include -#include -#include -#include -#include -#include - #include "defaults.hpp" -#include "macros.hpp" #include "error.hpp" +#include "macros.hpp" + +#include +#include +#include +#include +#include +#include static int pthread_attr_init_done; static pthread_attr_t tattr; @@ -90,16 +90,15 @@ static void __attribute__((constructor)) init_default_pthread_attr(void) goto error_destroy; } DBG("Stack size limits: soft %lld, hard %lld bytes", - (long long) rlim.rlim_cur, - (long long) rlim.rlim_max); + (long long) rlim.rlim_cur, + (long long) rlim.rlim_max); /* * getrlimit() may return a stack size of "-1", meaning "unlimited". * In this case, we impose a known-good default minimum value which will * override the libc's default stack size if it is smaller. */ - system_ss = rlim.rlim_cur != -1 ? rlim.rlim_cur : - DEFAULT_LTTNG_THREAD_STACK_SIZE; + system_ss = rlim.rlim_cur != -1 ? rlim.rlim_cur : DEFAULT_LTTNG_THREAD_STACK_SIZE; /* Get pthread default thread stack size. */ ret = pthread_attr_getstacksize(&tattr, &pthread_ss); @@ -112,13 +111,14 @@ static void __attribute__((constructor)) init_default_pthread_attr(void) selected_ss = std::max(pthread_ss, system_ss); if (selected_ss < DEFAULT_LTTNG_THREAD_STACK_SIZE) { DBG("Default stack size is too small, setting it to %zu bytes", - (size_t) DEFAULT_LTTNG_THREAD_STACK_SIZE); + (size_t) DEFAULT_LTTNG_THREAD_STACK_SIZE); selected_ss = DEFAULT_LTTNG_THREAD_STACK_SIZE; } if (rlim.rlim_max > 0 && selected_ss > rlim.rlim_max) { WARN("Your system's stack size restrictions (%zu bytes) may be too low for the LTTng daemons to function properly, please set the stack size limit to at least %zu bytes to ensure reliable operation", - (size_t) rlim.rlim_max, (size_t) DEFAULT_LTTNG_THREAD_STACK_SIZE); + (size_t) rlim.rlim_max, + (size_t) DEFAULT_LTTNG_THREAD_STACK_SIZE); selected_ss = (size_t) rlim.rlim_max; }