SoW-2019-0002: Dynamic Snapshot
[lttng-tools.git] / tests / regression / tools / health / health_exit.c
index 8e414053e9d961867acc2b075ec8f1df6342af9f..6d04c9da7e83af2fd1030333e092716f663bb6a8 100644 (file)
@@ -1,28 +1,21 @@
 /*
- * Copyright (C) 2012 - Christian Babeux <christian.babeux@efficios.com>
+ * Copyright (C) 2012 Christian Babeux <christian.babeux@efficios.com>
+ * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License, version 2 only, as
- * published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <stdlib.h>
 #include <string.h>
 #include <pthread.h>
+#include <urcu.h>
 
 /*
  * Check if the specified environment variable is set.
  * Return 1 if set, otherwise 0.
  */
+static
 int check_env_var(const char *env)
 {
        if (env) {
@@ -35,20 +28,205 @@ int check_env_var(const char *env)
        return 0;
 }
 
-int __testpoint_thread_manage_clients(void)
+/* Session daemon */
+
+int __testpoint_sessiond_thread_manage_clients(void);
+int __testpoint_sessiond_thread_manage_clients(void)
+{
+       const char *var = "LTTNG_SESSIOND_THREAD_MANAGE_CLIENTS_EXIT";
+
+       if (check_env_var(var)) {
+               rcu_unregister_thread();
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_sessiond_thread_registration_apps(void);
+int __testpoint_sessiond_thread_registration_apps(void)
+{
+       const char *var = "LTTNG_SESSIOND_THREAD_REG_APPS_EXIT";
+
+       if (check_env_var(var)) {
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_sessiond_thread_manage_apps(void);
+int __testpoint_sessiond_thread_manage_apps(void)
+{
+       const char *var = "LTTNG_SESSIOND_THREAD_MANAGE_APPS_EXIT";
+
+       if (check_env_var(var)) {
+               rcu_unregister_thread();
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_sessiond_thread_manage_kernel(void);
+int __testpoint_sessiond_thread_manage_kernel(void)
+{
+       const char *var = "LTTNG_SESSIOND_THREAD_MANAGE_KERNEL_EXIT";
+
+       if (check_env_var(var)) {
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_sessiond_thread_manage_consumer(void);
+int __testpoint_sessiond_thread_manage_consumer(void)
+{
+       const char *var = "LTTNG_SESSIOND_THREAD_MANAGE_CONSUMER_EXIT";
+
+       if (check_env_var(var)) {
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_sessiond_thread_ht_cleanup(void);
+int __testpoint_sessiond_thread_ht_cleanup(void)
+{
+       const char *var = "LTTNG_SESSIOND_THREAD_HT_CLEANUP_EXIT";
+
+       if (check_env_var(var)) {
+               rcu_unregister_thread();
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_sessiond_thread_app_manage_notify(void);
+int __testpoint_sessiond_thread_app_manage_notify(void)
+{
+       const char *var = "LTTNG_SESSIOND_THREAD_APP_MANAGE_NOTIFY_EXIT";
+
+       if (check_env_var(var)) {
+               rcu_unregister_thread();
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_sessiond_thread_app_reg_dispatch(void);
+int __testpoint_sessiond_thread_app_reg_dispatch(void)
+{
+       const char *var = "LTTNG_SESSIOND_THREAD_APP_REG_DISPATCH_EXIT";
+
+       if (check_env_var(var)) {
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+/* Consumer daemon */
+
+int __testpoint_consumerd_thread_channel(void);
+int __testpoint_consumerd_thread_channel(void)
+{
+       const char *var = "LTTNG_CONSUMERD_THREAD_CHANNEL_EXIT";
+
+       if (check_env_var(var)) {
+               rcu_unregister_thread();
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_consumerd_thread_metadata(void);
+int __testpoint_consumerd_thread_metadata(void)
+{
+       const char *var = "LTTNG_CONSUMERD_THREAD_METADATA_EXIT";
+
+       if (check_env_var(var)) {
+               rcu_unregister_thread();
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_consumerd_thread_data(void);
+int __testpoint_consumerd_thread_data(void)
+{
+       const char *var = "LTTNG_CONSUMERD_THREAD_DATA_EXIT";
+
+       if (check_env_var(var)) {
+               rcu_unregister_thread();
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_consumerd_thread_sessiond(void);
+int __testpoint_consumerd_thread_sessiond(void)
+{
+       const char *var = "LTTNG_CONSUMERD_THREAD_SESSIOND_EXIT";
+
+       if (check_env_var(var)) {
+               rcu_unregister_thread();
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_consumerd_thread_metadata_timer(void);
+int __testpoint_consumerd_thread_metadata_timer(void)
+{
+       const char *var = "LTTNG_CONSUMERD_THREAD_METADATA_TIMER_EXIT";
+
+       if (check_env_var(var)) {
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+/* Relay daemon */
+
+int __testpoint_relayd_thread_dispatcher(void);
+int __testpoint_relayd_thread_dispatcher(void)
+{
+       const char *var = "LTTNG_RELAYD_THREAD_DISPATCHER_EXIT";
+
+       if (check_env_var(var)) {
+               pthread_exit(NULL);
+       }
+
+       return 0;
+}
+
+int __testpoint_relayd_thread_worker(void);
+int __testpoint_relayd_thread_worker(void)
 {
-       const char *var = "LTTNG_THREAD_MANAGE_CLIENTS_EXIT";
+       const char *var = "LTTNG_RELAYD_THREAD_WORKER_EXIT";
 
        if (check_env_var(var)) {
+               rcu_unregister_thread();
                pthread_exit(NULL);
        }
 
        return 0;
 }
 
-int __testpoint_thread_registration_apps(void)
+int __testpoint_relayd_thread_listener(void);
+int __testpoint_relayd_thread_listener(void)
 {
-       const char *var = "LTTNG_THREAD_REG_APPS_EXIT";
+       const char *var = "LTTNG_RELAYD_THREAD_LISTENER_EXIT";
 
        if (check_env_var(var)) {
                pthread_exit(NULL);
@@ -57,9 +235,10 @@ int __testpoint_thread_registration_apps(void)
        return 0;
 }
 
-int __testpoint_thread_manage_apps(void)
+int __testpoint_relayd_thread_live_dispatcher(void);
+int __testpoint_relayd_thread_live_dispatcher(void)
 {
-       const char *var = "LTTNG_THREAD_MANAGE_APPS_EXIT";
+       const char *var = "LTTNG_RELAYD_THREAD_LIVE_DISPATCHER_EXIT";
 
        if (check_env_var(var)) {
                pthread_exit(NULL);
@@ -68,20 +247,23 @@ int __testpoint_thread_manage_apps(void)
        return 0;
 }
 
-int __testpoint_thread_manage_kernel(void)
+int __testpoint_relayd_thread_live_worker(void);
+int __testpoint_relayd_thread_live_worker(void)
 {
-       const char *var = "LTTNG_THREAD_MANAGE_KERNEL_EXIT";
+       const char *var = "LTTNG_RELAYD_THREAD_LIVE_WORKER_EXIT";
 
        if (check_env_var(var)) {
+               rcu_unregister_thread();
                pthread_exit(NULL);
        }
 
        return 0;
 }
 
-int __testpoint_thread_manage_consumer(void)
+int __testpoint_relayd_thread_live_listener(void);
+int __testpoint_relayd_thread_live_listener(void)
 {
-       const char *var = "LTTNG_THREAD_MANAGE_CONSUMER_EXIT";
+       const char *var = "LTTNG_RELAYD_THREAD_LIVE_LISTENER_EXIT";
 
        if (check_env_var(var)) {
                pthread_exit(NULL);
This page took 0.038507 seconds and 5 git commands to generate.