Commit | Line | Data |
---|---|---|
2f8f53af DG |
1 | /* |
2 | * Copyright (C) 2013 - Julien Desfossez <jdesfossez@efficios.com> | |
3 | * David Goulet <dgoulet@efficios.com> | |
7591bab1 | 4 | * 2015 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
2f8f53af DG |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License, version 2 only, as | |
8 | * published by the Free Software Foundation. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
13 | * more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License along with | |
16 | * this program; if not, write to the Free Software Foundation, Inc., 51 | |
17 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 | */ | |
19 | ||
6c1c0768 | 20 | #define _LGPL_SOURCE |
2a174661 | 21 | #include <common/common.h> |
c70636a7 | 22 | #include <common/uuid.h> |
a8b66566 JR |
23 | #include <common/time.h> |
24 | #include <common/utils.h> | |
c70636a7 | 25 | #include <common/uuid.h> |
7591bab1 | 26 | #include <urcu/rculist.h> |
2a174661 | 27 | |
d37856b8 JR |
28 | #include <sys/stat.h> |
29 | ||
2a174661 | 30 | #include "ctf-trace.h" |
a620c891 | 31 | #include "lttng-relayd.h" |
2f8f53af | 32 | #include "session.h" |
23c8ff50 | 33 | #include "sessiond-trace-chunks.h" |
a620c891 | 34 | #include "stream.h" |
a0409c33 | 35 | #include <common/defaults.h> |
d37856b8 | 36 | #include "utils.h" |
2a174661 DG |
37 | |
38 | /* Global session id used in the session creation. */ | |
39 | static uint64_t last_relay_session_id; | |
7591bab1 | 40 | static pthread_mutex_t last_relay_session_id_lock = PTHREAD_MUTEX_INITIALIZER; |
2a174661 | 41 | |
a8b66566 | 42 | static int init_session_output_path_group_by_host(struct relay_session *session) |
ecd1a12f MD |
43 | { |
44 | /* | |
45 | * session_directory: | |
46 | * | |
47 | * if base_path is \0' | |
48 | * hostname/session_name | |
49 | * else | |
50 | * hostname/base_path | |
51 | */ | |
52 | char *session_directory = NULL; | |
53 | int ret = 0; | |
54 | ||
55 | if (session->output_path[0] != '\0') { | |
56 | goto end; | |
57 | } | |
58 | /* | |
59 | * If base path is set, it overrides the session name for the | |
60 | * session relative base path. No timestamp is appended if the | |
61 | * base path is overridden. | |
62 | * | |
63 | * If the session name already contains the creation time (e.g. | |
64 | * auto-<timestamp>, don't append yet another timestamp after | |
65 | * the session name in the generated path. | |
66 | * | |
67 | * Otherwise, generate the path with session_name-<timestamp>. | |
68 | */ | |
69 | if (session->base_path[0] != '\0') { | |
70 | ret = asprintf(&session_directory, "%s/%s", session->hostname, | |
71 | session->base_path); | |
72 | } else if (session->session_name_contains_creation_time) { | |
73 | ret = asprintf(&session_directory, "%s/%s", session->hostname, | |
74 | session->session_name); | |
75 | } else { | |
a8b66566 | 76 | char session_creation_datetime[DATETIME_STR_LEN]; |
ecd1a12f | 77 | |
a8b66566 JR |
78 | ret = time_to_datetime_str( |
79 | LTTNG_OPTIONAL_GET(session->creation_time), | |
80 | session_creation_datetime, | |
81 | sizeof(session_creation_datetime)); | |
82 | if (ret) { | |
ecd1a12f MD |
83 | ERR("Failed to format session creation timestamp while initializing session output directory handle"); |
84 | ret = -1; | |
85 | goto end; | |
86 | } | |
a8b66566 | 87 | |
ecd1a12f MD |
88 | ret = asprintf(&session_directory, "%s/%s-%s", |
89 | session->hostname, session->session_name, | |
90 | session_creation_datetime); | |
91 | } | |
92 | if (ret < 0) { | |
93 | PERROR("Failed to format session directory name"); | |
94 | goto end; | |
95 | } | |
96 | ||
97 | if (strlen(session_directory) >= LTTNG_PATH_MAX) { | |
98 | ERR("Session output directory exceeds maximal length"); | |
99 | ret = -1; | |
100 | goto end; | |
101 | } | |
102 | strcpy(session->output_path, session_directory); | |
103 | ret = 0; | |
104 | ||
105 | end: | |
106 | free(session_directory); | |
107 | return ret; | |
108 | } | |
109 | ||
a8b66566 JR |
110 | static int init_session_output_path_group_by_session( |
111 | struct relay_session *session) | |
112 | { | |
113 | /* | |
114 | * session_directory: | |
115 | * | |
116 | * session_name/hostname-creation_time/base_path | |
117 | * | |
118 | * For session name including the datetime, use it as the complete name | |
119 | * since. Do not perform modification on it since the datetime is an | |
120 | * integral part of the name and how a user identify a session. | |
121 | */ | |
122 | int ret = 0; | |
123 | char *session_directory = NULL; | |
124 | char creation_datetime[DATETIME_STR_LEN]; | |
125 | ||
126 | if (session->output_path[0] != '\0') { | |
127 | /* output_path as been generated already */ | |
128 | goto end; | |
129 | } | |
130 | ||
131 | ret = time_to_datetime_str(LTTNG_OPTIONAL_GET(session->creation_time), | |
132 | creation_datetime, sizeof(creation_datetime)); | |
133 | if (ret) { | |
134 | ERR("Failed to format session creation timestamp while initializing session output directory handle"); | |
135 | ret = -1; | |
136 | goto end; | |
137 | } | |
138 | ||
139 | ret = asprintf(&session_directory, "%s/%s-%s%s%s", | |
140 | session->session_name, session->hostname, | |
141 | creation_datetime, | |
142 | session->base_path[0] != '\0' ? "/" : "", | |
143 | session->base_path); | |
144 | if (ret < 0) { | |
145 | PERROR("Failed to format session directory name"); | |
146 | goto end; | |
147 | } | |
148 | ||
149 | if (strlen(session_directory) >= LTTNG_PATH_MAX) { | |
150 | ERR("Session output directory exceeds maximal length"); | |
151 | ret = -1; | |
152 | goto end; | |
153 | } | |
154 | ||
155 | strcpy(session->output_path, session_directory); | |
156 | ret = 0; | |
157 | ||
158 | end: | |
159 | free(session_directory); | |
160 | return ret; | |
161 | } | |
162 | ||
163 | static int init_session_output_path(struct relay_session *session) | |
164 | { | |
165 | int ret; | |
166 | ||
167 | switch (opt_group_output_by) { | |
168 | case RELAYD_GROUP_OUTPUT_BY_HOST: | |
169 | ret = init_session_output_path_group_by_host(session); | |
170 | break; | |
171 | case RELAYD_GROUP_OUTPUT_BY_SESSION: | |
172 | ret = init_session_output_path_group_by_session(session); | |
173 | break; | |
174 | case RELAYD_GROUP_OUTPUT_BY_UNKNOWN: | |
175 | default: | |
176 | abort(); | |
177 | break; | |
178 | } | |
179 | ||
180 | return ret; | |
181 | } | |
182 | ||
1e791a74 JG |
183 | static int session_set_anonymous_chunk(struct relay_session *session) |
184 | { | |
185 | int ret = 0; | |
186 | struct lttng_trace_chunk *chunk = NULL; | |
187 | enum lttng_trace_chunk_status status; | |
cbf53d23 | 188 | struct lttng_directory_handle *output_directory; |
1e791a74 | 189 | |
cbf53d23 JG |
190 | output_directory = session_create_output_directory_handle(session); |
191 | if (!output_directory) { | |
1e791a74 JG |
192 | goto end; |
193 | } | |
194 | ||
195 | chunk = lttng_trace_chunk_create_anonymous(); | |
196 | if (!chunk) { | |
197 | goto end; | |
198 | } | |
199 | ||
200 | status = lttng_trace_chunk_set_credentials_current_user(chunk); | |
201 | if (status != LTTNG_TRACE_CHUNK_STATUS_OK) { | |
202 | ret = -1; | |
203 | goto end; | |
204 | } | |
205 | ||
cbf53d23 | 206 | status = lttng_trace_chunk_set_as_owner(chunk, output_directory); |
1e791a74 JG |
207 | if (status != LTTNG_TRACE_CHUNK_STATUS_OK) { |
208 | ret = -1; | |
209 | goto end; | |
210 | } | |
cbf53d23 | 211 | output_directory = NULL; |
1e791a74 JG |
212 | session->current_trace_chunk = chunk; |
213 | chunk = NULL; | |
214 | end: | |
215 | lttng_trace_chunk_put(chunk); | |
cbf53d23 | 216 | lttng_directory_handle_put(output_directory); |
1e791a74 JG |
217 | return ret; |
218 | } | |
219 | ||
2a174661 DG |
220 | /* |
221 | * Create a new session by assigning a new session ID. | |
222 | * | |
223 | * Return allocated session or else NULL. | |
224 | */ | |
7591bab1 | 225 | struct relay_session *session_create(const char *session_name, |
6fa5fe7c | 226 | const char *hostname, const char *base_path, |
db1da059 JG |
227 | uint32_t live_timer, |
228 | bool snapshot, | |
229 | const lttng_uuid sessiond_uuid, | |
230 | const uint64_t *id_sessiond, | |
231 | const uint64_t *current_chunk_id, | |
232 | const time_t *creation_time, | |
233 | uint32_t major, | |
46ef2188 MD |
234 | uint32_t minor, |
235 | bool session_name_contains_creation_time) | |
2a174661 | 236 | { |
23c8ff50 | 237 | int ret; |
590f0324 JG |
238 | struct relay_session *session = NULL; |
239 | ||
5c956ba3 JG |
240 | assert(session_name); |
241 | assert(hostname); | |
242 | assert(base_path); | |
243 | ||
244 | if (strstr(session_name, ".")) { | |
590f0324 JG |
245 | ERR("Illegal character in session name: \"%s\"", |
246 | session_name); | |
247 | goto error; | |
248 | } | |
5c956ba3 | 249 | if (strstr(base_path, "../")) { |
590f0324 JG |
250 | ERR("Invalid session base path walks up the path hierarchy: \"%s\"", |
251 | base_path); | |
252 | goto error; | |
253 | } | |
5c956ba3 | 254 | if (strstr(hostname, ".")) { |
590f0324 JG |
255 | ERR("Invalid character in hostname: \"%s\"", |
256 | hostname); | |
257 | goto error; | |
258 | } | |
2a174661 DG |
259 | |
260 | session = zmalloc(sizeof(*session)); | |
261 | if (!session) { | |
1e791a74 | 262 | PERROR("Failed to allocate session"); |
2a174661 DG |
263 | goto error; |
264 | } | |
bb5d54e7 MD |
265 | if (lttng_strncpy(session->session_name, session_name, |
266 | sizeof(session->session_name))) { | |
1e791a74 | 267 | WARN("Session name exceeds maximal allowed length"); |
bb5d54e7 MD |
268 | goto error; |
269 | } | |
270 | if (lttng_strncpy(session->hostname, hostname, | |
271 | sizeof(session->hostname))) { | |
1e791a74 | 272 | WARN("Hostname exceeds maximal allowed length"); |
bb5d54e7 MD |
273 | goto error; |
274 | } | |
6fa5fe7c MD |
275 | if (lttng_strncpy(session->base_path, base_path, |
276 | sizeof(session->base_path))) { | |
277 | WARN("Base path exceeds maximal allowed length"); | |
278 | goto error; | |
279 | } | |
46ef2188 MD |
280 | if (creation_time) { |
281 | LTTNG_OPTIONAL_SET(&session->creation_time, *creation_time); | |
282 | } | |
283 | session->session_name_contains_creation_time = | |
284 | session_name_contains_creation_time; | |
6fa5fe7c | 285 | |
2a174661 DG |
286 | session->ctf_traces_ht = lttng_ht_new(0, LTTNG_HT_TYPE_STRING); |
287 | if (!session->ctf_traces_ht) { | |
2a174661 DG |
288 | goto error; |
289 | } | |
290 | ||
7591bab1 | 291 | pthread_mutex_lock(&last_relay_session_id_lock); |
2a174661 | 292 | session->id = ++last_relay_session_id; |
7591bab1 MD |
293 | pthread_mutex_unlock(&last_relay_session_id_lock); |
294 | ||
295 | session->major = major; | |
296 | session->minor = minor; | |
2a174661 | 297 | lttng_ht_node_init_u64(&session->session_n, session->id); |
7591bab1 MD |
298 | urcu_ref_init(&session->ref); |
299 | CDS_INIT_LIST_HEAD(&session->recv_list); | |
300 | pthread_mutex_init(&session->lock, NULL); | |
7591bab1 MD |
301 | pthread_mutex_init(&session->recv_list_lock, NULL); |
302 | ||
7591bab1 MD |
303 | session->live_timer = live_timer; |
304 | session->snapshot = snapshot; | |
23c8ff50 JG |
305 | lttng_uuid_copy(session->sessiond_uuid, sessiond_uuid); |
306 | ||
1e791a74 JG |
307 | if (id_sessiond) { |
308 | LTTNG_OPTIONAL_SET(&session->id_sessiond, *id_sessiond); | |
309 | } | |
310 | ||
d519f442 JR |
311 | if (major == 2 && minor >= 11) { |
312 | /* Only applies for 2.11+ peers using trace chunks. */ | |
313 | ret = init_session_output_path(session); | |
314 | if (ret) { | |
315 | goto error; | |
316 | } | |
ecd1a12f | 317 | } |
d519f442 | 318 | |
23c8ff50 JG |
319 | ret = sessiond_trace_chunk_registry_session_created( |
320 | sessiond_trace_chunk_registry, sessiond_uuid); | |
321 | if (ret) { | |
322 | goto error; | |
323 | } | |
7591bab1 | 324 | |
1e791a74 JG |
325 | if (id_sessiond && current_chunk_id) { |
326 | session->current_trace_chunk = | |
327 | sessiond_trace_chunk_registry_get_chunk( | |
328 | sessiond_trace_chunk_registry, | |
329 | session->sessiond_uuid, | |
330 | session->id_sessiond.value, | |
331 | *current_chunk_id); | |
332 | if (!session->current_trace_chunk) { | |
c70636a7 | 333 | char uuid_str[LTTNG_UUID_STR_LEN]; |
1e791a74 JG |
334 | |
335 | lttng_uuid_to_str(sessiond_uuid, uuid_str); | |
336 | ERR("Could not find trace chunk: sessiond = {%s}, sessiond session id = %" PRIu64 ", trace chunk id = %" PRIu64, | |
337 | uuid_str, *id_sessiond, | |
338 | *current_chunk_id); | |
339 | } | |
340 | } else if (!id_sessiond) { | |
341 | /* | |
342 | * Pre-2.11 peers will not announce trace chunks. An | |
343 | * anonymous trace chunk which will remain set for the | |
344 | * duration of the session is created. | |
345 | */ | |
346 | ret = session_set_anonymous_chunk(session); | |
347 | if (ret) { | |
348 | goto error; | |
349 | } | |
350 | } | |
351 | ||
7591bab1 | 352 | lttng_ht_add_unique_u64(sessions_ht, &session->session_n); |
bb5d54e7 | 353 | return session; |
2a174661 DG |
354 | |
355 | error: | |
1e791a74 | 356 | session_put(session); |
bb5d54e7 | 357 | return NULL; |
2a174661 | 358 | } |
2f8f53af | 359 | |
7591bab1 MD |
360 | /* Should be called with RCU read-side lock held. */ |
361 | bool session_get(struct relay_session *session) | |
362 | { | |
ce4d4083 | 363 | return urcu_ref_get_unless_zero(&session->ref); |
7591bab1 MD |
364 | } |
365 | ||
2f8f53af | 366 | /* |
7591bab1 MD |
367 | * Lookup a session within the session hash table using the session id |
368 | * as key. A session reference is taken when a session is returned. | |
369 | * session_put() must be called on that session. | |
2f8f53af DG |
370 | * |
371 | * Return session or NULL if not found. | |
372 | */ | |
7591bab1 | 373 | struct relay_session *session_get_by_id(uint64_t id) |
2f8f53af DG |
374 | { |
375 | struct relay_session *session = NULL; | |
2a174661 | 376 | struct lttng_ht_node_u64 *node; |
2f8f53af DG |
377 | struct lttng_ht_iter iter; |
378 | ||
7591bab1 MD |
379 | rcu_read_lock(); |
380 | lttng_ht_lookup(sessions_ht, &id, &iter); | |
2a174661 | 381 | node = lttng_ht_iter_get_node_u64(&iter); |
2f8f53af | 382 | if (!node) { |
2a174661 | 383 | DBG("Session find by ID %" PRIu64 " id NOT found", id); |
2f8f53af DG |
384 | goto end; |
385 | } | |
386 | session = caa_container_of(node, struct relay_session, session_n); | |
2a174661 | 387 | DBG("Session find by ID %" PRIu64 " id found", id); |
7591bab1 MD |
388 | if (!session_get(session)) { |
389 | session = NULL; | |
390 | } | |
2f8f53af | 391 | end: |
7591bab1 | 392 | rcu_read_unlock(); |
2f8f53af DG |
393 | return session; |
394 | } | |
2a174661 | 395 | |
7591bab1 MD |
396 | static void rcu_destroy_session(struct rcu_head *rcu_head) |
397 | { | |
398 | struct relay_session *session = | |
399 | caa_container_of(rcu_head, struct relay_session, | |
400 | rcu_node); | |
49e614cb MD |
401 | /* |
402 | * Since each trace has a reference on the session, it means | |
403 | * that if we are at the point where we teardown the session, no | |
404 | * trace belonging to that session exist at this point. | |
405 | * Calling lttng_ht_destroy in call_rcu worker thread so we | |
406 | * don't hold the RCU read-side lock while calling it. | |
407 | */ | |
408 | lttng_ht_destroy(session->ctf_traces_ht); | |
7591bab1 MD |
409 | free(session); |
410 | } | |
411 | ||
2a174661 DG |
412 | /* |
413 | * Delete session from the given hash table. | |
414 | * | |
415 | * Return lttng ht del error code being 0 on success and 1 on failure. | |
416 | */ | |
7591bab1 | 417 | static int session_delete(struct relay_session *session) |
2a174661 DG |
418 | { |
419 | struct lttng_ht_iter iter; | |
420 | ||
2a174661 | 421 | iter.iter.node = &session->session_n.node; |
7591bab1 | 422 | return lttng_ht_del(sessions_ht, &iter); |
2a174661 DG |
423 | } |
424 | ||
7591bab1 MD |
425 | |
426 | static void destroy_session(struct relay_session *session) | |
427 | { | |
428 | int ret; | |
429 | ||
430 | ret = session_delete(session); | |
431 | assert(!ret); | |
639ddf68 | 432 | lttng_trace_chunk_put(session->current_trace_chunk); |
c35f9726 | 433 | session->current_trace_chunk = NULL; |
62bad3bf JG |
434 | lttng_trace_chunk_put(session->pending_closure_trace_chunk); |
435 | session->pending_closure_trace_chunk = NULL; | |
23c8ff50 JG |
436 | ret = sessiond_trace_chunk_registry_session_destroyed( |
437 | sessiond_trace_chunk_registry, session->sessiond_uuid); | |
438 | assert(!ret); | |
7591bab1 MD |
439 | call_rcu(&session->rcu_node, rcu_destroy_session); |
440 | } | |
441 | ||
feb33caa | 442 | static void session_release(struct urcu_ref *ref) |
2a174661 | 443 | { |
7591bab1 MD |
444 | struct relay_session *session = |
445 | caa_container_of(ref, struct relay_session, ref); | |
2a174661 | 446 | |
7591bab1 MD |
447 | destroy_session(session); |
448 | } | |
2a174661 | 449 | |
7591bab1 MD |
450 | void session_put(struct relay_session *session) |
451 | { | |
874ec45e JG |
452 | if (!session) { |
453 | return; | |
454 | } | |
7591bab1 | 455 | rcu_read_lock(); |
7591bab1 | 456 | urcu_ref_put(&session->ref, session_release); |
7591bab1 | 457 | rcu_read_unlock(); |
2a174661 DG |
458 | } |
459 | ||
7591bab1 | 460 | int session_close(struct relay_session *session) |
2a174661 DG |
461 | { |
462 | int ret = 0; | |
7591bab1 MD |
463 | struct ctf_trace *trace; |
464 | struct lttng_ht_iter iter; | |
465 | struct relay_stream *stream; | |
466 | ||
467 | pthread_mutex_lock(&session->lock); | |
468 | DBG("closing session %" PRIu64 ": is conn already closed %d", | |
469 | session->id, session->connection_closed); | |
7591bab1 | 470 | session->connection_closed = true; |
7591bab1 | 471 | pthread_mutex_unlock(&session->lock); |
2a174661 | 472 | |
7591bab1 MD |
473 | rcu_read_lock(); |
474 | cds_lfht_for_each_entry(session->ctf_traces_ht->ht, | |
475 | &iter.iter, trace, node.node) { | |
476 | ret = ctf_trace_close(trace); | |
477 | if (ret) { | |
478 | goto rcu_unlock; | |
2a174661 DG |
479 | } |
480 | } | |
7591bab1 MD |
481 | cds_list_for_each_entry_rcu(stream, &session->recv_list, |
482 | recv_node) { | |
bda7c7b9 JG |
483 | /* Close streams which have not been published yet. */ |
484 | try_stream_close(stream); | |
7591bab1 MD |
485 | } |
486 | rcu_unlock: | |
487 | rcu_read_unlock(); | |
488 | if (ret) { | |
489 | return ret; | |
490 | } | |
491 | /* Put self-reference from create. */ | |
492 | session_put(session); | |
493 | return ret; | |
2a174661 DG |
494 | } |
495 | ||
98ba050e JR |
496 | int session_abort(struct relay_session *session) |
497 | { | |
498 | int ret = 0; | |
499 | ||
500 | if (!session) { | |
501 | return 0; | |
502 | } | |
503 | ||
504 | pthread_mutex_lock(&session->lock); | |
505 | DBG("aborting session %" PRIu64, session->id); | |
98ba050e | 506 | session->aborted = true; |
98ba050e JR |
507 | pthread_mutex_unlock(&session->lock); |
508 | return ret; | |
509 | } | |
510 | ||
7591bab1 | 511 | void print_sessions(void) |
2a174661 | 512 | { |
2a174661 | 513 | struct lttng_ht_iter iter; |
7591bab1 | 514 | struct relay_session *session; |
2a174661 | 515 | |
ce3f3ba3 JG |
516 | if (!sessions_ht) { |
517 | return; | |
518 | } | |
519 | ||
2a174661 | 520 | rcu_read_lock(); |
7591bab1 MD |
521 | cds_lfht_for_each_entry(sessions_ht->ht, &iter.iter, session, |
522 | session_n.node) { | |
523 | if (!session_get(session)) { | |
524 | continue; | |
525 | } | |
526 | DBG("session %p refcount %ld session %" PRIu64, | |
527 | session, | |
528 | session->ref.refcount, | |
529 | session->id); | |
530 | session_put(session); | |
2a174661 | 531 | } |
2a174661 | 532 | rcu_read_unlock(); |
2a174661 | 533 | } |
d37856b8 | 534 | |
cbf53d23 JG |
535 | struct lttng_directory_handle *session_create_output_directory_handle( |
536 | struct relay_session *session) | |
d37856b8 JR |
537 | { |
538 | int ret; | |
539 | /* | |
540 | * relayd_output_path/session_directory | |
541 | * e.g. /home/user/lttng-traces/hostname/session_name | |
542 | */ | |
543 | char *full_session_path = NULL; | |
cbf53d23 | 544 | struct lttng_directory_handle *handle = NULL; |
d37856b8 JR |
545 | |
546 | pthread_mutex_lock(&session->lock); | |
547 | full_session_path = create_output_path(session->output_path); | |
548 | if (!full_session_path) { | |
d37856b8 JR |
549 | goto end; |
550 | } | |
551 | ||
552 | ret = utils_mkdir_recursive( | |
553 | full_session_path, S_IRWXU | S_IRWXG, -1, -1); | |
554 | if (ret) { | |
555 | ERR("Failed to create session output path \"%s\"", | |
556 | full_session_path); | |
557 | goto end; | |
558 | } | |
559 | ||
cbf53d23 | 560 | handle = lttng_directory_handle_create(full_session_path); |
d37856b8 JR |
561 | end: |
562 | pthread_mutex_unlock(&session->lock); | |
563 | free(full_session_path); | |
cbf53d23 | 564 | return handle; |
d37856b8 | 565 | } |