X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fdefaults.h;h=27f1ddc82a66524afeef8250d50c2f0dfefa72c7;hb=f0b03c2289d0f84c1e2dc41be70cd0bcc222e181;hp=f05030766a77be8dae7452e4fdaae94205378d79;hpb=8d5841ea483139d3ab2f2b4dd39263dad63832b1;p=lttng-tools.git diff --git a/src/common/defaults.h b/src/common/defaults.h index f05030766..27f1ddc82 100644 --- a/src/common/defaults.h +++ b/src/common/defaults.h @@ -309,6 +309,9 @@ /* Default LTTng MI XML namespace. */ #define DEFAULT_LTTNG_MI_NAMESPACE "http://lttng.org/xml/ns/lttng-mi" +/* Default thread stack size; the default mandated by pthread_create(3) */ +#define DEFAULT_LTTNG_THREAD_STACK_SIZE 2097152 + /* * Returns the default subbuf size. * @@ -354,4 +357,16 @@ size_t default_get_ust_pid_channel_subbuf_size(void); LTTNG_HIDDEN size_t default_get_ust_uid_channel_subbuf_size(void); +/* + * Get the default pthread_attr to use on thread creation. + * + * Some libc, such as musl, don't honor the limit set for the stack size and use + * their own empirically chosen static value. This function checks if the + * current stack size is smaller than the stack size limit and if so returns a + * pthread_attr_t pointer where the thread stack size is set to the soft stack + * size limit. + */ +LTTNG_HIDDEN +pthread_attr_t *default_pthread_attr(void); + #endif /* _DEFAULTS_H */