2 * Copyright (C) 2012 Christian Babeux <christian.babeux@efficios.com>
3 * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * SPDX-License-Identifier: GPL-2.0-only
18 * Check if the specified environment variable is set.
19 * Return 1 if set, otherwise 0.
22 int check_env_var(const char *env
)
25 char *env_val
= getenv(env
);
26 if (env_val
&& (strncmp(env_val
, "1", 1) == 0)) {
37 unsigned int sleep_time
= STALL_TIME
;
39 while (sleep_time
> 0) {
40 sleep_time
= sleep(sleep_time
);
46 int __testpoint_sessiond_thread_manage_clients(void);
47 int __testpoint_sessiond_thread_manage_clients(void)
49 const char *var
= "LTTNG_SESSIOND_THREAD_MANAGE_CLIENTS_STALL";
51 if (check_env_var(var
)) {
58 int __testpoint_sessiond_thread_registration_apps(void);
59 int __testpoint_sessiond_thread_registration_apps(void)
61 const char *var
= "LTTNG_SESSIOND_THREAD_REG_APPS_STALL";
63 if (check_env_var(var
)) {
70 int __testpoint_sessiond_thread_manage_apps(void);
71 int __testpoint_sessiond_thread_manage_apps(void)
73 const char *var
= "LTTNG_SESSIOND_THREAD_MANAGE_APPS_STALL";
75 if (check_env_var(var
)) {
82 int __testpoint_sessiond_thread_manage_kernel(void);
83 int __testpoint_sessiond_thread_manage_kernel(void)
85 const char *var
= "LTTNG_SESSIOND_THREAD_MANAGE_KERNEL_STALL";
87 if (check_env_var(var
)) {
94 int __testpoint_sessiond_thread_manage_consumer(void);
95 int __testpoint_sessiond_thread_manage_consumer(void)
97 const char *var
= "LTTNG_SESSIOND_THREAD_MANAGE_CONSUMER_STALL";
99 if (check_env_var(var
)) {
106 int __testpoint_sessiond_thread_ht_cleanup(void);
107 int __testpoint_sessiond_thread_ht_cleanup(void)
109 const char *var
= "LTTNG_SESSIOND_THREAD_HT_CLEANUP_STALL";
111 if (check_env_var(var
)) {
118 int __testpoint_sessiond_thread_app_manage_notify(void);
119 int __testpoint_sessiond_thread_app_manage_notify(void)
121 const char *var
= "LTTNG_SESSIOND_THREAD_APP_MANAGE_NOTIFY_STALL";
123 if (check_env_var(var
)) {
130 int __testpoint_sessiond_thread_app_reg_dispatch(void);
131 int __testpoint_sessiond_thread_app_reg_dispatch(void)
133 const char *var
= "LTTNG_SESSIOND_THREAD_APP_REG_DISPATCH_STALL";
135 if (check_env_var(var
)) {
142 /* Consumer daemon */
144 int __testpoint_consumerd_thread_channel(void);
145 int __testpoint_consumerd_thread_channel(void)
147 const char *var
= "LTTNG_CONSUMERD_THREAD_CHANNEL_STALL";
149 if (check_env_var(var
)) {
156 int __testpoint_consumerd_thread_metadata(void);
157 int __testpoint_consumerd_thread_metadata(void)
159 const char *var
= "LTTNG_CONSUMERD_THREAD_METADATA_STALL";
161 if (check_env_var(var
)) {
168 int __testpoint_consumerd_thread_data(void);
169 int __testpoint_consumerd_thread_data(void)
171 const char *var
= "LTTNG_CONSUMERD_THREAD_DATA_STALL";
173 if (check_env_var(var
)) {
180 int __testpoint_consumerd_thread_sessiond(void);
181 int __testpoint_consumerd_thread_sessiond(void)
183 const char *var
= "LTTNG_CONSUMERD_THREAD_SESSIOND_STALL";
185 if (check_env_var(var
)) {
192 int __testpoint_consumerd_thread_metadata_timer(void);
193 int __testpoint_consumerd_thread_metadata_timer(void)
195 const char *var
= "LTTNG_CONSUMERD_THREAD_METADATA_TIMER_STALL";
197 if (check_env_var(var
)) {
206 int __testpoint_relayd_thread_dispatcher(void);
207 int __testpoint_relayd_thread_dispatcher(void)
209 const char *var
= "LTTNG_RELAYD_THREAD_DISPATCHER_STALL";
211 if (check_env_var(var
)) {
218 int __testpoint_relayd_thread_worker(void);
219 int __testpoint_relayd_thread_worker(void)
221 const char *var
= "LTTNG_RELAYD_THREAD_WORKER_STALL";
223 if (check_env_var(var
)) {
230 int __testpoint_relayd_thread_listener(void);
231 int __testpoint_relayd_thread_listener(void)
233 const char *var
= "LTTNG_RELAYD_THREAD_LISTENER_STALL";
235 if (check_env_var(var
)) {
242 int __testpoint_relayd_thread_live_dispatcher(void);
243 int __testpoint_relayd_thread_live_dispatcher(void)
245 const char *var
= "LTTNG_RELAYD_THREAD_LIVE_DISPATCHER_STALL";
247 if (check_env_var(var
)) {
254 int __testpoint_relayd_thread_live_worker(void);
255 int __testpoint_relayd_thread_live_worker(void)
257 const char *var
= "LTTNG_RELAYD_THREAD_LIVE_WORKER_STALL";
259 if (check_env_var(var
)) {
266 int __testpoint_relayd_thread_live_listener(void);
267 int __testpoint_relayd_thread_live_listener(void)
269 const char *var
= "LTTNG_RELAYD_THREAD_LIVE_LISTENER_STALL";
271 if (check_env_var(var
)) {
This page took 0.035073 seconds and 4 git commands to generate.