4 * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * Holds LTTng per-session event registry.
8 * Dual LGPL v2.1/GPL v2 license.
13 #include <urcu/list.h>
14 #include <urcu/hlist.h>
17 #include <urcu/compiler.h>
18 #include <urcu/uatomic.h>
19 #include <uuid/uuid.h>
20 #include <ust/tracepoint.h>
24 #include <ust/lttng-events.h>
25 #include <ust/usterr-signal-safe.h>
27 #include "ltt-tracer.h"
28 #include "ltt-tracer-core.h"
30 #include "../libringbuffer/shm.h"
33 #include <ust/kcompat/jhash.h>
36 * The sessions mutex is the centralized mutex across UST tracing
37 * control and probe registration.
39 static DEFINE_MUTEX(sessions_mutex
);
43 pthread_mutex_lock(&sessions_mutex
);
48 pthread_mutex_unlock(&sessions_mutex
);
51 static CDS_LIST_HEAD(sessions
);
52 static CDS_LIST_HEAD(ltt_transport_list
);
55 * Pending probes hash table, containing the registered ltt events for
56 * which tracepoint probes are still missing. Protected by the sessions
59 #define PENDING_PROBE_HASH_BITS 6
60 #define PENDING_PROBE_HASH_SIZE (1 << PENDING_PROBE_HASH_BITS)
61 static struct cds_hlist_head pending_probe_table
[PENDING_PROBE_HASH_SIZE
];
63 struct ust_pending_probe
{
64 struct ltt_event
*event
;
65 struct cds_hlist_node node
;
69 static void _ltt_event_destroy(struct ltt_event
*event
);
70 static void _ltt_channel_destroy(struct ltt_channel
*chan
);
71 static int _ltt_event_unregister(struct ltt_event
*event
);
73 int _ltt_event_metadata_statedump(struct ltt_session
*session
,
74 struct ltt_channel
*chan
,
75 struct ltt_event
*event
);
77 int _ltt_session_metadata_statedump(struct ltt_session
*session
);
80 * called at event creation if probe is missing.
81 * called with session mutex held.
84 int add_pending_probe(struct ltt_event
*event
, const char *name
)
86 struct cds_hlist_head
*head
;
87 struct ust_pending_probe
*e
;
88 size_t name_len
= strlen(name
) + 1;
89 u32 hash
= jhash(name
, name_len
- 1, 0);
91 head
= &pending_probe_table
[hash
& (PENDING_PROBE_HASH_SIZE
- 1)];
92 e
= zmalloc(sizeof(struct ust_pending_probe
) + name_len
);
95 memcpy(&e
->name
[0], name
, name_len
);
96 cds_hlist_add_head(&e
->node
, head
);
98 event
->pending_probe
= e
;
103 * remove a pending probe. called when at event teardown and when an
104 * event is fixed (probe is loaded).
105 * called with session mutex held.
108 void remove_pending_probe(struct ust_pending_probe
*e
)
112 cds_hlist_del(&e
->node
);
117 * Called at library load: connect the probe on the events pending on
119 * called with session mutex held.
121 int pending_probe_fix_events(const struct lttng_event_desc
*desc
)
123 struct cds_hlist_head
*head
;
124 struct cds_hlist_node
*node
, *p
;
125 struct ust_pending_probe
*e
;
126 const char *name
= desc
->name
;
127 size_t name_len
= strlen(name
) + 1;
128 u32 hash
= jhash(name
, name_len
- 1, 0);
131 head
= &pending_probe_table
[hash
& (PENDING_PROBE_HASH_SIZE
- 1)];
132 cds_hlist_for_each_entry_safe(e
, node
, p
, head
, node
) {
133 struct ltt_event
*event
;
134 struct ltt_channel
*chan
;
136 if (strcmp(name
, e
->name
))
140 assert(!event
->desc
);
142 event
->pending_probe
= NULL
;
143 remove_pending_probe(e
);
144 ret
|= __tracepoint_probe_register(name
,
145 event
->desc
->probe_callback
,
147 ret
|= _ltt_event_metadata_statedump(chan
->session
, chan
,
153 void synchronize_trace(void)
158 struct ltt_session
*ltt_session_create(void)
160 struct ltt_session
*session
;
162 session
= zmalloc(sizeof(struct ltt_session
));
165 pthread_mutex_lock(&sessions_mutex
);
166 CDS_INIT_LIST_HEAD(&session
->chan
);
167 CDS_INIT_LIST_HEAD(&session
->events
);
168 uuid_generate(session
->uuid
);
169 cds_list_add(&session
->list
, &sessions
);
170 pthread_mutex_unlock(&sessions_mutex
);
174 void ltt_session_destroy(struct ltt_session
*session
)
176 struct ltt_channel
*chan
, *tmpchan
;
177 struct ltt_event
*event
, *tmpevent
;
180 pthread_mutex_lock(&sessions_mutex
);
181 CMM_ACCESS_ONCE(session
->active
) = 0;
182 cds_list_for_each_entry(event
, &session
->events
, list
) {
183 ret
= _ltt_event_unregister(event
);
186 synchronize_trace(); /* Wait for in-flight events to complete */
187 cds_list_for_each_entry_safe(event
, tmpevent
, &session
->events
, list
)
188 _ltt_event_destroy(event
);
189 cds_list_for_each_entry_safe(chan
, tmpchan
, &session
->chan
, list
)
190 _ltt_channel_destroy(chan
);
191 cds_list_del(&session
->list
);
192 pthread_mutex_unlock(&sessions_mutex
);
196 int ltt_session_enable(struct ltt_session
*session
)
199 struct ltt_channel
*chan
;
201 pthread_mutex_lock(&sessions_mutex
);
202 if (session
->active
) {
208 * Snapshot the number of events per channel to know the type of header
211 cds_list_for_each_entry(chan
, &session
->chan
, list
) {
212 if (chan
->header_type
)
213 continue; /* don't change it if session stop/restart */
214 if (chan
->free_event_id
< 31)
215 chan
->header_type
= 1; /* compact */
217 chan
->header_type
= 2; /* large */
220 CMM_ACCESS_ONCE(session
->active
) = 1;
221 CMM_ACCESS_ONCE(session
->been_active
) = 1;
222 ret
= _ltt_session_metadata_statedump(session
);
224 CMM_ACCESS_ONCE(session
->active
) = 0;
226 pthread_mutex_unlock(&sessions_mutex
);
230 int ltt_session_disable(struct ltt_session
*session
)
234 pthread_mutex_lock(&sessions_mutex
);
235 if (!session
->active
) {
239 CMM_ACCESS_ONCE(session
->active
) = 0;
241 pthread_mutex_unlock(&sessions_mutex
);
245 int ltt_channel_enable(struct ltt_channel
*channel
)
249 if (channel
== channel
->session
->metadata
)
251 old
= uatomic_xchg(&channel
->enabled
, 1);
257 int ltt_channel_disable(struct ltt_channel
*channel
)
261 if (channel
== channel
->session
->metadata
)
263 old
= uatomic_xchg(&channel
->enabled
, 0);
269 int ltt_event_enable(struct ltt_event
*event
)
273 if (event
->chan
== event
->chan
->session
->metadata
)
275 old
= uatomic_xchg(&event
->enabled
, 1);
281 int ltt_event_disable(struct ltt_event
*event
)
285 if (event
->chan
== event
->chan
->session
->metadata
)
287 old
= uatomic_xchg(&event
->enabled
, 0);
293 static struct ltt_transport
*ltt_transport_find(const char *name
)
295 struct ltt_transport
*transport
;
297 cds_list_for_each_entry(transport
, <t_transport_list
, node
) {
298 if (!strcmp(transport
->name
, name
))
304 struct ltt_channel
*ltt_channel_create(struct ltt_session
*session
,
305 const char *transport_name
,
307 size_t subbuf_size
, size_t num_subbuf
,
308 unsigned int switch_timer_interval
,
309 unsigned int read_timer_interval
)
311 struct ltt_channel
*chan
;
312 struct ltt_transport
*transport
;
314 pthread_mutex_lock(&sessions_mutex
);
315 if (session
->been_active
)
316 goto active
; /* Refuse to add channel to active session */
317 transport
= ltt_transport_find(transport_name
);
319 DBG("LTTng transport %s not found\n",
323 chan
= zmalloc(sizeof(struct ltt_channel
));
326 chan
->session
= session
;
327 chan
->id
= session
->free_chan_id
++;
329 * Note: the channel creation op already writes into the packet
330 * headers. Therefore the "chan" information used as input
331 * should be already accessible.
333 transport
->ops
.channel_create("[lttng]", chan
, buf_addr
,
334 subbuf_size
, num_subbuf
, switch_timer_interval
,
335 read_timer_interval
);
339 chan
->ops
= &transport
->ops
;
340 cds_list_add(&chan
->list
, &session
->chan
);
341 pthread_mutex_unlock(&sessions_mutex
);
349 pthread_mutex_unlock(&sessions_mutex
);
354 * Only used internally at session destruction.
357 void _ltt_channel_destroy(struct ltt_channel
*chan
)
359 chan
->ops
->channel_destroy(chan
);
360 cds_list_del(&chan
->list
);
361 lttng_destroy_context(chan
->ctx
);
366 * Supports event creation while tracing session is active.
368 struct ltt_event
*ltt_event_create(struct ltt_channel
*chan
,
369 struct lttng_ust_event
*event_param
,
372 struct ltt_event
*event
;
375 pthread_mutex_lock(&sessions_mutex
);
376 if (chan
->used_event_id
== -1UL)
379 * This is O(n^2) (for each event, the loop is called at event
380 * creation). Might require a hash if we have lots of events.
382 cds_list_for_each_entry(event
, &chan
->session
->events
, list
)
383 if (event
->desc
&& !strcmp(event
->desc
->name
, event_param
->name
))
385 event
= zmalloc(sizeof(struct ltt_event
));
389 event
->filter
= filter
;
391 * used_event_id counts the maximum number of event IDs that can
392 * register if all probes register.
394 chan
->used_event_id
++;
396 event
->instrumentation
= event_param
->instrumentation
;
397 /* Populate ltt_event structure before tracepoint registration. */
399 switch (event_param
->instrumentation
) {
400 case LTTNG_UST_TRACEPOINT
:
401 event
->desc
= ltt_event_get(event_param
->name
);
403 ret
= __tracepoint_probe_register(event_param
->name
,
404 event
->desc
->probe_callback
,
408 event
->id
= chan
->free_event_id
++;
411 * If the probe is not present, event->desc stays NULL,
412 * waiting for the probe to register, and the event->id
415 ret
= add_pending_probe(event
, event_param
->name
);
417 goto add_pending_error
;
424 ret
= _ltt_event_metadata_statedump(chan
->session
, chan
, event
);
426 goto statedump_error
;
428 cds_list_add(&event
->list
, &chan
->session
->events
);
429 pthread_mutex_unlock(&sessions_mutex
);
434 WARN_ON_ONCE(__tracepoint_probe_unregister(event_param
->name
,
435 event
->desc
->probe_callback
,
437 ltt_event_put(event
->desc
);
445 pthread_mutex_unlock(&sessions_mutex
);
450 * Only used internally at session destruction.
452 int _ltt_event_unregister(struct ltt_event
*event
)
456 switch (event
->instrumentation
) {
457 case LTTNG_UST_TRACEPOINT
:
459 ret
= __tracepoint_probe_unregister(event
->desc
->name
,
460 event
->desc
->probe_callback
,
465 remove_pending_probe(event
->pending_probe
);
476 * Only used internally at session destruction.
479 void _ltt_event_destroy(struct ltt_event
*event
)
481 switch (event
->instrumentation
) {
482 case LTTNG_UST_TRACEPOINT
:
484 ltt_event_put(event
->desc
);
490 cds_list_del(&event
->list
);
491 lttng_destroy_context(event
->ctx
);
496 * We have exclusive access to our metadata buffer (protected by the
497 * sessions_mutex), so we can do racy operations such as looking for
498 * remaining space left in packet and write, since mutual exclusion
499 * protects us from concurrent writes.
501 int lttng_metadata_printf(struct ltt_session
*session
,
502 const char *fmt
, ...)
504 struct lib_ring_buffer_ctx ctx
;
505 struct ltt_channel
*chan
= session
->metadata
;
507 int ret
= 0, waitret
;
508 size_t len
, reserve_len
, pos
;
511 WARN_ON_ONCE(!CMM_ACCESS_ONCE(session
->active
));
514 ret
= vasprintf(&str
, fmt
, ap
);
522 for (pos
= 0; pos
< len
; pos
+= reserve_len
) {
523 reserve_len
= min_t(size_t,
524 chan
->ops
->packet_avail_size(chan
->chan
, chan
->handle
),
526 lib_ring_buffer_ctx_init(&ctx
, chan
->chan
, NULL
, reserve_len
,
527 sizeof(char), -1, chan
->handle
);
529 * We don't care about metadata buffer's records lost
530 * count, because we always retry here. Report error if
531 * we need to bail out after timeout or being
534 waitret
= wait_cond_interruptible_timeout(
536 ret
= chan
->ops
->event_reserve(&ctx
, 0);
537 ret
!= -ENOBUFS
|| !ret
;
539 LTTNG_METADATA_TIMEOUT_MSEC
);
540 if (waitret
== -ETIMEDOUT
|| waitret
== -EINTR
|| ret
) {
541 DBG("LTTng: Failure to write metadata to buffers (%s)\n",
542 waitret
== -EINTR
? "interrupted" :
543 (ret
== -ENOBUFS
? "timeout" : "I/O error"));
544 if (waitret
== -EINTR
)
548 chan
->ops
->event_write(&ctx
, &str
[pos
], reserve_len
);
549 chan
->ops
->event_commit(&ctx
);
557 int _ltt_field_statedump(struct ltt_session
*session
,
558 const struct lttng_event_field
*field
)
562 switch (field
->type
.atype
) {
564 ret
= lttng_metadata_printf(session
,
565 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } %s;\n",
566 field
->type
.u
.basic
.integer
.size
,
567 field
->type
.u
.basic
.integer
.alignment
,
568 field
->type
.u
.basic
.integer
.signedness
,
569 (field
->type
.u
.basic
.integer
.encoding
== lttng_encode_none
)
571 : (field
->type
.u
.basic
.integer
.encoding
== lttng_encode_UTF8
)
574 field
->type
.u
.basic
.integer
.base
,
576 field
->type
.u
.basic
.integer
.reverse_byte_order
? " byte_order = le;" : "",
578 field
->type
.u
.basic
.integer
.reverse_byte_order
? " byte_order = be;" : "",
583 ret
= lttng_metadata_printf(session
,
584 " floating_point { exp_dig = %u; mant_dig = %u; align = %u; } %s;\n",
585 field
->type
.u
.basic
._float
.exp_dig
,
586 field
->type
.u
.basic
._float
.mant_dig
,
587 field
->type
.u
.basic
._float
.alignment
,
589 field
->type
.u
.basic
.integer
.reverse_byte_order
? " byte_order = le;" : "",
591 field
->type
.u
.basic
.integer
.reverse_byte_order
? " byte_order = be;" : "",
596 ret
= lttng_metadata_printf(session
,
598 field
->type
.u
.basic
.enumeration
.name
,
603 const struct lttng_basic_type
*elem_type
;
605 elem_type
= &field
->type
.u
.array
.elem_type
;
606 ret
= lttng_metadata_printf(session
,
607 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } %s[%u];\n",
608 elem_type
->u
.basic
.integer
.size
,
609 elem_type
->u
.basic
.integer
.alignment
,
610 elem_type
->u
.basic
.integer
.signedness
,
611 (elem_type
->u
.basic
.integer
.encoding
== lttng_encode_none
)
613 : (elem_type
->u
.basic
.integer
.encoding
== lttng_encode_UTF8
)
616 elem_type
->u
.basic
.integer
.base
,
618 elem_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = le;" : "",
620 elem_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = be;" : "",
622 field
->name
, field
->type
.u
.array
.length
);
627 const struct lttng_basic_type
*elem_type
;
628 const struct lttng_basic_type
*length_type
;
630 elem_type
= &field
->type
.u
.sequence
.elem_type
;
631 length_type
= &field
->type
.u
.sequence
.length_type
;
632 ret
= lttng_metadata_printf(session
,
633 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } __%s_length;\n",
634 length_type
->u
.basic
.integer
.size
,
635 (unsigned int) length_type
->u
.basic
.integer
.alignment
,
636 length_type
->u
.basic
.integer
.signedness
,
637 (length_type
->u
.basic
.integer
.encoding
== lttng_encode_none
)
639 : ((length_type
->u
.basic
.integer
.encoding
== lttng_encode_UTF8
)
642 length_type
->u
.basic
.integer
.base
,
644 length_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = le;" : "",
646 length_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = be;" : "",
652 ret
= lttng_metadata_printf(session
,
653 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } %s[ __%s_length ];\n",
654 elem_type
->u
.basic
.integer
.size
,
655 (unsigned int) elem_type
->u
.basic
.integer
.alignment
,
656 elem_type
->u
.basic
.integer
.signedness
,
657 (elem_type
->u
.basic
.integer
.encoding
== lttng_encode_none
)
659 : ((elem_type
->u
.basic
.integer
.encoding
== lttng_encode_UTF8
)
662 elem_type
->u
.basic
.integer
.base
,
664 elem_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = le;" : "",
666 elem_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = be;" : "",
674 /* Default encoding is UTF8 */
675 ret
= lttng_metadata_printf(session
,
677 field
->type
.u
.basic
.string
.encoding
== lttng_encode_ASCII
?
678 " { encoding = ASCII; }" : "",
689 int _ltt_context_metadata_statedump(struct ltt_session
*session
,
690 struct lttng_ctx
*ctx
)
697 for (i
= 0; i
< ctx
->nr_fields
; i
++) {
698 const struct lttng_ctx_field
*field
= &ctx
->fields
[i
];
700 ret
= _ltt_field_statedump(session
, &field
->event_field
);
708 int _ltt_fields_metadata_statedump(struct ltt_session
*session
,
709 struct ltt_event
*event
)
711 const struct lttng_event_desc
*desc
= event
->desc
;
715 for (i
= 0; i
< desc
->nr_fields
; i
++) {
716 const struct lttng_event_field
*field
= &desc
->fields
[i
];
718 ret
= _ltt_field_statedump(session
, field
);
726 int _ltt_event_metadata_statedump(struct ltt_session
*session
,
727 struct ltt_channel
*chan
,
728 struct ltt_event
*event
)
732 if (event
->metadata_dumped
|| !CMM_ACCESS_ONCE(session
->active
))
734 if (chan
== session
->metadata
)
737 * Don't print events for which probe load is pending.
742 ret
= lttng_metadata_printf(session
,
746 " stream_id = %u;\n",
754 ret
= lttng_metadata_printf(session
,
755 " context := struct {\n");
759 ret
= _ltt_context_metadata_statedump(session
, event
->ctx
);
763 ret
= lttng_metadata_printf(session
,
769 ret
= lttng_metadata_printf(session
,
770 " fields := struct {\n"
775 ret
= _ltt_fields_metadata_statedump(session
, event
);
780 * LTTng space reservation can only reserve multiples of the
783 ret
= lttng_metadata_printf(session
,
789 event
->metadata_dumped
= 1;
796 int _ltt_channel_metadata_statedump(struct ltt_session
*session
,
797 struct ltt_channel
*chan
)
801 if (chan
->metadata_dumped
|| !CMM_ACCESS_ONCE(session
->active
))
803 if (chan
== session
->metadata
)
806 WARN_ON_ONCE(!chan
->header_type
);
807 ret
= lttng_metadata_printf(session
,
810 " event.header := %s;\n"
811 " packet.context := struct packet_context;\n",
813 chan
->header_type
== 1 ? "struct event_header_compact" :
814 "struct event_header_large");
819 ret
= lttng_metadata_printf(session
,
820 " event.context := struct {\n");
824 ret
= _ltt_context_metadata_statedump(session
, chan
->ctx
);
828 ret
= lttng_metadata_printf(session
,
834 ret
= lttng_metadata_printf(session
,
837 chan
->metadata_dumped
= 1;
843 int _ltt_stream_packet_context_declare(struct ltt_session
*session
)
845 return lttng_metadata_printf(session
,
846 "struct packet_context {\n"
847 " uint64_t timestamp_begin;\n"
848 " uint64_t timestamp_end;\n"
849 " uint32_t events_discarded;\n"
850 " uint32_t content_size;\n"
851 " uint32_t packet_size;\n"
852 " uint32_t cpu_id;\n"
860 * id 31 is reserved to indicate an extended header.
863 * id: range: 0 - 65534.
864 * id 65535 is reserved to indicate an extended header.
867 int _ltt_event_header_declare(struct ltt_session
*session
)
869 return lttng_metadata_printf(session
,
870 "struct event_header_compact {\n"
871 " enum : uint5_t { compact = 0 ... 30, extended = 31 } id;\n"
874 " uint27_t timestamp;\n"
878 " uint64_t timestamp;\n"
883 "struct event_header_large {\n"
884 " enum : uint16_t { compact = 0 ... 65534, extended = 65535 } id;\n"
887 " uint32_t timestamp;\n"
891 " uint64_t timestamp;\n"
895 lttng_alignof(uint32_t) * CHAR_BIT
,
896 lttng_alignof(uint16_t) * CHAR_BIT
901 * Output metadata into this session's metadata buffers.
904 int _ltt_session_metadata_statedump(struct ltt_session
*session
)
906 unsigned char *uuid_c
= session
->uuid
;
908 struct ltt_channel
*chan
;
909 struct ltt_event
*event
;
912 if (!CMM_ACCESS_ONCE(session
->active
))
914 if (session
->metadata_dumped
)
916 if (!session
->metadata
) {
917 DBG("LTTng: attempt to start tracing, but metadata channel is not found. Operation abort.\n");
921 snprintf(uuid_s
, sizeof(uuid_s
),
922 "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
923 uuid_c
[0], uuid_c
[1], uuid_c
[2], uuid_c
[3],
924 uuid_c
[4], uuid_c
[5], uuid_c
[6], uuid_c
[7],
925 uuid_c
[8], uuid_c
[9], uuid_c
[10], uuid_c
[11],
926 uuid_c
[12], uuid_c
[13], uuid_c
[14], uuid_c
[15]);
928 ret
= lttng_metadata_printf(session
,
929 "typealias integer { size = 8; align = %u; signed = false; } := uint8_t;\n"
930 "typealias integer { size = 16; align = %u; signed = false; } := uint16_t;\n"
931 "typealias integer { size = 32; align = %u; signed = false; } := uint32_t;\n"
932 "typealias integer { size = 64; align = %u; signed = false; } := uint64_t;\n"
933 "typealias integer { size = 5; align = 1; signed = false; } := uint5_t;\n"
934 "typealias integer { size = 27; align = 1; signed = false; } := uint27_t;\n"
940 " byte_order = %s;\n"
941 " packet.header := struct {\n"
943 " uint8_t uuid[16];\n"
944 " uint32_t stream_id;\n"
947 lttng_alignof(uint8_t) * CHAR_BIT
,
948 lttng_alignof(uint16_t) * CHAR_BIT
,
949 lttng_alignof(uint32_t) * CHAR_BIT
,
950 lttng_alignof(uint64_t) * CHAR_BIT
,
963 ret
= _ltt_stream_packet_context_declare(session
);
967 ret
= _ltt_event_header_declare(session
);
972 cds_list_for_each_entry(chan
, &session
->chan
, list
) {
973 ret
= _ltt_channel_metadata_statedump(session
, chan
);
978 cds_list_for_each_entry(event
, &session
->events
, list
) {
979 ret
= _ltt_event_metadata_statedump(session
, event
->chan
, event
);
983 session
->metadata_dumped
= 1;
989 * ltt_transport_register - LTT transport registration
990 * @transport: transport structure
992 * Registers a transport which can be used as output to extract the data out of
995 void ltt_transport_register(struct ltt_transport
*transport
)
997 pthread_mutex_lock(&sessions_mutex
);
998 cds_list_add_tail(&transport
->node
, <t_transport_list
);
999 pthread_mutex_unlock(&sessions_mutex
);
1003 * ltt_transport_unregister - LTT transport unregistration
1004 * @transport: transport structure
1006 void ltt_transport_unregister(struct ltt_transport
*transport
)
1008 pthread_mutex_lock(&sessions_mutex
);
1009 cds_list_del(&transport
->node
);
1010 pthread_mutex_unlock(&sessions_mutex
);
1013 void ltt_events_exit(void)
1015 struct ltt_session
*session
, *tmpsession
;
1017 cds_list_for_each_entry_safe(session
, tmpsession
, &sessions
, list
)
1018 ltt_session_destroy(session
);