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
9 #include <lttng/lttng-export.h>
19 * Check if the specified environment variable is set.
20 * Return 1 if set, otherwise 0.
23 int check_env_var(const char *env
)
26 char *env_val
= getenv(env
);
27 if (env_val
&& (strncmp(env_val
, "1", 1) == 0)) {
38 unsigned int sleep_time
= STALL_TIME
;
40 while (sleep_time
> 0) {
41 sleep_time
= sleep(sleep_time
);
47 LTTNG_EXPORT
int __testpoint_sessiond_thread_manage_clients(void);
48 int __testpoint_sessiond_thread_manage_clients(void)
50 const char *var
= "LTTNG_SESSIOND_THREAD_MANAGE_CLIENTS_STALL";
52 if (check_env_var(var
)) {
59 LTTNG_EXPORT
int __testpoint_sessiond_thread_registration_apps(void);
60 int __testpoint_sessiond_thread_registration_apps(void)
62 const char *var
= "LTTNG_SESSIOND_THREAD_REG_APPS_STALL";
64 if (check_env_var(var
)) {
71 LTTNG_EXPORT
int __testpoint_sessiond_thread_manage_apps(void);
72 int __testpoint_sessiond_thread_manage_apps(void)
74 const char *var
= "LTTNG_SESSIOND_THREAD_MANAGE_APPS_STALL";
76 if (check_env_var(var
)) {
83 LTTNG_EXPORT
int __testpoint_sessiond_thread_manage_kernel(void);
84 int __testpoint_sessiond_thread_manage_kernel(void)
86 const char *var
= "LTTNG_SESSIOND_THREAD_MANAGE_KERNEL_STALL";
88 if (check_env_var(var
)) {
95 LTTNG_EXPORT
int __testpoint_sessiond_thread_manage_consumer(void);
96 int __testpoint_sessiond_thread_manage_consumer(void)
98 const char *var
= "LTTNG_SESSIOND_THREAD_MANAGE_CONSUMER_STALL";
100 if (check_env_var(var
)) {
107 LTTNG_EXPORT
int __testpoint_sessiond_thread_app_manage_notify(void);
108 int __testpoint_sessiond_thread_app_manage_notify(void)
110 const char *var
= "LTTNG_SESSIOND_THREAD_APP_MANAGE_NOTIFY_STALL";
112 if (check_env_var(var
)) {
119 LTTNG_EXPORT
int __testpoint_sessiond_thread_app_reg_dispatch(void);
120 int __testpoint_sessiond_thread_app_reg_dispatch(void)
122 const char *var
= "LTTNG_SESSIOND_THREAD_APP_REG_DISPATCH_STALL";
124 if (check_env_var(var
)) {
131 /* Consumer daemon */
133 LTTNG_EXPORT
int __testpoint_consumerd_thread_channel(void);
134 int __testpoint_consumerd_thread_channel(void)
136 const char *var
= "LTTNG_CONSUMERD_THREAD_CHANNEL_STALL";
138 if (check_env_var(var
)) {
145 LTTNG_EXPORT
int __testpoint_consumerd_thread_metadata(void);
146 int __testpoint_consumerd_thread_metadata(void)
148 const char *var
= "LTTNG_CONSUMERD_THREAD_METADATA_STALL";
150 if (check_env_var(var
)) {
157 LTTNG_EXPORT
int __testpoint_consumerd_thread_data(void);
158 int __testpoint_consumerd_thread_data(void)
160 const char *var
= "LTTNG_CONSUMERD_THREAD_DATA_STALL";
162 if (check_env_var(var
)) {
169 LTTNG_EXPORT
int __testpoint_consumerd_thread_sessiond(void);
170 int __testpoint_consumerd_thread_sessiond(void)
172 const char *var
= "LTTNG_CONSUMERD_THREAD_SESSIOND_STALL";
174 if (check_env_var(var
)) {
181 LTTNG_EXPORT
int __testpoint_consumerd_thread_metadata_timer(void);
182 int __testpoint_consumerd_thread_metadata_timer(void)
184 const char *var
= "LTTNG_CONSUMERD_THREAD_METADATA_TIMER_STALL";
186 if (check_env_var(var
)) {
195 LTTNG_EXPORT
int __testpoint_relayd_thread_dispatcher(void);
196 int __testpoint_relayd_thread_dispatcher(void)
198 const char *var
= "LTTNG_RELAYD_THREAD_DISPATCHER_STALL";
200 if (check_env_var(var
)) {
207 LTTNG_EXPORT
int __testpoint_relayd_thread_worker(void);
208 int __testpoint_relayd_thread_worker(void)
210 const char *var
= "LTTNG_RELAYD_THREAD_WORKER_STALL";
212 if (check_env_var(var
)) {
219 LTTNG_EXPORT
int __testpoint_relayd_thread_listener(void);
220 int __testpoint_relayd_thread_listener(void)
222 const char *var
= "LTTNG_RELAYD_THREAD_LISTENER_STALL";
224 if (check_env_var(var
)) {
231 LTTNG_EXPORT
int __testpoint_relayd_thread_live_dispatcher(void);
232 int __testpoint_relayd_thread_live_dispatcher(void)
234 const char *var
= "LTTNG_RELAYD_THREAD_LIVE_DISPATCHER_STALL";
236 if (check_env_var(var
)) {
243 LTTNG_EXPORT
int __testpoint_relayd_thread_live_worker(void);
244 int __testpoint_relayd_thread_live_worker(void)
246 const char *var
= "LTTNG_RELAYD_THREAD_LIVE_WORKER_STALL";
248 if (check_env_var(var
)) {
255 LTTNG_EXPORT
int __testpoint_relayd_thread_live_listener(void);
256 int __testpoint_relayd_thread_live_listener(void)
258 const char *var
= "LTTNG_RELAYD_THREAD_LIVE_LISTENER_STALL";
260 if (check_env_var(var
)) {
This page took 0.036793 seconds and 5 git commands to generate.