#include <string.h>
#include <common/common.h>
+#include <common/thread.h>
#include <common/compat/getenv.h>
#include <lttng/lttng-error.h>
URCU_TLS(logger_thread_name) = name;
if (set_pthread_name) {
- char pthread_name[16];
-
- /*
- * Truncations are expected since pthread limits thread names to
- * a generous 16 characters.
- */
- strncpy(pthread_name, name, sizeof(pthread_name));
- pthread_name[sizeof(pthread_name) - 1] = '\0';
- ret = pthread_setname_np(pthread_self(), pthread_name);
- if (ret) {
+ ret = lttng_thread_setname(name);
+ if (ret && ret != -ENOSYS) {
+ /* Don't fail as this is not essential. */
DBG("Failed to set pthread name attribute");
}
}
[ ERROR_INDEX(LTTNG_ERR_GROUP_NOT_FOUND) ] = "Group not found",
[ ERROR_INDEX(LTTNG_ERR_UNSUPPORTED_DOMAIN) ] = "Unsupported domain used",
[ ERROR_INDEX(LTTNG_ERR_PROCESS_ATTR_TRACKER_INVALID_TRACKING_POLICY) ] = "Operation does not apply to the process attribute tracker's tracking policy",
+ [ ERROR_INDEX(LTTNG_ERR_TRIGGER_GROUP_NOTIFICATION_FD) ] = "Failed to create a trigger group notification file descriptor",
+ [ ERROR_INDEX(LTTNG_ERR_TRIGGER_GROUP_ERROR_COUNTER) ] = "Failed to create a trigger group error counter",
+ [ ERROR_INDEX(LTTNG_ERR_TRIGGER_GROUP_ERROR_COUNTER_FULL) ] = "Trigger group error counter full",
/* Last element */
[ ERROR_INDEX(LTTNG_ERR_NR) ] = "Unknown error code"