X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-thread.c;h=080afa53a692487d2e7bc12f29ae0bee9c932f72;hb=8f0044bfed9f5ca51eab51478f483f92cc8f84a7;hp=67c2971d627ba36e8ec934bf6acf07bdd32a8e8b;hpb=380e8d6f886dfe6633044abfa77739d1210979a3;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-thread.c b/src/bin/lttng-sessiond/ust-thread.c index 67c2971d6..080afa53a 100644 --- a/src/bin/lttng-sessiond/ust-thread.c +++ b/src/bin/lttng-sessiond/ust-thread.c @@ -23,7 +23,8 @@ #include "fd-limit.h" #include "lttng-sessiond.h" #include "ust-thread.h" -#include "health.h" +#include "health-sessiond.h" +#include "testpoint.h" /* * This thread manage application notify communication. @@ -31,6 +32,7 @@ void *ust_thread_manage_notify(void *data) { int i, ret, pollfd, err = -1; + ssize_t size_ret; uint32_t revents, nb_fd; struct lttng_poll_event events; @@ -39,7 +41,12 @@ void *ust_thread_manage_notify(void *data) rcu_register_thread(); rcu_thread_online(); - health_register(HEALTH_TYPE_APP_MANAGE_NOTIFY); + health_register(health_sessiond, + HEALTH_SESSIOND_TYPE_APP_MANAGE_NOTIFY); + + if (testpoint(sessiond_thread_app_manage_notify)) { + goto error_testpoint; + } health_code_update(); @@ -104,11 +111,10 @@ restart: goto error; } - do { - /* Get socket from dispatch thread. */ - ret = read(apps_cmd_notify_pipe[0], &sock, sizeof(sock)); - } while (ret < 0 && errno == EINTR); - if (ret < 0 || ret < sizeof(sock)) { + /* Get socket from dispatch thread. */ + size_ret = lttng_read(apps_cmd_notify_pipe[0], + &sock, sizeof(sock)); + if (size_ret < sizeof(sock)) { PERROR("read apps notify pipe"); goto error; } @@ -169,6 +175,7 @@ exit: error: lttng_poll_clean(&events); error_poll_create: +error_testpoint: utils_close_pipe(apps_cmd_notify_pipe); apps_cmd_notify_pipe[0] = apps_cmd_notify_pipe[1] = -1; DBG("Application notify communication apps thread cleanup complete"); @@ -176,7 +183,7 @@ error_poll_create: health_error(); ERR("Health error occurred in %s", __func__); } - health_unregister(); + health_unregister(health_sessiond); rcu_thread_offline(); rcu_unregister_thread(); return NULL;