X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Ferror.c;h=e03bee350d0e2c07bf0b7cb56f4463492ba0ec12;hp=82190b9fd527cea831f61e9620b43f73d1984c17;hb=7c1f6da21f4d46d9c834820a2b26f0634c7365a9;hpb=f5fb86c1254b785eee8caf87cb996d33eda0ede9 diff --git a/src/common/error.c b/src/common/error.c index 82190b9fd..e03bee350 100644 --- a/src/common/error.c +++ b/src/common/error.c @@ -7,13 +7,14 @@ #define _LGPL_SOURCE #include -#include #include #include #include #include #include +#include +#include #include #include @@ -77,16 +78,9 @@ void logger_set_thread_name(const char *name, bool set_pthread_name) 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"); } } @@ -245,6 +239,8 @@ static const char *error_string_array[] = { [ 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_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD) ] = "Failed to create an event notifier group notification file descriptor", + [ ERROR_INDEX(LTTNG_ERR_INVALID_CAPTURE_EXPRESSION) ] = "Invalid capture expression", /* Last element */ [ ERROR_INDEX(LTTNG_ERR_NR) ] = "Unknown error code"