2 * lttng-ring-buffer-client.h
4 * LTTng lib ring buffer client template.
6 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; only
11 * version 2.1 of the License.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #include <lttng/ust-events.h>
25 #include "lttng/bitfield.h"
27 #include "lttng-tracer.h"
28 #include "../libringbuffer/frontend_types.h"
30 #define LTTNG_COMPACT_EVENT_BITS 5
31 #define LTTNG_COMPACT_TSC_BITS 27
34 * Keep the natural field alignment for _each field_ within this structure if
35 * you ever add/remove a field from this header. Packed attribute is not used
36 * because gcc generates poor code on at least powerpc and mips. Don't ever
37 * let gcc add padding between the structure elements.
40 struct packet_header
{
41 /* Trace packet header */
44 * contains endianness information.
46 uint8_t uuid
[LTTNG_UST_UUID_LEN
];
48 uint64_t stream_instance_id
;
51 /* Stream packet context */
52 uint64_t timestamp_begin
; /* Cycle count at subbuffer start */
53 uint64_t timestamp_end
; /* Cycle count at subbuffer end */
54 uint64_t content_size
; /* Size of data in subbuffer */
55 uint64_t packet_size
; /* Subbuffer size (include padding) */
56 unsigned long events_discarded
; /*
57 * Events lost in this subbuffer since
58 * the beginning of the trace.
61 uint32_t cpu_id
; /* CPU id associated with stream */
62 uint8_t header_end
; /* End of header */
67 static inline uint64_t lib_ring_buffer_clock_read(struct channel
*chan
)
69 return trace_clock_read64();
73 size_t ctx_get_size(size_t offset
, struct lttng_ctx
*ctx
)
76 size_t orig_offset
= offset
;
80 offset
+= lib_ring_buffer_align(offset
, ctx
->largest_align
);
81 for (i
= 0; i
< ctx
->nr_fields
; i
++)
82 offset
+= ctx
->fields
[i
].get_size(&ctx
->fields
[i
], offset
);
83 return offset
- orig_offset
;
87 void ctx_record(struct lttng_ust_lib_ring_buffer_ctx
*bufctx
,
88 struct lttng_channel
*chan
,
89 struct lttng_ctx
*ctx
)
95 lib_ring_buffer_align_ctx(bufctx
, ctx
->largest_align
);
96 for (i
= 0; i
< ctx
->nr_fields
; i
++)
97 ctx
->fields
[i
].record(&ctx
->fields
[i
], bufctx
, chan
);
101 * record_header_size - Calculate the header size and padding necessary.
102 * @config: ring buffer instance configuration
104 * @offset: offset in the write buffer
105 * @pre_header_padding: padding to add before the header (output)
106 * @ctx: reservation context
108 * Returns the event header size (including padding).
110 * The payload must itself determine its own alignment from the biggest type it
114 size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config
*config
,
115 struct channel
*chan
, size_t offset
,
116 size_t *pre_header_padding
,
117 struct lttng_ust_lib_ring_buffer_ctx
*ctx
)
119 struct lttng_channel
*lttng_chan
= channel_get_private(chan
);
120 struct lttng_event
*event
= ctx
->priv
;
121 size_t orig_offset
= offset
;
124 switch (lttng_chan
->header_type
) {
125 case 1: /* compact */
126 padding
= lib_ring_buffer_align(offset
, lttng_alignof(uint32_t));
128 if (!(ctx
->rflags
& (RING_BUFFER_RFLAG_FULL_TSC
| LTTNG_RFLAG_EXTENDED
))) {
129 offset
+= sizeof(uint32_t); /* id and timestamp */
131 /* Minimum space taken by LTTNG_COMPACT_EVENT_BITS id */
132 offset
+= (LTTNG_COMPACT_EVENT_BITS
+ CHAR_BIT
- 1) / CHAR_BIT
;
133 /* Align extended struct on largest member */
134 offset
+= lib_ring_buffer_align(offset
, lttng_alignof(uint64_t));
135 offset
+= sizeof(uint32_t); /* id */
136 offset
+= lib_ring_buffer_align(offset
, lttng_alignof(uint64_t));
137 offset
+= sizeof(uint64_t); /* timestamp */
141 padding
= lib_ring_buffer_align(offset
, lttng_alignof(uint16_t));
143 offset
+= sizeof(uint16_t);
144 if (!(ctx
->rflags
& (RING_BUFFER_RFLAG_FULL_TSC
| LTTNG_RFLAG_EXTENDED
))) {
145 offset
+= lib_ring_buffer_align(offset
, lttng_alignof(uint32_t));
146 offset
+= sizeof(uint32_t); /* timestamp */
148 /* Align extended struct on largest member */
149 offset
+= lib_ring_buffer_align(offset
, lttng_alignof(uint64_t));
150 offset
+= sizeof(uint32_t); /* id */
151 offset
+= lib_ring_buffer_align(offset
, lttng_alignof(uint64_t));
152 offset
+= sizeof(uint64_t); /* timestamp */
159 offset
+= ctx_get_size(offset
, event
->ctx
);
160 offset
+= ctx_get_size(offset
, lttng_chan
->ctx
);
162 *pre_header_padding
= padding
;
163 return offset
- orig_offset
;
166 #include "../libringbuffer/api.h"
167 #include "lttng-rb-clients.h"
170 void lttng_write_event_header_slow(const struct lttng_ust_lib_ring_buffer_config
*config
,
171 struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
175 * lttng_write_event_header
177 * Writes the event header to the offset (already aligned on 32-bits).
179 * @config: ring buffer instance configuration
180 * @ctx: reservation context
181 * @event_id: event ID
184 void lttng_write_event_header(const struct lttng_ust_lib_ring_buffer_config
*config
,
185 struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
188 struct lttng_channel
*lttng_chan
= channel_get_private(ctx
->chan
);
189 struct lttng_stack_ctx
*lttng_ctx
= ctx
->priv2
;
191 if (caa_unlikely(ctx
->rflags
))
194 switch (lttng_chan
->header_type
) {
195 case 1: /* compact */
197 uint32_t id_time
= 0;
199 bt_bitfield_write(&id_time
, uint32_t,
201 LTTNG_COMPACT_EVENT_BITS
,
203 bt_bitfield_write(&id_time
, uint32_t,
204 LTTNG_COMPACT_EVENT_BITS
,
205 LTTNG_COMPACT_TSC_BITS
,
207 lib_ring_buffer_write(config
, ctx
, &id_time
, sizeof(id_time
));
212 uint32_t timestamp
= (uint32_t) ctx
->tsc
;
213 uint16_t id
= event_id
;
215 lib_ring_buffer_write(config
, ctx
, &id
, sizeof(id
));
216 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint32_t));
217 lib_ring_buffer_write(config
, ctx
, ×tamp
, sizeof(timestamp
));
224 ctx_record(ctx
, lttng_chan
, lttng_ctx
->chan_ctx
);
225 ctx_record(ctx
, lttng_chan
, lttng_ctx
->event_ctx
);
226 lib_ring_buffer_align_ctx(ctx
, ctx
->largest_align
);
231 lttng_write_event_header_slow(config
, ctx
, event_id
);
235 void lttng_write_event_header_slow(const struct lttng_ust_lib_ring_buffer_config
*config
,
236 struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
239 struct lttng_channel
*lttng_chan
= channel_get_private(ctx
->chan
);
240 struct lttng_stack_ctx
*lttng_ctx
= ctx
->priv2
;
242 switch (lttng_chan
->header_type
) {
243 case 1: /* compact */
244 if (!(ctx
->rflags
& (RING_BUFFER_RFLAG_FULL_TSC
| LTTNG_RFLAG_EXTENDED
))) {
245 uint32_t id_time
= 0;
247 bt_bitfield_write(&id_time
, uint32_t,
249 LTTNG_COMPACT_EVENT_BITS
,
251 bt_bitfield_write(&id_time
, uint32_t,
252 LTTNG_COMPACT_EVENT_BITS
,
253 LTTNG_COMPACT_TSC_BITS
,
255 lib_ring_buffer_write(config
, ctx
, &id_time
, sizeof(id_time
));
258 uint64_t timestamp
= ctx
->tsc
;
260 bt_bitfield_write(&id
, uint8_t,
262 LTTNG_COMPACT_EVENT_BITS
,
264 lib_ring_buffer_write(config
, ctx
, &id
, sizeof(id
));
265 /* Align extended struct on largest member */
266 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint64_t));
267 lib_ring_buffer_write(config
, ctx
, &event_id
, sizeof(event_id
));
268 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint64_t));
269 lib_ring_buffer_write(config
, ctx
, ×tamp
, sizeof(timestamp
));
274 if (!(ctx
->rflags
& (RING_BUFFER_RFLAG_FULL_TSC
| LTTNG_RFLAG_EXTENDED
))) {
275 uint32_t timestamp
= (uint32_t) ctx
->tsc
;
276 uint16_t id
= event_id
;
278 lib_ring_buffer_write(config
, ctx
, &id
, sizeof(id
));
279 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint32_t));
280 lib_ring_buffer_write(config
, ctx
, ×tamp
, sizeof(timestamp
));
283 uint64_t timestamp
= ctx
->tsc
;
285 lib_ring_buffer_write(config
, ctx
, &id
, sizeof(id
));
286 /* Align extended struct on largest member */
287 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint64_t));
288 lib_ring_buffer_write(config
, ctx
, &event_id
, sizeof(event_id
));
289 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint64_t));
290 lib_ring_buffer_write(config
, ctx
, ×tamp
, sizeof(timestamp
));
297 ctx_record(ctx
, lttng_chan
, lttng_ctx
->chan_ctx
);
298 ctx_record(ctx
, lttng_chan
, lttng_ctx
->event_ctx
);
299 lib_ring_buffer_align_ctx(ctx
, ctx
->largest_align
);
302 static const struct lttng_ust_lib_ring_buffer_config client_config
;
304 static uint64_t client_ring_buffer_clock_read(struct channel
*chan
)
306 return lib_ring_buffer_clock_read(chan
);
310 size_t client_record_header_size(const struct lttng_ust_lib_ring_buffer_config
*config
,
311 struct channel
*chan
, size_t offset
,
312 size_t *pre_header_padding
,
313 struct lttng_ust_lib_ring_buffer_ctx
*ctx
)
315 return record_header_size(config
, chan
, offset
,
316 pre_header_padding
, ctx
);
320 * client_packet_header_size - called on buffer-switch to a new sub-buffer
322 * Return header size without padding after the structure. Don't use packed
323 * structure because gcc generates inefficient code on some architectures
326 static size_t client_packet_header_size(void)
328 return offsetof(struct packet_header
, ctx
.header_end
);
331 static void client_buffer_begin(struct lttng_ust_lib_ring_buffer
*buf
, uint64_t tsc
,
332 unsigned int subbuf_idx
,
333 struct lttng_ust_shm_handle
*handle
)
335 struct channel
*chan
= shmp(handle
, buf
->backend
.chan
);
336 struct packet_header
*header
=
337 (struct packet_header
*)
338 lib_ring_buffer_offset_address(&buf
->backend
,
339 subbuf_idx
* chan
->backend
.subbuf_size
,
341 struct lttng_channel
*lttng_chan
= channel_get_private(chan
);
346 header
->magic
= CTF_MAGIC_NUMBER
;
347 memcpy(header
->uuid
, lttng_chan
->uuid
, sizeof(lttng_chan
->uuid
));
348 header
->stream_id
= lttng_chan
->id
;
349 header
->stream_instance_id
= buf
->backend
.cpu
;
350 header
->ctx
.timestamp_begin
= tsc
;
351 header
->ctx
.timestamp_end
= 0;
352 header
->ctx
.content_size
= ~0ULL; /* for debugging */
353 header
->ctx
.packet_size
= ~0ULL;
354 header
->ctx
.events_discarded
= 0;
355 header
->ctx
.cpu_id
= buf
->backend
.cpu
;
359 * offset is assumed to never be 0 here : never deliver a completely empty
360 * subbuffer. data_size is between 1 and subbuf_size.
362 static void client_buffer_end(struct lttng_ust_lib_ring_buffer
*buf
, uint64_t tsc
,
363 unsigned int subbuf_idx
, unsigned long data_size
,
364 struct lttng_ust_shm_handle
*handle
)
366 struct channel
*chan
= shmp(handle
, buf
->backend
.chan
);
367 struct packet_header
*header
=
368 (struct packet_header
*)
369 lib_ring_buffer_offset_address(&buf
->backend
,
370 subbuf_idx
* chan
->backend
.subbuf_size
,
372 unsigned long records_lost
= 0;
377 header
->ctx
.timestamp_end
= tsc
;
378 header
->ctx
.content_size
=
379 (uint64_t) data_size
* CHAR_BIT
; /* in bits */
380 header
->ctx
.packet_size
=
381 (uint64_t) PAGE_ALIGN(data_size
) * CHAR_BIT
; /* in bits */
383 records_lost
+= lib_ring_buffer_get_records_lost_full(&client_config
, buf
);
384 records_lost
+= lib_ring_buffer_get_records_lost_wrap(&client_config
, buf
);
385 records_lost
+= lib_ring_buffer_get_records_lost_big(&client_config
, buf
);
386 header
->ctx
.events_discarded
= records_lost
;
389 static int client_buffer_create(struct lttng_ust_lib_ring_buffer
*buf
, void *priv
,
390 int cpu
, const char *name
, struct lttng_ust_shm_handle
*handle
)
395 static void client_buffer_finalize(struct lttng_ust_lib_ring_buffer
*buf
, void *priv
, int cpu
, struct lttng_ust_shm_handle
*handle
)
399 static void client_content_size_field(const struct lttng_ust_lib_ring_buffer_config
*config
,
400 size_t *offset
, size_t *length
)
402 *offset
= offsetof(struct packet_header
, ctx
.content_size
);
403 *length
= sizeof(((struct packet_header
*) NULL
)->ctx
.content_size
);
406 static void client_packet_size_field(const struct lttng_ust_lib_ring_buffer_config
*config
,
407 size_t *offset
, size_t *length
)
409 *offset
= offsetof(struct packet_header
, ctx
.packet_size
);
410 *length
= sizeof(((struct packet_header
*) NULL
)->ctx
.packet_size
);
413 static struct packet_header
*client_packet_header(struct lttng_ust_lib_ring_buffer
*buf
,
414 struct lttng_ust_shm_handle
*handle
)
416 return lib_ring_buffer_read_offset_address(&buf
->backend
, 0, handle
);
419 static int client_timestamp_begin(struct lttng_ust_lib_ring_buffer
*buf
,
420 struct lttng_ust_shm_handle
*handle
,
421 uint64_t *timestamp_begin
)
423 struct packet_header
*header
;
425 header
= client_packet_header(buf
, handle
);
428 *timestamp_begin
= header
->ctx
.timestamp_begin
;
432 static int client_timestamp_end(struct lttng_ust_lib_ring_buffer
*buf
,
433 struct lttng_ust_shm_handle
*handle
,
434 uint64_t *timestamp_end
)
436 struct packet_header
*header
;
438 header
= client_packet_header(buf
, handle
);
441 *timestamp_end
= header
->ctx
.timestamp_end
;
445 static int client_events_discarded(struct lttng_ust_lib_ring_buffer
*buf
,
446 struct lttng_ust_shm_handle
*handle
,
447 uint64_t *events_discarded
)
449 struct packet_header
*header
;
451 header
= client_packet_header(buf
, handle
);
454 *events_discarded
= header
->ctx
.events_discarded
;
458 static int client_content_size(struct lttng_ust_lib_ring_buffer
*buf
,
459 struct lttng_ust_shm_handle
*handle
,
460 uint64_t *content_size
)
462 struct packet_header
*header
;
464 header
= client_packet_header(buf
, handle
);
467 *content_size
= header
->ctx
.content_size
;
471 static int client_packet_size(struct lttng_ust_lib_ring_buffer
*buf
,
472 struct lttng_ust_shm_handle
*handle
,
473 uint64_t *packet_size
)
475 struct packet_header
*header
;
477 header
= client_packet_header(buf
, handle
);
480 *packet_size
= header
->ctx
.packet_size
;
484 static int client_stream_id(struct lttng_ust_lib_ring_buffer
*buf
,
485 struct lttng_ust_shm_handle
*handle
,
488 struct packet_header
*header
;
490 header
= client_packet_header(buf
, handle
);
493 *stream_id
= header
->stream_id
;
497 static int client_current_timestamp(struct lttng_ust_lib_ring_buffer
*buf
,
498 struct lttng_ust_shm_handle
*handle
,
501 struct channel
*chan
;
503 chan
= shmp(handle
, handle
->chan
);
504 *ts
= client_ring_buffer_clock_read(chan
);
510 struct lttng_ust_client_lib_ring_buffer_client_cb client_cb
= {
512 .ring_buffer_clock_read
= client_ring_buffer_clock_read
,
513 .record_header_size
= client_record_header_size
,
514 .subbuffer_header_size
= client_packet_header_size
,
515 .buffer_begin
= client_buffer_begin
,
516 .buffer_end
= client_buffer_end
,
517 .buffer_create
= client_buffer_create
,
518 .buffer_finalize
= client_buffer_finalize
,
519 .content_size_field
= client_content_size_field
,
520 .packet_size_field
= client_packet_size_field
,
522 .timestamp_begin
= client_timestamp_begin
,
523 .timestamp_end
= client_timestamp_end
,
524 .events_discarded
= client_events_discarded
,
525 .content_size
= client_content_size
,
526 .packet_size
= client_packet_size
,
527 .stream_id
= client_stream_id
,
528 .current_timestamp
= client_current_timestamp
,
531 static const struct lttng_ust_lib_ring_buffer_config client_config
= {
532 .cb
.ring_buffer_clock_read
= client_ring_buffer_clock_read
,
533 .cb
.record_header_size
= client_record_header_size
,
534 .cb
.subbuffer_header_size
= client_packet_header_size
,
535 .cb
.buffer_begin
= client_buffer_begin
,
536 .cb
.buffer_end
= client_buffer_end
,
537 .cb
.buffer_create
= client_buffer_create
,
538 .cb
.buffer_finalize
= client_buffer_finalize
,
539 .cb
.content_size_field
= client_content_size_field
,
540 .cb
.packet_size_field
= client_packet_size_field
,
542 .tsc_bits
= LTTNG_COMPACT_TSC_BITS
,
543 .alloc
= RING_BUFFER_ALLOC_PER_CPU
,
544 .sync
= RING_BUFFER_SYNC_GLOBAL
,
545 .mode
= RING_BUFFER_MODE_TEMPLATE
,
546 .backend
= RING_BUFFER_PAGE
,
547 .output
= RING_BUFFER_MMAP
,
548 .oops
= RING_BUFFER_OOPS_CONSISTENCY
,
549 .ipi
= RING_BUFFER_NO_IPI_BARRIER
,
550 .wakeup
= LTTNG_CLIENT_WAKEUP
,
551 .client_type
= LTTNG_CLIENT_TYPE
,
553 .cb_ptr
= &client_cb
.parent
,
556 const struct lttng_ust_client_lib_ring_buffer_client_cb
*LTTNG_CLIENT_CALLBACKS
= &client_cb
;
559 struct lttng_channel
*_channel_create(const char *name
,
561 size_t subbuf_size
, size_t num_subbuf
,
562 unsigned int switch_timer_interval
,
563 unsigned int read_timer_interval
,
566 const int *stream_fds
, int nr_stream_fds
)
568 struct lttng_channel chan_priv_init
;
569 struct lttng_ust_shm_handle
*handle
;
570 struct lttng_channel
*lttng_chan
;
573 memset(&chan_priv_init
, 0, sizeof(chan_priv_init
));
574 memcpy(chan_priv_init
.uuid
, uuid
, LTTNG_UST_UUID_LEN
);
575 chan_priv_init
.id
= chan_id
;
576 handle
= channel_create(&client_config
, name
,
577 &priv
, __alignof__(struct lttng_channel
),
578 sizeof(struct lttng_channel
),
580 buf_addr
, subbuf_size
, num_subbuf
,
581 switch_timer_interval
, read_timer_interval
,
582 stream_fds
, nr_stream_fds
);
586 lttng_chan
->handle
= handle
;
587 lttng_chan
->chan
= shmp(handle
, handle
->chan
);
592 void lttng_channel_destroy(struct lttng_channel
*chan
)
594 channel_destroy(chan
->chan
, chan
->handle
, 1);
598 int lttng_event_reserve(struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
601 struct lttng_channel
*lttng_chan
= channel_get_private(ctx
->chan
);
604 cpu
= lib_ring_buffer_get_cpu(&client_config
);
609 switch (lttng_chan
->header_type
) {
610 case 1: /* compact */
612 ctx
->rflags
|= LTTNG_RFLAG_EXTENDED
;
615 if (event_id
> 65534)
616 ctx
->rflags
|= LTTNG_RFLAG_EXTENDED
;
622 ret
= lib_ring_buffer_reserve(&client_config
, ctx
);
625 lttng_write_event_header(&client_config
, ctx
, event_id
);
628 lib_ring_buffer_put_cpu(&client_config
);
633 void lttng_event_commit(struct lttng_ust_lib_ring_buffer_ctx
*ctx
)
635 lib_ring_buffer_commit(&client_config
, ctx
);
636 lib_ring_buffer_put_cpu(&client_config
);
640 void lttng_event_write(struct lttng_ust_lib_ring_buffer_ctx
*ctx
, const void *src
,
643 lib_ring_buffer_write(&client_config
, ctx
, src
, len
);
647 void lttng_event_strcpy(struct lttng_ust_lib_ring_buffer_ctx
*ctx
, const char *src
,
650 lib_ring_buffer_strcpy(&client_config
, ctx
, src
, len
, '#');
655 wait_queue_head_t
*lttng_get_reader_wait_queue(struct channel
*chan
)
657 return &chan
->read_wait
;
661 wait_queue_head_t
*lttng_get_hp_wait_queue(struct channel
*chan
)
663 return &chan
->hp_wait
;
668 int lttng_is_finalized(struct channel
*chan
)
670 return lib_ring_buffer_channel_is_finalized(chan
);
674 int lttng_is_disabled(struct channel
*chan
)
676 return lib_ring_buffer_channel_is_disabled(chan
);
680 int lttng_flush_buffer(struct channel
*chan
, struct lttng_ust_shm_handle
*handle
)
682 struct lttng_ust_lib_ring_buffer
*buf
;
685 for_each_channel_cpu(cpu
, chan
) {
686 int shm_fd
, wait_fd
, wakeup_fd
;
687 uint64_t memory_map_size
;
689 buf
= channel_get_ring_buffer(&client_config
, chan
,
690 cpu
, handle
, &shm_fd
, &wait_fd
,
691 &wakeup_fd
, &memory_map_size
);
692 lib_ring_buffer_switch(&client_config
, buf
,
693 SWITCH_ACTIVE
, handle
);
698 static struct lttng_transport lttng_relay_transport
= {
699 .name
= "relay-" RING_BUFFER_MODE_TEMPLATE_STRING
"-mmap",
701 .channel_create
= _channel_create
,
702 .channel_destroy
= lttng_channel_destroy
,
704 .event_reserve
= lttng_event_reserve
,
705 .event_commit
= lttng_event_commit
,
706 .event_write
= lttng_event_write
,
707 .packet_avail_size
= NULL
, /* Would be racy anyway */
708 //.get_reader_wait_queue = lttng_get_reader_wait_queue,
709 //.get_hp_wait_queue = lttng_get_hp_wait_queue,
710 .is_finalized
= lttng_is_finalized
,
711 .is_disabled
= lttng_is_disabled
,
712 .flush_buffer
= lttng_flush_buffer
,
713 .event_strcpy
= lttng_event_strcpy
,
715 .client_config
= &client_config
,
718 void RING_BUFFER_MODE_TEMPLATE_INIT(void)
720 DBG("LTT : ltt ring buffer client \"%s\" init\n",
721 "relay-" RING_BUFFER_MODE_TEMPLATE_STRING
"-mmap");
722 lttng_transport_register(<tng_relay_transport
);
725 void RING_BUFFER_MODE_TEMPLATE_EXIT(void)
727 DBG("LTT : ltt ring buffer client \"%s\" exit\n",
728 "relay-" RING_BUFFER_MODE_TEMPLATE_STRING
"-mmap");
729 lttng_transport_unregister(<tng_relay_transport
);