static pthread_mutex_t ust_mutex = PTHREAD_MUTEX_INITIALIZER;
/* Allow nesting the ust_mutex within the same thread. */
-static DEFINE_URCU_TLS(int, ust_mutex_nest);
+static DEFINE_URCU_TLS_IE(int, ust_mutex_nest);
/*
* ust_exit_mutex protects thread_active variable wrt thread exit. It
{
const char *val;
- val = (const char *) lttng_secure_getenv("LTTNG_HOME");
+ val = (const char *) lttng_getenv("LTTNG_HOME");
if (val != NULL) {
return val;
}
- return (const char *) lttng_secure_getenv("HOME");
+ return (const char *) lttng_getenv("HOME");
}
/*
long constructor_delay_ms = LTTNG_UST_DEFAULT_CONSTRUCTOR_TIMEOUT_MS;
if (!got_timeout_env) {
- str_timeout = getenv("LTTNG_UST_REGISTER_TIMEOUT");
+ str_timeout = lttng_getenv("LTTNG_UST_REGISTER_TIMEOUT");
got_timeout_env = 1;
}
if (str_timeout)
}
static
-void get_blocking_retry_timeout(void)
+void get_allow_blocking(void)
{
- const char *str_blocking_retry_timeout =
- lttng_secure_getenv("LTTNG_UST_BLOCKING_RETRY_TIMEOUT");
-
- if (str_blocking_retry_timeout) {
- long timeout = strtol(str_blocking_retry_timeout, NULL, 10);
-
- if (timeout < 0)
- timeout = -1;
- if (timeout > INT_MAX) {
- WARN("Saturating %s value from %ld to %d\n",
- "LTTNG_UST_BLOCKING_RETRY_TIMEOUT",
- timeout, INT_MAX);
- timeout = INT_MAX;
- }
- DBG("%s environment variable value is %ld",
- "LTTNG_UST_BLOCKING_RETRY_TIMEOUT",
- timeout);
- lttng_ust_ringbuffer_set_retry_timeout(timeout);
+ const char *str_allow_blocking =
+ lttng_getenv("LTTNG_UST_ALLOW_BLOCKING");
+
+ if (str_allow_blocking) {
+ DBG("%s environment variable is set",
+ "LTTNG_UST_ALLOW_BLOCKING");
+ lttng_ust_ringbuffer_set_allow_blocking();
}
}
* sessiond before the init functions are completed).
*/
init_usterr();
+ lttng_ust_getenv_init(); /* Needs init_usterr() to be completed. */
init_tracepoint();
lttng_ust_init_fd_tracker();
lttng_ust_clock_init();
timeout_mode = get_constructor_timeout(&constructor_timeout);
- get_blocking_retry_timeout();
+ get_allow_blocking();
ret = sem_init(&constructor_wait, 0, 0);
if (ret) {