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
23 #include <linux/module.h>
24 #include <linux/types.h>
25 #include "lib/bitfield.h"
26 #include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
27 #include "wrapper/trace-clock.h"
28 #include "lttng-events.h"
29 #include "lttng-tracer.h"
30 #include "wrapper/ringbuffer/frontend_types.h"
32 #define LTTNG_COMPACT_EVENT_BITS 5
33 #define LTTNG_COMPACT_TSC_BITS 27
35 static struct lttng_transport lttng_relay_transport
;
38 * Keep the natural field alignment for _each field_ within this structure if
39 * you ever add/remove a field from this header. Packed attribute is not used
40 * because gcc generates poor code on at least powerpc and mips. Don't ever
41 * let gcc add padding between the structure elements.
43 * The guarantee we have with timestamps is that all the events in a
44 * packet are included (inclusive) within the begin/end timestamps of
45 * the packet. Another guarantee we have is that the "timestamp begin",
46 * as well as the event timestamps, are monotonically increasing (never
47 * decrease) when moving forward in a stream (physically). But this
48 * guarantee does not apply to "timestamp end", because it is sampled at
49 * commit time, which is not ordered with respect to space reservation.
52 struct packet_header
{
53 /* Trace packet header */
56 * contains endianness information.
62 /* Stream packet context */
63 uint64_t timestamp_begin
; /* Cycle count at subbuffer start */
64 uint64_t timestamp_end
; /* Cycle count at subbuffer end */
65 uint64_t content_size
; /* Size of data in subbuffer */
66 uint64_t packet_size
; /* Subbuffer size (include padding) */
67 unsigned long events_discarded
; /*
68 * Events lost in this subbuffer since
69 * the beginning of the trace.
72 uint32_t cpu_id
; /* CPU id associated with stream */
73 uint8_t header_end
; /* End of header */
78 static inline notrace u64
lib_ring_buffer_clock_read(struct channel
*chan
)
80 return trace_clock_read64();
84 size_t ctx_get_size(size_t offset
, struct lttng_ctx
*ctx
)
87 size_t orig_offset
= offset
;
91 offset
+= lib_ring_buffer_align(offset
, ctx
->largest_align
);
92 for (i
= 0; i
< ctx
->nr_fields
; i
++)
93 offset
+= ctx
->fields
[i
].get_size(offset
);
94 return offset
- orig_offset
;
98 void ctx_record(struct lib_ring_buffer_ctx
*bufctx
,
99 struct lttng_channel
*chan
,
100 struct lttng_ctx
*ctx
)
106 lib_ring_buffer_align_ctx(bufctx
, ctx
->largest_align
);
107 for (i
= 0; i
< ctx
->nr_fields
; i
++)
108 ctx
->fields
[i
].record(&ctx
->fields
[i
], bufctx
, chan
);
112 * record_header_size - Calculate the header size and padding necessary.
113 * @config: ring buffer instance configuration
115 * @offset: offset in the write buffer
116 * @pre_header_padding: padding to add before the header (output)
117 * @ctx: reservation context
119 * Returns the event header size (including padding).
121 * The payload must itself determine its own alignment from the biggest type it
125 unsigned char record_header_size(const struct lib_ring_buffer_config
*config
,
126 struct channel
*chan
, size_t offset
,
127 size_t *pre_header_padding
,
128 struct lib_ring_buffer_ctx
*ctx
)
130 struct lttng_channel
*lttng_chan
= channel_get_private(chan
);
131 struct lttng_event
*event
= ctx
->priv
;
132 size_t orig_offset
= offset
;
135 switch (lttng_chan
->header_type
) {
136 case 1: /* compact */
137 padding
= lib_ring_buffer_align(offset
, lttng_alignof(uint32_t));
139 if (!(ctx
->rflags
& (RING_BUFFER_RFLAG_FULL_TSC
| LTTNG_RFLAG_EXTENDED
))) {
140 offset
+= sizeof(uint32_t); /* id and timestamp */
142 /* Minimum space taken by LTTNG_COMPACT_EVENT_BITS id */
143 offset
+= (LTTNG_COMPACT_EVENT_BITS
+ CHAR_BIT
- 1) / CHAR_BIT
;
144 /* Align extended struct on largest member */
145 offset
+= lib_ring_buffer_align(offset
, lttng_alignof(uint64_t));
146 offset
+= sizeof(uint32_t); /* id */
147 offset
+= lib_ring_buffer_align(offset
, lttng_alignof(uint64_t));
148 offset
+= sizeof(uint64_t); /* timestamp */
152 padding
= lib_ring_buffer_align(offset
, lttng_alignof(uint16_t));
154 offset
+= sizeof(uint16_t);
155 if (!(ctx
->rflags
& (RING_BUFFER_RFLAG_FULL_TSC
| LTTNG_RFLAG_EXTENDED
))) {
156 offset
+= lib_ring_buffer_align(offset
, lttng_alignof(uint32_t));
157 offset
+= sizeof(uint32_t); /* timestamp */
159 /* Align extended struct on largest member */
160 offset
+= lib_ring_buffer_align(offset
, lttng_alignof(uint64_t));
161 offset
+= sizeof(uint32_t); /* id */
162 offset
+= lib_ring_buffer_align(offset
, lttng_alignof(uint64_t));
163 offset
+= sizeof(uint64_t); /* timestamp */
170 offset
+= ctx_get_size(offset
, event
->ctx
);
171 offset
+= ctx_get_size(offset
, lttng_chan
->ctx
);
173 *pre_header_padding
= padding
;
174 return offset
- orig_offset
;
177 #include "wrapper/ringbuffer/api.h"
180 void lttng_write_event_header_slow(const struct lib_ring_buffer_config
*config
,
181 struct lib_ring_buffer_ctx
*ctx
,
185 * lttng_write_event_header
187 * Writes the event header to the offset (already aligned on 32-bits).
189 * @config: ring buffer instance configuration
190 * @ctx: reservation context
191 * @event_id: event ID
194 void lttng_write_event_header(const struct lib_ring_buffer_config
*config
,
195 struct lib_ring_buffer_ctx
*ctx
,
198 struct lttng_channel
*lttng_chan
= channel_get_private(ctx
->chan
);
199 struct lttng_event
*event
= ctx
->priv
;
201 if (unlikely(ctx
->rflags
))
204 switch (lttng_chan
->header_type
) {
205 case 1: /* compact */
207 uint32_t id_time
= 0;
209 bt_bitfield_write(&id_time
, uint32_t,
211 LTTNG_COMPACT_EVENT_BITS
,
213 bt_bitfield_write(&id_time
, uint32_t,
214 LTTNG_COMPACT_EVENT_BITS
,
215 LTTNG_COMPACT_TSC_BITS
,
217 lib_ring_buffer_write(config
, ctx
, &id_time
, sizeof(id_time
));
222 uint32_t timestamp
= (uint32_t) ctx
->tsc
;
223 uint16_t id
= event_id
;
225 lib_ring_buffer_write(config
, ctx
, &id
, sizeof(id
));
226 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint32_t));
227 lib_ring_buffer_write(config
, ctx
, ×tamp
, sizeof(timestamp
));
234 ctx_record(ctx
, lttng_chan
, lttng_chan
->ctx
);
235 ctx_record(ctx
, lttng_chan
, event
->ctx
);
236 lib_ring_buffer_align_ctx(ctx
, ctx
->largest_align
);
241 lttng_write_event_header_slow(config
, ctx
, event_id
);
245 void lttng_write_event_header_slow(const struct lib_ring_buffer_config
*config
,
246 struct lib_ring_buffer_ctx
*ctx
,
249 struct lttng_channel
*lttng_chan
= channel_get_private(ctx
->chan
);
250 struct lttng_event
*event
= ctx
->priv
;
252 switch (lttng_chan
->header_type
) {
253 case 1: /* compact */
254 if (!(ctx
->rflags
& (RING_BUFFER_RFLAG_FULL_TSC
| LTTNG_RFLAG_EXTENDED
))) {
255 uint32_t id_time
= 0;
257 bt_bitfield_write(&id_time
, uint32_t,
259 LTTNG_COMPACT_EVENT_BITS
,
261 bt_bitfield_write(&id_time
, uint32_t,
262 LTTNG_COMPACT_EVENT_BITS
,
263 LTTNG_COMPACT_TSC_BITS
, ctx
->tsc
);
264 lib_ring_buffer_write(config
, ctx
, &id_time
, sizeof(id_time
));
267 uint64_t timestamp
= ctx
->tsc
;
269 bt_bitfield_write(&id
, uint8_t,
271 LTTNG_COMPACT_EVENT_BITS
,
273 lib_ring_buffer_write(config
, ctx
, &id
, sizeof(id
));
274 /* Align extended struct on largest member */
275 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint64_t));
276 lib_ring_buffer_write(config
, ctx
, &event_id
, sizeof(event_id
));
277 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint64_t));
278 lib_ring_buffer_write(config
, ctx
, ×tamp
, sizeof(timestamp
));
283 if (!(ctx
->rflags
& (RING_BUFFER_RFLAG_FULL_TSC
| LTTNG_RFLAG_EXTENDED
))) {
284 uint32_t timestamp
= (uint32_t) ctx
->tsc
;
285 uint16_t id
= event_id
;
287 lib_ring_buffer_write(config
, ctx
, &id
, sizeof(id
));
288 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint32_t));
289 lib_ring_buffer_write(config
, ctx
, ×tamp
, sizeof(timestamp
));
292 uint64_t timestamp
= ctx
->tsc
;
294 lib_ring_buffer_write(config
, ctx
, &id
, sizeof(id
));
295 /* Align extended struct on largest member */
296 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint64_t));
297 lib_ring_buffer_write(config
, ctx
, &event_id
, sizeof(event_id
));
298 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(uint64_t));
299 lib_ring_buffer_write(config
, ctx
, ×tamp
, sizeof(timestamp
));
306 ctx_record(ctx
, lttng_chan
, lttng_chan
->ctx
);
307 ctx_record(ctx
, lttng_chan
, event
->ctx
);
308 lib_ring_buffer_align_ctx(ctx
, ctx
->largest_align
);
311 static const struct lib_ring_buffer_config client_config
;
313 static u64
client_ring_buffer_clock_read(struct channel
*chan
)
315 return lib_ring_buffer_clock_read(chan
);
319 size_t client_record_header_size(const struct lib_ring_buffer_config
*config
,
320 struct channel
*chan
, size_t offset
,
321 size_t *pre_header_padding
,
322 struct lib_ring_buffer_ctx
*ctx
)
324 return record_header_size(config
, chan
, offset
,
325 pre_header_padding
, ctx
);
329 * client_packet_header_size - called on buffer-switch to a new sub-buffer
331 * Return header size without padding after the structure. Don't use packed
332 * structure because gcc generates inefficient code on some architectures
335 static size_t client_packet_header_size(void)
337 return offsetof(struct packet_header
, ctx
.header_end
);
340 static void client_buffer_begin(struct lib_ring_buffer
*buf
, u64 tsc
,
341 unsigned int subbuf_idx
)
343 struct channel
*chan
= buf
->backend
.chan
;
344 struct packet_header
*header
=
345 (struct packet_header
*)
346 lib_ring_buffer_offset_address(&buf
->backend
,
347 subbuf_idx
* chan
->backend
.subbuf_size
);
348 struct lttng_channel
*lttng_chan
= channel_get_private(chan
);
349 struct lttng_session
*session
= lttng_chan
->session
;
351 header
->magic
= CTF_MAGIC_NUMBER
;
352 memcpy(header
->uuid
, session
->uuid
.b
, sizeof(session
->uuid
));
353 header
->stream_id
= lttng_chan
->id
;
354 header
->ctx
.timestamp_begin
= tsc
;
355 header
->ctx
.timestamp_end
= 0;
356 header
->ctx
.content_size
= ~0ULL; /* for debugging */
357 header
->ctx
.packet_size
= ~0ULL;
358 header
->ctx
.events_discarded
= 0;
359 header
->ctx
.cpu_id
= buf
->backend
.cpu
;
363 * offset is assumed to never be 0 here : never deliver a completely empty
364 * subbuffer. data_size is between 1 and subbuf_size.
366 static void client_buffer_end(struct lib_ring_buffer
*buf
, u64 tsc
,
367 unsigned int subbuf_idx
, unsigned long data_size
)
369 struct channel
*chan
= buf
->backend
.chan
;
370 struct packet_header
*header
=
371 (struct packet_header
*)
372 lib_ring_buffer_offset_address(&buf
->backend
,
373 subbuf_idx
* chan
->backend
.subbuf_size
);
374 unsigned long records_lost
= 0;
376 header
->ctx
.timestamp_end
= tsc
;
377 header
->ctx
.content_size
=
378 (uint64_t) data_size
* CHAR_BIT
; /* in bits */
379 header
->ctx
.packet_size
=
380 (uint64_t) PAGE_ALIGN(data_size
) * CHAR_BIT
; /* in bits */
381 records_lost
+= lib_ring_buffer_get_records_lost_full(&client_config
, buf
);
382 records_lost
+= lib_ring_buffer_get_records_lost_wrap(&client_config
, buf
);
383 records_lost
+= lib_ring_buffer_get_records_lost_big(&client_config
, buf
);
384 header
->ctx
.events_discarded
= records_lost
;
387 static int client_buffer_create(struct lib_ring_buffer
*buf
, void *priv
,
388 int cpu
, const char *name
)
393 static void client_buffer_finalize(struct lib_ring_buffer
*buf
, void *priv
, int cpu
)
397 static struct packet_header
*client_packet_header(
398 const struct lib_ring_buffer_config
*config
,
399 struct lib_ring_buffer
*buf
)
401 return lib_ring_buffer_read_offset_address(&buf
->backend
, 0);
404 static int client_timestamp_begin(const struct lib_ring_buffer_config
*config
,
405 struct lib_ring_buffer
*buf
,
406 uint64_t *timestamp_begin
)
408 struct packet_header
*header
= client_packet_header(config
, buf
);
409 *timestamp_begin
= header
->ctx
.timestamp_begin
;
414 static int client_timestamp_end(const struct lib_ring_buffer_config
*config
,
415 struct lib_ring_buffer
*buf
,
416 uint64_t *timestamp_end
)
418 struct packet_header
*header
= client_packet_header(config
, buf
);
419 *timestamp_end
= header
->ctx
.timestamp_end
;
424 static int client_events_discarded(const struct lib_ring_buffer_config
*config
,
425 struct lib_ring_buffer
*buf
,
426 uint64_t *events_discarded
)
428 struct packet_header
*header
= client_packet_header(config
, buf
);
429 *events_discarded
= header
->ctx
.events_discarded
;
434 static int client_content_size(const struct lib_ring_buffer_config
*config
,
435 struct lib_ring_buffer
*buf
,
436 uint64_t *content_size
)
438 struct packet_header
*header
= client_packet_header(config
, buf
);
439 *content_size
= header
->ctx
.content_size
;
444 static int client_packet_size(const struct lib_ring_buffer_config
*config
,
445 struct lib_ring_buffer
*buf
,
446 uint64_t *packet_size
)
448 struct packet_header
*header
= client_packet_header(config
, buf
);
449 *packet_size
= header
->ctx
.packet_size
;
454 static int client_stream_id(const struct lib_ring_buffer_config
*config
,
455 struct lib_ring_buffer
*buf
,
458 struct packet_header
*header
= client_packet_header(config
, buf
);
459 *stream_id
= header
->stream_id
;
464 static int client_current_timestamp(const struct lib_ring_buffer_config
*config
,
465 struct lib_ring_buffer
*bufb
,
468 *ts
= config
->cb
.ring_buffer_clock_read(bufb
->backend
.chan
);
473 static const struct lib_ring_buffer_config client_config
= {
474 .cb
.ring_buffer_clock_read
= client_ring_buffer_clock_read
,
475 .cb
.record_header_size
= client_record_header_size
,
476 .cb
.subbuffer_header_size
= client_packet_header_size
,
477 .cb
.buffer_begin
= client_buffer_begin
,
478 .cb
.buffer_end
= client_buffer_end
,
479 .cb
.buffer_create
= client_buffer_create
,
480 .cb
.buffer_finalize
= client_buffer_finalize
,
482 .tsc_bits
= LTTNG_COMPACT_TSC_BITS
,
483 .alloc
= RING_BUFFER_ALLOC_PER_CPU
,
484 .sync
= RING_BUFFER_SYNC_PER_CPU
,
485 .mode
= RING_BUFFER_MODE_TEMPLATE
,
486 .backend
= RING_BUFFER_PAGE
,
487 .output
= RING_BUFFER_OUTPUT_TEMPLATE
,
488 .oops
= RING_BUFFER_OOPS_CONSISTENCY
,
489 .ipi
= RING_BUFFER_IPI_BARRIER
,
490 .wakeup
= RING_BUFFER_WAKEUP_BY_TIMER
,
494 void release_priv_ops(void *priv_ops
)
496 module_put(THIS_MODULE
);
500 void lttng_channel_destroy(struct channel
*chan
)
502 channel_destroy(chan
);
506 struct channel
*_channel_create(const char *name
,
507 struct lttng_channel
*lttng_chan
, void *buf_addr
,
508 size_t subbuf_size
, size_t num_subbuf
,
509 unsigned int switch_timer_interval
,
510 unsigned int read_timer_interval
)
512 struct channel
*chan
;
514 chan
= channel_create(&client_config
, name
, lttng_chan
, buf_addr
,
515 subbuf_size
, num_subbuf
, switch_timer_interval
,
516 read_timer_interval
);
519 * Ensure this module is not unloaded before we finish
520 * using lttng_relay_transport.ops.
522 if (!try_module_get(THIS_MODULE
)) {
523 printk(KERN_WARNING
"LTT : Can't lock transport module.\n");
526 chan
->backend
.priv_ops
= <tng_relay_transport
.ops
;
527 chan
->backend
.release_priv_ops
= release_priv_ops
;
532 lttng_channel_destroy(chan
);
537 struct lib_ring_buffer
*lttng_buffer_read_open(struct channel
*chan
)
539 struct lib_ring_buffer
*buf
;
542 for_each_channel_cpu(cpu
, chan
) {
543 buf
= channel_get_ring_buffer(&client_config
, chan
, cpu
);
544 if (!lib_ring_buffer_open_read(buf
))
551 int lttng_buffer_has_read_closed_stream(struct channel
*chan
)
553 struct lib_ring_buffer
*buf
;
556 for_each_channel_cpu(cpu
, chan
) {
557 buf
= channel_get_ring_buffer(&client_config
, chan
, cpu
);
558 if (!atomic_long_read(&buf
->active_readers
))
565 void lttng_buffer_read_close(struct lib_ring_buffer
*buf
)
567 lib_ring_buffer_release_read(buf
);
571 int lttng_event_reserve(struct lib_ring_buffer_ctx
*ctx
,
574 struct lttng_channel
*lttng_chan
= channel_get_private(ctx
->chan
);
577 cpu
= lib_ring_buffer_get_cpu(&client_config
);
582 switch (lttng_chan
->header_type
) {
583 case 1: /* compact */
585 ctx
->rflags
|= LTTNG_RFLAG_EXTENDED
;
588 if (event_id
> 65534)
589 ctx
->rflags
|= LTTNG_RFLAG_EXTENDED
;
595 ret
= lib_ring_buffer_reserve(&client_config
, ctx
);
598 lttng_write_event_header(&client_config
, ctx
, event_id
);
601 lib_ring_buffer_put_cpu(&client_config
);
606 void lttng_event_commit(struct lib_ring_buffer_ctx
*ctx
)
608 lib_ring_buffer_commit(&client_config
, ctx
);
609 lib_ring_buffer_put_cpu(&client_config
);
613 void lttng_event_write(struct lib_ring_buffer_ctx
*ctx
, const void *src
,
616 lib_ring_buffer_write(&client_config
, ctx
, src
, len
);
620 void lttng_event_write_from_user(struct lib_ring_buffer_ctx
*ctx
,
621 const void __user
*src
, size_t len
)
623 lib_ring_buffer_copy_from_user_inatomic(&client_config
, ctx
, src
, len
);
627 void lttng_event_memset(struct lib_ring_buffer_ctx
*ctx
,
630 lib_ring_buffer_memset(&client_config
, ctx
, c
, len
);
634 void lttng_event_strcpy(struct lib_ring_buffer_ctx
*ctx
, const char *src
,
637 lib_ring_buffer_strcpy(&client_config
, ctx
, src
, len
, '#');
641 void lttng_event_strcpy_from_user(struct lib_ring_buffer_ctx
*ctx
,
642 const char __user
*src
, size_t len
)
644 lib_ring_buffer_strcpy_from_user_inatomic(&client_config
, ctx
, src
,
649 wait_queue_head_t
*lttng_get_writer_buf_wait_queue(struct channel
*chan
, int cpu
)
651 struct lib_ring_buffer
*buf
= channel_get_ring_buffer(&client_config
,
653 return &buf
->write_wait
;
657 wait_queue_head_t
*lttng_get_hp_wait_queue(struct channel
*chan
)
659 return &chan
->hp_wait
;
663 int lttng_is_finalized(struct channel
*chan
)
665 return lib_ring_buffer_channel_is_finalized(chan
);
669 int lttng_is_disabled(struct channel
*chan
)
671 return lib_ring_buffer_channel_is_disabled(chan
);
674 static struct lttng_transport lttng_relay_transport
= {
675 .name
= "relay-" RING_BUFFER_MODE_TEMPLATE_STRING
,
676 .owner
= THIS_MODULE
,
678 .channel_create
= _channel_create
,
679 .channel_destroy
= lttng_channel_destroy
,
680 .buffer_read_open
= lttng_buffer_read_open
,
681 .buffer_has_read_closed_stream
=
682 lttng_buffer_has_read_closed_stream
,
683 .buffer_read_close
= lttng_buffer_read_close
,
684 .event_reserve
= lttng_event_reserve
,
685 .event_commit
= lttng_event_commit
,
686 .event_write
= lttng_event_write
,
687 .event_write_from_user
= lttng_event_write_from_user
,
688 .event_memset
= lttng_event_memset
,
689 .event_strcpy
= lttng_event_strcpy
,
690 .event_strcpy_from_user
= lttng_event_strcpy_from_user
,
691 .packet_avail_size
= NULL
, /* Would be racy anyway */
692 .get_writer_buf_wait_queue
= lttng_get_writer_buf_wait_queue
,
693 .get_hp_wait_queue
= lttng_get_hp_wait_queue
,
694 .is_finalized
= lttng_is_finalized
,
695 .is_disabled
= lttng_is_disabled
,
696 .timestamp_begin
= client_timestamp_begin
,
697 .timestamp_end
= client_timestamp_end
,
698 .events_discarded
= client_events_discarded
,
699 .content_size
= client_content_size
,
700 .packet_size
= client_packet_size
,
701 .stream_id
= client_stream_id
,
702 .current_timestamp
= client_current_timestamp
,
706 static int __init
lttng_ring_buffer_client_init(void)
709 * This vmalloc sync all also takes care of the lib ring buffer
710 * vmalloc'd module pages when it is built as a module into LTTng.
712 wrapper_vmalloc_sync_all();
713 lttng_transport_register(<tng_relay_transport
);
717 module_init(lttng_ring_buffer_client_init
);
719 static void __exit
lttng_ring_buffer_client_exit(void)
721 lttng_transport_unregister(<tng_relay_transport
);
724 module_exit(lttng_ring_buffer_client_exit
);
726 MODULE_LICENSE("GPL and additional rights");
727 MODULE_AUTHOR("Mathieu Desnoyers");
728 MODULE_DESCRIPTION("LTTng ring buffer " RING_BUFFER_MODE_TEMPLATE_STRING