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 cds_hlist_node
*node
;
88 struct ust_pending_probe
*e
;
89 size_t name_len
= strlen(name
) + 1;
90 u32 hash
= jhash(name
, name_len
- 1, 0);
92 head
= &pending_probe_table
[hash
& (PENDING_PROBE_HASH_SIZE
- 1)];
93 e
= zmalloc(sizeof(struct ust_pending_probe
) + name_len
);
96 memcpy(&e
->name
[0], name
, name_len
);
97 cds_hlist_add_head(&e
->node
, head
);
99 event
->pending_probe
= e
;
104 * remove a pending probe. called when at event teardown and when an
105 * event is fixed (probe is loaded).
106 * called with session mutex held.
109 void remove_pending_probe(struct ust_pending_probe
*e
)
113 cds_hlist_del(&e
->node
);
118 * Called at library load: connect the probe on the events pending on
120 * called with session mutex held.
122 int pending_probe_fix_events(const struct lttng_event_desc
*desc
)
124 struct cds_hlist_head
*head
;
125 struct cds_hlist_node
*node
, *p
;
126 struct ust_pending_probe
*e
;
127 const char *name
= desc
->name
;
128 size_t name_len
= strlen(name
) + 1;
129 u32 hash
= jhash(name
, name_len
- 1, 0);
132 head
= &pending_probe_table
[hash
& (PENDING_PROBE_HASH_SIZE
- 1)];
133 cds_hlist_for_each_entry_safe(e
, node
, p
, head
, node
) {
134 struct ltt_event
*event
;
135 struct ltt_channel
*chan
;
137 if (strcmp(name
, e
->name
))
141 assert(!event
->desc
);
143 event
->pending_probe
= NULL
;
144 remove_pending_probe(e
);
145 ret
|= __tracepoint_probe_register(name
,
146 event
->desc
->probe_callback
,
148 ret
|= _ltt_event_metadata_statedump(chan
->session
, chan
,
154 void synchronize_trace(void)
159 struct ltt_session
*ltt_session_create(void)
161 struct ltt_session
*session
;
163 session
= zmalloc(sizeof(struct ltt_session
));
166 pthread_mutex_lock(&sessions_mutex
);
167 CDS_INIT_LIST_HEAD(&session
->chan
);
168 CDS_INIT_LIST_HEAD(&session
->events
);
169 uuid_generate(session
->uuid
);
170 cds_list_add(&session
->list
, &sessions
);
171 pthread_mutex_unlock(&sessions_mutex
);
175 void ltt_session_destroy(struct ltt_session
*session
)
177 struct ltt_channel
*chan
, *tmpchan
;
178 struct ltt_event
*event
, *tmpevent
;
181 pthread_mutex_lock(&sessions_mutex
);
182 CMM_ACCESS_ONCE(session
->active
) = 0;
183 cds_list_for_each_entry(event
, &session
->events
, list
) {
184 ret
= _ltt_event_unregister(event
);
187 synchronize_trace(); /* Wait for in-flight events to complete */
188 cds_list_for_each_entry_safe(event
, tmpevent
, &session
->events
, list
)
189 _ltt_event_destroy(event
);
190 cds_list_for_each_entry_safe(chan
, tmpchan
, &session
->chan
, list
)
191 _ltt_channel_destroy(chan
);
192 cds_list_del(&session
->list
);
193 pthread_mutex_unlock(&sessions_mutex
);
197 int ltt_session_enable(struct ltt_session
*session
)
200 struct ltt_channel
*chan
;
202 pthread_mutex_lock(&sessions_mutex
);
203 if (session
->active
) {
209 * Snapshot the number of events per channel to know the type of header
212 cds_list_for_each_entry(chan
, &session
->chan
, list
) {
213 if (chan
->header_type
)
214 continue; /* don't change it if session stop/restart */
215 if (chan
->free_event_id
< 31)
216 chan
->header_type
= 1; /* compact */
218 chan
->header_type
= 2; /* large */
221 CMM_ACCESS_ONCE(session
->active
) = 1;
222 CMM_ACCESS_ONCE(session
->been_active
) = 1;
223 ret
= _ltt_session_metadata_statedump(session
);
225 CMM_ACCESS_ONCE(session
->active
) = 0;
227 pthread_mutex_unlock(&sessions_mutex
);
231 int ltt_session_disable(struct ltt_session
*session
)
235 pthread_mutex_lock(&sessions_mutex
);
236 if (!session
->active
) {
240 CMM_ACCESS_ONCE(session
->active
) = 0;
242 pthread_mutex_unlock(&sessions_mutex
);
246 int ltt_channel_enable(struct ltt_channel
*channel
)
250 if (channel
== channel
->session
->metadata
)
252 old
= uatomic_xchg(&channel
->enabled
, 1);
258 int ltt_channel_disable(struct ltt_channel
*channel
)
262 if (channel
== channel
->session
->metadata
)
264 old
= uatomic_xchg(&channel
->enabled
, 0);
270 int ltt_event_enable(struct ltt_event
*event
)
274 if (event
->chan
== event
->chan
->session
->metadata
)
276 old
= uatomic_xchg(&event
->enabled
, 1);
282 int ltt_event_disable(struct ltt_event
*event
)
286 if (event
->chan
== event
->chan
->session
->metadata
)
288 old
= uatomic_xchg(&event
->enabled
, 0);
294 static struct ltt_transport
*ltt_transport_find(const char *name
)
296 struct ltt_transport
*transport
;
298 cds_list_for_each_entry(transport
, <t_transport_list
, node
) {
299 if (!strcmp(transport
->name
, name
))
305 struct ltt_channel
*ltt_channel_create(struct ltt_session
*session
,
306 const char *transport_name
,
308 size_t subbuf_size
, size_t num_subbuf
,
309 unsigned int switch_timer_interval
,
310 unsigned int read_timer_interval
)
312 struct ltt_channel
*chan
;
313 struct ltt_transport
*transport
;
315 pthread_mutex_lock(&sessions_mutex
);
316 if (session
->been_active
)
317 goto active
; /* Refuse to add channel to active session */
318 transport
= ltt_transport_find(transport_name
);
320 DBG("LTTng transport %s not found\n",
324 chan
= zmalloc(sizeof(struct ltt_channel
));
327 chan
->session
= session
;
328 chan
->id
= session
->free_chan_id
++;
330 * Note: the channel creation op already writes into the packet
331 * headers. Therefore the "chan" information used as input
332 * should be already accessible.
334 transport
->ops
.channel_create("[lttng]", chan
, buf_addr
,
335 subbuf_size
, num_subbuf
, switch_timer_interval
,
336 read_timer_interval
);
340 chan
->ops
= &transport
->ops
;
341 cds_list_add(&chan
->list
, &session
->chan
);
342 pthread_mutex_unlock(&sessions_mutex
);
350 pthread_mutex_unlock(&sessions_mutex
);
355 * Only used internally at session destruction.
358 void _ltt_channel_destroy(struct ltt_channel
*chan
)
360 chan
->ops
->channel_destroy(chan
);
361 cds_list_del(&chan
->list
);
362 lttng_destroy_context(chan
->ctx
);
367 * Supports event creation while tracing session is active.
369 struct ltt_event
*ltt_event_create(struct ltt_channel
*chan
,
370 struct lttng_ust_event
*event_param
,
373 struct ltt_event
*event
;
376 pthread_mutex_lock(&sessions_mutex
);
377 if (chan
->used_event_id
== -1UL)
380 * This is O(n^2) (for each event, the loop is called at event
381 * creation). Might require a hash if we have lots of events.
383 cds_list_for_each_entry(event
, &chan
->session
->events
, list
)
384 if (event
->desc
&& !strcmp(event
->desc
->name
, event_param
->name
))
386 event
= zmalloc(sizeof(struct ltt_event
));
390 event
->filter
= filter
;
392 * used_event_id counts the maximum number of event IDs that can
393 * register if all probes register.
395 chan
->used_event_id
++;
397 event
->instrumentation
= event_param
->instrumentation
;
398 /* Populate ltt_event structure before tracepoint registration. */
400 switch (event_param
->instrumentation
) {
401 case LTTNG_UST_TRACEPOINT
:
402 event
->desc
= ltt_event_get(event_param
->name
);
404 ret
= __tracepoint_probe_register(event_param
->name
,
405 event
->desc
->probe_callback
,
409 event
->id
= chan
->free_event_id
++;
412 * If the probe is not present, event->desc stays NULL,
413 * waiting for the probe to register, and the event->id
416 ret
= add_pending_probe(event
, event_param
->name
);
418 goto add_pending_error
;
425 ret
= _ltt_event_metadata_statedump(chan
->session
, chan
, event
);
427 goto statedump_error
;
429 cds_list_add(&event
->list
, &chan
->session
->events
);
430 pthread_mutex_unlock(&sessions_mutex
);
435 WARN_ON_ONCE(__tracepoint_probe_unregister(event_param
->name
,
436 event
->desc
->probe_callback
,
438 ltt_event_put(event
->desc
);
446 pthread_mutex_unlock(&sessions_mutex
);
451 * Only used internally at session destruction.
453 int _ltt_event_unregister(struct ltt_event
*event
)
457 switch (event
->instrumentation
) {
458 case LTTNG_UST_TRACEPOINT
:
460 ret
= __tracepoint_probe_unregister(event
->desc
->name
,
461 event
->desc
->probe_callback
,
466 remove_pending_probe(event
->pending_probe
);
477 * Only used internally at session destruction.
480 void _ltt_event_destroy(struct ltt_event
*event
)
482 switch (event
->instrumentation
) {
483 case LTTNG_UST_TRACEPOINT
:
485 ltt_event_put(event
->desc
);
491 cds_list_del(&event
->list
);
492 lttng_destroy_context(event
->ctx
);
497 * We have exclusive access to our metadata buffer (protected by the
498 * sessions_mutex), so we can do racy operations such as looking for
499 * remaining space left in packet and write, since mutual exclusion
500 * protects us from concurrent writes.
502 int lttng_metadata_printf(struct ltt_session
*session
,
503 const char *fmt
, ...)
505 struct lib_ring_buffer_ctx ctx
;
506 struct ltt_channel
*chan
= session
->metadata
;
508 int ret
= 0, waitret
;
509 size_t len
, reserve_len
, pos
;
512 WARN_ON_ONCE(!CMM_ACCESS_ONCE(session
->active
));
515 ret
= vasprintf(&str
, fmt
, ap
);
523 for (pos
= 0; pos
< len
; pos
+= reserve_len
) {
524 reserve_len
= min_t(size_t,
525 chan
->ops
->packet_avail_size(chan
->chan
, chan
->handle
),
527 lib_ring_buffer_ctx_init(&ctx
, chan
->chan
, NULL
, reserve_len
,
528 sizeof(char), -1, chan
->handle
);
530 * We don't care about metadata buffer's records lost
531 * count, because we always retry here. Report error if
532 * we need to bail out after timeout or being
535 waitret
= wait_cond_interruptible_timeout(
537 ret
= chan
->ops
->event_reserve(&ctx
, 0);
538 ret
!= -ENOBUFS
|| !ret
;
540 LTTNG_METADATA_TIMEOUT_MSEC
);
541 if (waitret
== -ETIMEDOUT
|| waitret
== -EINTR
|| ret
) {
542 DBG("LTTng: Failure to write metadata to buffers (%s)\n",
543 waitret
== -EINTR
? "interrupted" :
544 (ret
== -ENOBUFS
? "timeout" : "I/O error"));
545 if (waitret
== -EINTR
)
549 chan
->ops
->event_write(&ctx
, &str
[pos
], reserve_len
);
550 chan
->ops
->event_commit(&ctx
);
558 int _ltt_field_statedump(struct ltt_session
*session
,
559 const struct lttng_event_field
*field
)
563 switch (field
->type
.atype
) {
565 ret
= lttng_metadata_printf(session
,
566 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } %s;\n",
567 field
->type
.u
.basic
.integer
.size
,
568 field
->type
.u
.basic
.integer
.alignment
,
569 field
->type
.u
.basic
.integer
.signedness
,
570 (field
->type
.u
.basic
.integer
.encoding
== lttng_encode_none
)
572 : (field
->type
.u
.basic
.integer
.encoding
== lttng_encode_UTF8
)
575 field
->type
.u
.basic
.integer
.base
,
577 field
->type
.u
.basic
.integer
.reverse_byte_order
? " byte_order = le;" : "",
579 field
->type
.u
.basic
.integer
.reverse_byte_order
? " byte_order = be;" : "",
584 ret
= lttng_metadata_printf(session
,
585 " floating_point { exp_dig = %u; mant_dig = %u; align = %u; } %s;\n",
586 field
->type
.u
.basic
._float
.exp_dig
,
587 field
->type
.u
.basic
._float
.mant_dig
,
588 field
->type
.u
.basic
._float
.alignment
,
590 field
->type
.u
.basic
.integer
.reverse_byte_order
? " byte_order = le;" : "",
592 field
->type
.u
.basic
.integer
.reverse_byte_order
? " byte_order = be;" : "",
597 ret
= lttng_metadata_printf(session
,
599 field
->type
.u
.basic
.enumeration
.name
,
604 const struct lttng_basic_type
*elem_type
;
606 elem_type
= &field
->type
.u
.array
.elem_type
;
607 ret
= lttng_metadata_printf(session
,
608 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } %s[%u];\n",
609 elem_type
->u
.basic
.integer
.size
,
610 elem_type
->u
.basic
.integer
.alignment
,
611 elem_type
->u
.basic
.integer
.signedness
,
612 (elem_type
->u
.basic
.integer
.encoding
== lttng_encode_none
)
614 : (elem_type
->u
.basic
.integer
.encoding
== lttng_encode_UTF8
)
617 elem_type
->u
.basic
.integer
.base
,
619 elem_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = le;" : "",
621 elem_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = be;" : "",
623 field
->name
, field
->type
.u
.array
.length
);
628 const struct lttng_basic_type
*elem_type
;
629 const struct lttng_basic_type
*length_type
;
631 elem_type
= &field
->type
.u
.sequence
.elem_type
;
632 length_type
= &field
->type
.u
.sequence
.length_type
;
633 ret
= lttng_metadata_printf(session
,
634 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } __%s_length;\n",
635 length_type
->u
.basic
.integer
.size
,
636 (unsigned int) length_type
->u
.basic
.integer
.alignment
,
637 length_type
->u
.basic
.integer
.signedness
,
638 (length_type
->u
.basic
.integer
.encoding
== lttng_encode_none
)
640 : ((length_type
->u
.basic
.integer
.encoding
== lttng_encode_UTF8
)
643 length_type
->u
.basic
.integer
.base
,
645 length_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = le;" : "",
647 length_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = be;" : "",
653 ret
= lttng_metadata_printf(session
,
654 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } %s[ __%s_length ];\n",
655 elem_type
->u
.basic
.integer
.size
,
656 (unsigned int) elem_type
->u
.basic
.integer
.alignment
,
657 elem_type
->u
.basic
.integer
.signedness
,
658 (elem_type
->u
.basic
.integer
.encoding
== lttng_encode_none
)
660 : ((elem_type
->u
.basic
.integer
.encoding
== lttng_encode_UTF8
)
663 elem_type
->u
.basic
.integer
.base
,
665 elem_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = le;" : "",
667 elem_type
->u
.basic
.integer
.reverse_byte_order
? " byte_order = be;" : "",
675 /* Default encoding is UTF8 */
676 ret
= lttng_metadata_printf(session
,
678 field
->type
.u
.basic
.string
.encoding
== lttng_encode_ASCII
?
679 " { encoding = ASCII; }" : "",
690 int _ltt_context_metadata_statedump(struct ltt_session
*session
,
691 struct lttng_ctx
*ctx
)
698 for (i
= 0; i
< ctx
->nr_fields
; i
++) {
699 const struct lttng_ctx_field
*field
= &ctx
->fields
[i
];
701 ret
= _ltt_field_statedump(session
, &field
->event_field
);
709 int _ltt_fields_metadata_statedump(struct ltt_session
*session
,
710 struct ltt_event
*event
)
712 const struct lttng_event_desc
*desc
= event
->desc
;
716 for (i
= 0; i
< desc
->nr_fields
; i
++) {
717 const struct lttng_event_field
*field
= &desc
->fields
[i
];
719 ret
= _ltt_field_statedump(session
, field
);
727 int _ltt_event_metadata_statedump(struct ltt_session
*session
,
728 struct ltt_channel
*chan
,
729 struct ltt_event
*event
)
733 if (event
->metadata_dumped
|| !CMM_ACCESS_ONCE(session
->active
))
735 if (chan
== session
->metadata
)
738 * Don't print events for which probe load is pending.
743 ret
= lttng_metadata_printf(session
,
747 " stream_id = %u;\n",
755 ret
= lttng_metadata_printf(session
,
756 " context := struct {\n");
760 ret
= _ltt_context_metadata_statedump(session
, event
->ctx
);
764 ret
= lttng_metadata_printf(session
,
770 ret
= lttng_metadata_printf(session
,
771 " fields := struct {\n"
776 ret
= _ltt_fields_metadata_statedump(session
, event
);
781 * LTTng space reservation can only reserve multiples of the
784 ret
= lttng_metadata_printf(session
,
790 event
->metadata_dumped
= 1;
797 int _ltt_channel_metadata_statedump(struct ltt_session
*session
,
798 struct ltt_channel
*chan
)
802 if (chan
->metadata_dumped
|| !CMM_ACCESS_ONCE(session
->active
))
804 if (chan
== session
->metadata
)
807 WARN_ON_ONCE(!chan
->header_type
);
808 ret
= lttng_metadata_printf(session
,
811 " event.header := %s;\n"
812 " packet.context := struct packet_context;\n",
814 chan
->header_type
== 1 ? "struct event_header_compact" :
815 "struct event_header_large");
820 ret
= lttng_metadata_printf(session
,
821 " event.context := struct {\n");
825 ret
= _ltt_context_metadata_statedump(session
, chan
->ctx
);
829 ret
= lttng_metadata_printf(session
,
835 ret
= lttng_metadata_printf(session
,
838 chan
->metadata_dumped
= 1;
844 int _ltt_stream_packet_context_declare(struct ltt_session
*session
)
846 return lttng_metadata_printf(session
,
847 "struct packet_context {\n"
848 " uint64_t timestamp_begin;\n"
849 " uint64_t timestamp_end;\n"
850 " uint32_t events_discarded;\n"
851 " uint32_t content_size;\n"
852 " uint32_t packet_size;\n"
853 " uint32_t cpu_id;\n"
861 * id 31 is reserved to indicate an extended header.
864 * id: range: 0 - 65534.
865 * id 65535 is reserved to indicate an extended header.
868 int _ltt_event_header_declare(struct ltt_session
*session
)
870 return lttng_metadata_printf(session
,
871 "struct event_header_compact {\n"
872 " enum : uint5_t { compact = 0 ... 30, extended = 31 } id;\n"
875 " uint27_t timestamp;\n"
879 " uint64_t timestamp;\n"
884 "struct event_header_large {\n"
885 " enum : uint16_t { compact = 0 ... 65534, extended = 65535 } id;\n"
888 " uint32_t timestamp;\n"
892 " uint64_t timestamp;\n"
896 lttng_alignof(uint32_t) * CHAR_BIT
,
897 lttng_alignof(uint16_t) * CHAR_BIT
902 * Output metadata into this session's metadata buffers.
905 int _ltt_session_metadata_statedump(struct ltt_session
*session
)
907 unsigned char *uuid_c
= session
->uuid
;
909 struct ltt_channel
*chan
;
910 struct ltt_event
*event
;
913 if (!CMM_ACCESS_ONCE(session
->active
))
915 if (session
->metadata_dumped
)
917 if (!session
->metadata
) {
918 DBG("LTTng: attempt to start tracing, but metadata channel is not found. Operation abort.\n");
922 snprintf(uuid_s
, sizeof(uuid_s
),
923 "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
924 uuid_c
[0], uuid_c
[1], uuid_c
[2], uuid_c
[3],
925 uuid_c
[4], uuid_c
[5], uuid_c
[6], uuid_c
[7],
926 uuid_c
[8], uuid_c
[9], uuid_c
[10], uuid_c
[11],
927 uuid_c
[12], uuid_c
[13], uuid_c
[14], uuid_c
[15]);
929 ret
= lttng_metadata_printf(session
,
930 "typealias integer { size = 8; align = %u; signed = false; } := uint8_t;\n"
931 "typealias integer { size = 16; align = %u; signed = false; } := uint16_t;\n"
932 "typealias integer { size = 32; align = %u; signed = false; } := uint32_t;\n"
933 "typealias integer { size = 64; align = %u; signed = false; } := uint64_t;\n"
934 "typealias integer { size = 5; align = 1; signed = false; } := uint5_t;\n"
935 "typealias integer { size = 27; align = 1; signed = false; } := uint27_t;\n"
941 " byte_order = %s;\n"
942 " packet.header := struct {\n"
944 " uint8_t uuid[16];\n"
945 " uint32_t stream_id;\n"
948 lttng_alignof(uint8_t) * CHAR_BIT
,
949 lttng_alignof(uint16_t) * CHAR_BIT
,
950 lttng_alignof(uint32_t) * CHAR_BIT
,
951 lttng_alignof(uint64_t) * CHAR_BIT
,
964 ret
= _ltt_stream_packet_context_declare(session
);
968 ret
= _ltt_event_header_declare(session
);
973 cds_list_for_each_entry(chan
, &session
->chan
, list
) {
974 ret
= _ltt_channel_metadata_statedump(session
, chan
);
979 cds_list_for_each_entry(event
, &session
->events
, list
) {
980 ret
= _ltt_event_metadata_statedump(session
, event
->chan
, event
);
984 session
->metadata_dumped
= 1;
990 * ltt_transport_register - LTT transport registration
991 * @transport: transport structure
993 * Registers a transport which can be used as output to extract the data out of
996 void ltt_transport_register(struct ltt_transport
*transport
)
998 pthread_mutex_lock(&sessions_mutex
);
999 cds_list_add_tail(&transport
->node
, <t_transport_list
);
1000 pthread_mutex_unlock(&sessions_mutex
);
1004 * ltt_transport_unregister - LTT transport unregistration
1005 * @transport: transport structure
1007 void ltt_transport_unregister(struct ltt_transport
*transport
)
1009 pthread_mutex_lock(&sessions_mutex
);
1010 cds_list_del(&transport
->node
);
1011 pthread_mutex_unlock(&sessions_mutex
);
1014 void ltt_events_exit(void)
1016 struct ltt_session
*session
, *tmpsession
;
1018 cds_list_for_each_entry_safe(session
, tmpsession
, &sessions
, list
)
1019 ltt_session_destroy(session
);