From 9ad42ec1800b074488873ec43d91c73ce9c9dfcf Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 26 Jan 2014 23:01:06 -0500 Subject: [PATCH] sessiond: add missing testpoints Signed-off-by: Mathieu Desnoyers --- src/bin/lttng-sessiond/ht-cleanup.c | 6 ++++++ src/bin/lttng-sessiond/main.c | 14 +++++++++----- src/bin/lttng-sessiond/testpoint.h | 3 +++ src/bin/lttng-sessiond/ust-thread.c | 6 ++++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/bin/lttng-sessiond/ht-cleanup.c b/src/bin/lttng-sessiond/ht-cleanup.c index 48b0be6e4..a201506c0 100644 --- a/src/bin/lttng-sessiond/ht-cleanup.c +++ b/src/bin/lttng-sessiond/ht-cleanup.c @@ -24,6 +24,7 @@ #include "lttng-sessiond.h" #include "health-sessiond.h" +#include "testpoint.h" void *thread_ht_cleanup(void *data) { @@ -39,6 +40,10 @@ void *thread_ht_cleanup(void *data) health_register(health_sessiond, HEALTH_SESSIOND_TYPE_HT_CLEANUP); + if (testpoint(sessiond_thread_ht_cleanup)) { + goto error_testpoint; + } + health_code_update(); ret = sessiond_set_thread_pollset(&events, 2); @@ -125,6 +130,7 @@ exit: error: lttng_poll_clean(&events); error_poll_create: +error_testpoint: utils_close_pipe(ht_cleanup_pipe); ht_cleanup_pipe[0] = ht_cleanup_pipe[1] = -1; DBG("[ust-thread] cleanup complete."); diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 37c7354ef..c3f564dce 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -1630,6 +1630,10 @@ static void *thread_dispatch_ust_registration(void *data) health_register(health_sessiond, HEALTH_SESSIOND_TYPE_APP_REG_DISPATCH); + if (testpoint(sessiond_thread_app_reg_dispatch)) { + goto error_testpoint; + } + health_code_update(); CDS_INIT_LIST_HEAD(&wait_queue.head); @@ -1834,6 +1838,7 @@ error: free(wait_node); } +error_testpoint: DBG("Dispatch thread dying"); if (err) { health_error(); @@ -2022,11 +2027,6 @@ static void *thread_registration_apps(void *data) exit: error: - if (err) { - health_error(); - ERR("Health error occurred in %s", __func__); - } - /* Notify that the registration thread is gone */ notify_ust_apps(0); @@ -2051,6 +2051,10 @@ error_listen: error_create_poll: error_testpoint: DBG("UST Registration thread cleanup complete"); + if (err) { + health_error(); + ERR("Health error occurred in %s", __func__); + } health_unregister(health_sessiond); return NULL; diff --git a/src/bin/lttng-sessiond/testpoint.h b/src/bin/lttng-sessiond/testpoint.h index 623b061f8..f213e431d 100644 --- a/src/bin/lttng-sessiond/testpoint.h +++ b/src/bin/lttng-sessiond/testpoint.h @@ -29,5 +29,8 @@ TESTPOINT_DECL(sessiond_thread_manage_apps_before_loop); TESTPOINT_DECL(sessiond_thread_manage_kernel); TESTPOINT_DECL(sessiond_thread_manage_kernel_before_loop); TESTPOINT_DECL(sessiond_thread_manage_consumer); +TESTPOINT_DECL(sessiond_thread_ht_cleanup); +TESTPOINT_DECL(sessiond_thread_app_manage_notify); +TESTPOINT_DECL(sessiond_thread_app_reg_dispatch); #endif /* SESSIOND_TESTPOINT_H */ diff --git a/src/bin/lttng-sessiond/ust-thread.c b/src/bin/lttng-sessiond/ust-thread.c index 0248d7a0a..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. @@ -43,6 +44,10 @@ void *ust_thread_manage_notify(void *data) health_register(health_sessiond, HEALTH_SESSIOND_TYPE_APP_MANAGE_NOTIFY); + if (testpoint(sessiond_thread_app_manage_notify)) { + goto error_testpoint; + } + health_code_update(); ret = sessiond_set_thread_pollset(&events, 2); @@ -170,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"); -- 2.34.1