Add declarations for exported functions in health_fail.c
[lttng-tools.git] / tests / regression / tools / health / health_fail.c
1 /*
2 * Copyright (C) 2012 Christian Babeux <christian.babeux@efficios.com>
3 * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 */
8
9 #include <stdlib.h>
10 #include <string.h>
11 #include <pthread.h>
12 #include <urcu.h>
13
14 /*
15 * Check if the specified environment variable is set.
16 * Return 1 if set, otherwise 0.
17 */
18 static
19 int check_env_var(const char *env)
20 {
21 if (env) {
22 char *env_val = getenv(env);
23 if (env_val && (strncmp(env_val, "1", 1) == 0)) {
24 return 1;
25 }
26 }
27
28 return 0;
29 }
30
31 /* Session daemon */
32
33 int __testpoint_sessiond_thread_manage_clients(void);
34 int __testpoint_sessiond_thread_manage_clients(void)
35 {
36 const char *var = "LTTNG_SESSIOND_THREAD_MANAGE_CLIENTS_TP_FAIL";
37
38 if (check_env_var(var)) {
39 return 1;
40 }
41
42 return 0;
43 }
44
45 int __testpoint_sessiond_thread_registration_apps(void);
46 int __testpoint_sessiond_thread_registration_apps(void)
47 {
48 const char *var = "LTTNG_SESSIOND_THREAD_REG_APPS_TP_FAIL";
49
50 if (check_env_var(var)) {
51 return 1;
52 }
53
54 return 0;
55 }
56
57 int __testpoint_sessiond_thread_manage_apps(void);
58 int __testpoint_sessiond_thread_manage_apps(void)
59 {
60 const char *var = "LTTNG_SESSIOND_THREAD_MANAGE_APPS_TP_FAIL";
61
62 if (check_env_var(var)) {
63 return 1;
64 }
65
66 return 0;
67 }
68
69 int __testpoint_sessiond_thread_manage_kernel(void);
70 int __testpoint_sessiond_thread_manage_kernel(void)
71 {
72 const char *var = "LTTNG_SESSIOND_THREAD_MANAGE_KERNEL_TP_FAIL";
73
74 if (check_env_var(var)) {
75 return 1;
76 }
77
78 return 0;
79 }
80
81 int __testpoint_sessiond_thread_manage_consumer(void);
82 int __testpoint_sessiond_thread_manage_consumer(void)
83 {
84 const char *var = "LTTNG_SESSIOND_THREAD_MANAGE_CONSUMER_TP_FAIL";
85
86 if (check_env_var(var)) {
87 return 1;
88 }
89
90 return 0;
91 }
92
93 int __testpoint_sessiond_thread_ht_cleanup(void);
94 int __testpoint_sessiond_thread_ht_cleanup(void)
95 {
96 const char *var = "LTTNG_SESSIOND_THREAD_HT_CLEANUP_TP_FAIL";
97
98 if (check_env_var(var)) {
99 return 1;
100 }
101
102 return 0;
103 }
104
105 int __testpoint_sessiond_thread_app_manage_notify(void);
106 int __testpoint_sessiond_thread_app_manage_notify(void)
107 {
108 const char *var = "LTTNG_SESSIOND_THREAD_APP_MANAGE_NOTIFY_TP_FAIL";
109
110 if (check_env_var(var)) {
111 return 1;
112 }
113
114 return 0;
115 }
116
117 int __testpoint_sessiond_thread_app_reg_dispatch(void);
118 int __testpoint_sessiond_thread_app_reg_dispatch(void)
119 {
120 const char *var = "LTTNG_SESSIOND_THREAD_APP_REG_DISPATCH_TP_FAIL";
121
122 if (check_env_var(var)) {
123 return 1;
124 }
125
126 return 0;
127 }
128
129 /* Consumer daemon */
130
131 int __testpoint_consumerd_thread_channel(void);
132 int __testpoint_consumerd_thread_channel(void)
133 {
134 const char *var = "LTTNG_CONSUMERD_THREAD_CHANNEL_TP_FAIL";
135
136 if (check_env_var(var)) {
137 return 1;
138 }
139
140 return 0;
141 }
142
143 int __testpoint_consumerd_thread_metadata(void);
144 int __testpoint_consumerd_thread_metadata(void)
145 {
146 const char *var = "LTTNG_CONSUMERD_THREAD_METADATA_TP_FAIL";
147
148 if (check_env_var(var)) {
149 return 1;
150 }
151
152 return 0;
153 }
154
155 int __testpoint_consumerd_thread_data(void);
156 int __testpoint_consumerd_thread_data(void)
157 {
158 const char *var = "LTTNG_CONSUMERD_THREAD_DATA_TP_FAIL";
159
160 if (check_env_var(var)) {
161 return 1;
162 }
163
164 return 0;
165 }
166
167 int __testpoint_consumerd_thread_sessiond(void);
168 int __testpoint_consumerd_thread_sessiond(void)
169 {
170 const char *var = "LTTNG_CONSUMERD_THREAD_SESSIOND_TP_FAIL";
171
172 if (check_env_var(var)) {
173 return 1;
174 }
175
176 return 0;
177 }
178
179 int __testpoint_consumerd_thread_metadata_timer(void);
180 int __testpoint_consumerd_thread_metadata_timer(void)
181 {
182 const char *var = "LTTNG_CONSUMERD_THREAD_METADATA_TIMER_TP_FAIL";
183
184 if (check_env_var(var)) {
185 return 1;
186 }
187
188 return 0;
189 }
190
191 /* Relay daemon */
192
193 int __testpoint_relayd_thread_dispatcher(void);
194 int __testpoint_relayd_thread_dispatcher(void)
195 {
196 const char *var = "LTTNG_RELAYD_THREAD_DISPATCHER_TP_FAIL";
197
198 if (check_env_var(var)) {
199 return 1;
200 }
201
202 return 0;
203 }
204
205 int __testpoint_relayd_thread_worker(void);
206 int __testpoint_relayd_thread_worker(void)
207 {
208 const char *var = "LTTNG_RELAYD_THREAD_WORKER_TP_FAIL";
209
210 if (check_env_var(var)) {
211 return 1;
212 }
213
214 return 0;
215 }
216
217 int __testpoint_relayd_thread_listener(void);
218 int __testpoint_relayd_thread_listener(void)
219 {
220 const char *var = "LTTNG_RELAYD_THREAD_LISTENER_TP_FAIL";
221
222 if (check_env_var(var)) {
223 return 1;
224 }
225
226 return 0;
227 }
228
229 int __testpoint_relayd_thread_live_dispatcher(void);
230 int __testpoint_relayd_thread_live_dispatcher(void)
231 {
232 const char *var = "LTTNG_RELAYD_THREAD_LIVE_DISPATCHER_TP_FAIL";
233
234 if (check_env_var(var)) {
235 return 1;
236 }
237
238 return 0;
239 }
240
241 int __testpoint_relayd_thread_live_worker(void);
242 int __testpoint_relayd_thread_live_worker(void)
243 {
244 const char *var = "LTTNG_RELAYD_THREAD_LIVE_WORKER_TP_FAIL";
245
246 if (check_env_var(var)) {
247 return 1;
248 }
249
250 return 0;
251 }
252
253 int __testpoint_relayd_thread_live_listener(void);
254 int __testpoint_relayd_thread_live_listener(void)
255 {
256 const char *var = "LTTNG_RELAYD_THREAD_LIVE_LISTENER_TP_FAIL";
257
258 if (check_env_var(var)) {
259 return 1;
260 }
261
262 return 0;
263 }
This page took 0.049445 seconds and 4 git commands to generate.