X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-thread.c;h=080afa53a692487d2e7bc12f29ae0bee9c932f72;hb=8c93562f396a3e785c5193ca32b40f1f16599a6a;hp=683718326881f8697058d6ce7a896d7b3ad9e292;hpb=8782cc7477fae212607b9fd6395a4b2e2d3357ed;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-thread.c b/src/bin/lttng-sessiond/ust-thread.c index 683718326..080afa53a 100644 --- a/src/bin/lttng-sessiond/ust-thread.c +++ b/src/bin/lttng-sessiond/ust-thread.c @@ -24,6 +24,7 @@ #include "lttng-sessiond.h" #include "ust-thread.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_sessiond, 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");