projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add return code to the testpoint mechanism
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
main.c
diff --git
a/src/bin/lttng-sessiond/main.c
b/src/bin/lttng-sessiond/main.c
index cc93da881906fb459b4199e7625aef279928c8db..7e9f9dc643b3c3f97fa52f261f47f14c11bff9a7 100644
(file)
--- a/
src/bin/lttng-sessiond/main.c
+++ b/
src/bin/lttng-sessiond/main.c
@@
-689,14
+689,14
@@
static void *thread_manage_kernel(void *data)
char tmp;
struct lttng_poll_event events;
char tmp;
struct lttng_poll_event events;
- DBG("Thread manage kernel started");
+ DBG("
[thread]
Thread manage kernel started");
- testpoint(thread_manage_kernel);
+ if (testpoint(thread_manage_kernel)) {
+ goto error_testpoint;
+ }
health_code_update(&health_thread_kernel);
health_code_update(&health_thread_kernel);
- testpoint(thread_manage_kernel_before_loop);
-
ret = create_thread_poll_set(&events, 2);
if (ret < 0) {
goto error_poll_create;
ret = create_thread_poll_set(&events, 2);
if (ret < 0) {
goto error_poll_create;
@@
-707,6
+707,10
@@
static void *thread_manage_kernel(void *data)
goto error;
}
goto error;
}
+ if (testpoint(thread_manage_kernel_before_loop)) {
+ goto error;
+ }
+
while (1) {
health_code_update(&health_thread_kernel);
while (1) {
health_code_update(&health_thread_kernel);
@@
-794,6
+798,7
@@
exit:
error:
lttng_poll_clean(&events);
error_poll_create:
error:
lttng_poll_clean(&events);
error_poll_create:
+error_testpoint:
utils_close_pipe(kernel_poll_pipe);
kernel_poll_pipe[0] = kernel_poll_pipe[1] = -1;
if (err) {
utils_close_pipe(kernel_poll_pipe);
kernel_poll_pipe[0] = kernel_poll_pipe[1] = -1;
if (err) {
@@
-889,7
+894,9
@@
static void *thread_manage_consumer(void *data)
restart:
health_poll_update(&consumer_data->health);
restart:
health_poll_update(&consumer_data->health);
- testpoint(thread_manage_consumer);
+ if (testpoint(thread_manage_consumer)) {
+ goto error;
+ }
ret = lttng_poll_wait(&events, -1);
health_poll_update(&consumer_data->health);
ret = lttng_poll_wait(&events, -1);
health_poll_update(&consumer_data->health);
@@
-1093,11
+1100,13
@@
static void *thread_manage_apps(void *data)
DBG("[thread] Manage application started");
DBG("[thread] Manage application started");
- testpoint(thread_manage_apps);
-
rcu_register_thread();
rcu_thread_online();
rcu_register_thread();
rcu_thread_online();
+ if (testpoint(thread_manage_apps)) {
+ goto error_testpoint;
+ }
+
health_code_update(&health_thread_app_manage);
ret = create_thread_poll_set(&events, 2);
health_code_update(&health_thread_app_manage);
ret = create_thread_poll_set(&events, 2);
@@
-1110,7
+1119,9
@@
static void *thread_manage_apps(void *data)
goto error;
}
goto error;
}
- testpoint(thread_manage_apps_before_loop);
+ if (testpoint(thread_manage_apps_before_loop)) {
+ goto error;
+ }
health_code_update(&health_thread_app_manage);
health_code_update(&health_thread_app_manage);
@@
-1250,6
+1261,7
@@
exit:
error:
lttng_poll_clean(&events);
error_poll_create:
error:
lttng_poll_clean(&events);
error_poll_create:
+error_testpoint:
utils_close_pipe(apps_cmd_pipe);
apps_cmd_pipe[0] = apps_cmd_pipe[1] = -1;
utils_close_pipe(apps_cmd_pipe);
apps_cmd_pipe[0] = apps_cmd_pipe[1] = -1;
@@
-1358,7
+1370,9
@@
static void *thread_registration_apps(void *data)
DBG("[thread] Manage application registration started");
DBG("[thread] Manage application registration started");
- testpoint(thread_registration_apps);
+ if (testpoint(thread_registration_apps)) {
+ goto error_testpoint;
+ }
ret = lttcomm_listen_unix_sock(apps_sock);
if (ret < 0) {
ret = lttcomm_listen_unix_sock(apps_sock);
if (ret < 0) {
@@
-1536,6
+1550,7
@@
error_poll_add:
lttng_poll_clean(&events);
error_listen:
error_create_poll:
lttng_poll_clean(&events);
error_listen:
error_create_poll:
+error_testpoint:
DBG("UST Registration thread cleanup complete");
health_exit(&health_thread_app_reg);
DBG("UST Registration thread cleanup complete");
health_exit(&health_thread_app_reg);
@@
-3122,10
+3137,12
@@
static void *thread_manage_clients(void *data)
DBG("[thread] Manage client started");
DBG("[thread] Manage client started");
- testpoint(thread_manage_clients);
-
rcu_register_thread();
rcu_register_thread();
+ if (testpoint(thread_manage_clients)) {
+ goto error_testpoint;
+ }
+
health_code_update(&health_thread_cmd);
ret = lttcomm_listen_unix_sock(client_sock);
health_code_update(&health_thread_cmd);
ret = lttcomm_listen_unix_sock(client_sock);
@@
-3155,7
+3172,9
@@
static void *thread_manage_clients(void *data)
kill(ppid, SIGUSR1);
}
kill(ppid, SIGUSR1);
}
- testpoint(thread_manage_clients_before_loop);
+ if (testpoint(thread_manage_clients_before_loop)) {
+ goto error;
+ }
health_code_update(&health_thread_cmd);
health_code_update(&health_thread_cmd);
@@
-3330,6
+3349,7
@@
error:
error_listen:
error_create_poll:
error_listen:
error_create_poll:
+error_testpoint:
unlink(client_unix_sock_path);
if (client_sock >= 0) {
ret = close(client_sock);
unlink(client_unix_sock_path);
if (client_sock >= 0) {
ret = close(client_sock);
This page took
0.026451 seconds
and
5
git commands to generate.