Merge branch 'dev'
[lttng-ust.git] / liblttng-ust / ltt-events.c
1 /*
2 * ltt-events.c
3 *
4 * Holds LTTng per-session event registry.
5 *
6 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 *
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.
12 *
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.
17 *
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
21 */
22
23 #define _GNU_SOURCE
24 #include <stdio.h>
25 #include <urcu/list.h>
26 #include <urcu/hlist.h>
27 #include <pthread.h>
28 #include <errno.h>
29 #include <sys/shm.h>
30 #include <sys/ipc.h>
31 #include <stdint.h>
32 #include <stddef.h>
33 #include <inttypes.h>
34 #include <time.h>
35 #include <lttng/ust-endian.h>
36 #include "clock.h"
37
38 #include <urcu-bp.h>
39 #include <urcu/compiler.h>
40 #include <urcu/uatomic.h>
41 #include <urcu/arch.h>
42
43 #include <lttng/tracepoint.h>
44 #include <lttng/ust-events.h>
45
46 #include <usterr-signal-safe.h>
47 #include <helper.h>
48 #include "error.h"
49 #include "compat.h"
50 #include "lttng-ust-uuid.h"
51
52 #include "tracepoint-internal.h"
53 #include "ltt-tracer.h"
54 #include "ltt-tracer-core.h"
55 #include "wait.h"
56 #include "../libringbuffer/shm.h"
57 #include "jhash.h"
58
59 /*
60 * The sessions mutex is the centralized mutex across UST tracing
61 * control and probe registration. All operations within this file are
62 * called by the communication thread, under ust_lock protection.
63 */
64 static pthread_mutex_t sessions_mutex = PTHREAD_MUTEX_INITIALIZER;
65
66 void ust_lock(void)
67 {
68 pthread_mutex_lock(&sessions_mutex);
69 }
70
71 void ust_unlock(void)
72 {
73 pthread_mutex_unlock(&sessions_mutex);
74 }
75
76 static CDS_LIST_HEAD(sessions);
77
78 /*
79 * Wildcard list, containing the active wildcards.
80 * Protected by ust lock.
81 */
82 static CDS_LIST_HEAD(wildcard_list);
83
84 /*
85 * Pending probes hash table, containing the registered ltt events for
86 * which tracepoint probes are still missing. Protected by the sessions
87 * mutex.
88 */
89 #define PENDING_PROBE_HASH_BITS 6
90 #define PENDING_PROBE_HASH_SIZE (1 << PENDING_PROBE_HASH_BITS)
91 static struct cds_hlist_head pending_probe_table[PENDING_PROBE_HASH_SIZE];
92
93 struct ust_pending_probe {
94 struct ltt_event *event;
95 struct cds_hlist_node node;
96 enum lttng_ust_loglevel_type loglevel_type;
97 int loglevel;
98 char name[];
99 };
100
101 static void _ltt_event_destroy(struct ltt_event *event);
102 static void _ltt_wildcard_destroy(struct session_wildcard *sw);
103 static void _ltt_channel_destroy(struct ltt_channel *chan);
104 static int _ltt_event_unregister(struct ltt_event *event);
105 static
106 int _ltt_event_metadata_statedump(struct ltt_session *session,
107 struct ltt_channel *chan,
108 struct ltt_event *event);
109 static
110 int _ltt_session_metadata_statedump(struct ltt_session *session);
111
112 int ltt_loglevel_match(const struct lttng_event_desc *desc,
113 enum lttng_ust_loglevel_type req_type,
114 int req_loglevel)
115 {
116 int ev_loglevel;
117
118 if (req_type == LTTNG_UST_LOGLEVEL_ALL)
119 return 1;
120 if (!desc->loglevel)
121 ev_loglevel = TRACE_DEFAULT;
122 else
123 ev_loglevel = *(*desc->loglevel);
124 switch (req_type) {
125 case LTTNG_UST_LOGLEVEL_RANGE:
126 if (ev_loglevel <= req_loglevel || req_loglevel == -1)
127 return 1;
128 else
129 return 0;
130 case LTTNG_UST_LOGLEVEL_SINGLE:
131 if (ev_loglevel == req_loglevel || req_loglevel == -1)
132 return 1;
133 else
134 return 0;
135 case LTTNG_UST_LOGLEVEL_ALL:
136 default:
137 return 1;
138 }
139 }
140
141 /*
142 * Return wildcard for a given event name if the event name match the
143 * one of the wildcards.
144 * Must be called with ust lock held.
145 * Returns NULL if not present.
146 */
147 static
148 struct wildcard_entry *match_wildcard(const struct lttng_event_desc *desc)
149 {
150 struct wildcard_entry *e;
151
152 cds_list_for_each_entry(e, &wildcard_list, list) {
153 /* If only contain '*' */
154 if (strlen(e->name) == 1)
155 goto possible_match;
156 /* Compare excluding final '*' */
157 if (!strncmp(desc->name, e->name, strlen(e->name) - 1))
158 goto possible_match;
159 continue; /* goto next, no match */
160 possible_match:
161 if (ltt_loglevel_match(desc,
162 e->loglevel_type,
163 e->loglevel)) {
164 return e;
165 }
166 /* no match, loop to next */
167 }
168 return NULL;
169 }
170
171 /*
172 * called at event creation if probe is missing.
173 * called with session mutex held.
174 */
175 static
176 int add_pending_probe(struct ltt_event *event, const char *name,
177 enum lttng_ust_loglevel_type loglevel_type,
178 int loglevel)
179 {
180 struct cds_hlist_head *head;
181 struct ust_pending_probe *e;
182 size_t name_len = strlen(name) + 1;
183 uint32_t hash;
184
185 if (name_len > LTTNG_UST_SYM_NAME_LEN) {
186 WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN);
187 name_len = LTTNG_UST_SYM_NAME_LEN;
188 }
189 hash = jhash(name, name_len - 1, 0);
190 head = &pending_probe_table[hash & (PENDING_PROBE_HASH_SIZE - 1)];
191 e = zmalloc(sizeof(struct ust_pending_probe) + name_len);
192 if (!e)
193 return -ENOMEM;
194 memcpy(&e->name[0], name, name_len);
195 e->name[name_len - 1] = '\0';
196 e->loglevel_type = loglevel_type;
197 e->loglevel = loglevel;
198 cds_hlist_add_head(&e->node, head);
199 e->event = event;
200 event->pending_probe = e;
201 return 0;
202 }
203
204 /*
205 * remove a pending probe. called when at event teardown and when an
206 * event is fixed (probe is loaded).
207 * called with session mutex held.
208 */
209 static
210 void remove_pending_probe(struct ust_pending_probe *e)
211 {
212 if (!e)
213 return;
214 cds_hlist_del(&e->node);
215 free(e);
216 }
217
218 /*
219 * Called at library load: connect the probe on the events pending on
220 * probe load.
221 * called with session mutex held.
222 */
223 int pending_probe_fix_events(const struct lttng_event_desc *desc)
224 {
225 struct cds_hlist_head *head;
226 struct cds_hlist_node *node, *p;
227 struct ust_pending_probe *e;
228 const char *name = desc->name;
229 int ret = 0;
230 struct lttng_ust_event event_param;
231 size_t name_len = strlen(name) + 1;
232 uint32_t hash;
233
234 /* Wildcard */
235 {
236 struct wildcard_entry *wildcard;
237
238 wildcard = match_wildcard(desc);
239 if (strcmp(desc->name, "lttng_ust:metadata") && wildcard) {
240 struct session_wildcard *sw;
241
242 cds_list_for_each_entry(sw, &wildcard->session_list,
243 session_list) {
244 struct ltt_event *ev;
245 int ret;
246
247 memcpy(&event_param, &sw->event_param,
248 sizeof(event_param));
249 memcpy(event_param.name,
250 desc->name,
251 sizeof(event_param.name));
252 /* create event */
253 ret = ltt_event_create(sw->chan,
254 &event_param, NULL,
255 &ev);
256 if (ret) {
257 DBG("Error creating event");
258 continue;
259 }
260 cds_list_add(&ev->wildcard_list,
261 &sw->events);
262 }
263 }
264 }
265
266 if (name_len > LTTNG_UST_SYM_NAME_LEN) {
267 WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN);
268 name_len = LTTNG_UST_SYM_NAME_LEN;
269 }
270 hash = jhash(name, name_len - 1, 0);
271 head = &pending_probe_table[hash & (PENDING_PROBE_HASH_SIZE - 1)];
272 cds_hlist_for_each_entry_safe(e, node, p, head, node) {
273 struct ltt_event *event;
274 struct ltt_channel *chan;
275
276 if (!ltt_loglevel_match(desc,
277 e->loglevel_type,
278 e->loglevel)) {
279 continue;
280 }
281 if (strncmp(name, e->name, LTTNG_UST_SYM_NAME_LEN - 1)) {
282 continue;
283 }
284 event = e->event;
285 chan = event->chan;
286 assert(!event->desc);
287 event->desc = desc;
288 event->pending_probe = NULL;
289 remove_pending_probe(e);
290 ret |= __tracepoint_probe_register(name,
291 event->desc->probe_callback,
292 event, event->desc->signature);
293 if (ret)
294 continue;
295 event->id = chan->free_event_id++;
296 ret |= _ltt_event_metadata_statedump(chan->session, chan,
297 event);
298 }
299 return ret;
300 }
301
302 void synchronize_trace(void)
303 {
304 synchronize_rcu();
305 }
306
307 struct ltt_session *ltt_session_create(void)
308 {
309 struct ltt_session *session;
310 int ret;
311
312 session = zmalloc(sizeof(struct ltt_session));
313 if (!session)
314 return NULL;
315 CDS_INIT_LIST_HEAD(&session->chan);
316 CDS_INIT_LIST_HEAD(&session->events);
317 CDS_INIT_LIST_HEAD(&session->wildcards);
318 ret = lttng_ust_uuid_generate(session->uuid);
319 if (ret != 0) {
320 session->uuid[0] = '\0';
321 }
322 cds_list_add(&session->list, &sessions);
323 return session;
324 }
325
326 void ltt_session_destroy(struct ltt_session *session)
327 {
328 struct ltt_channel *chan, *tmpchan;
329 struct ltt_event *event, *tmpevent;
330 struct session_wildcard *wildcard, *tmpwildcard;
331 int ret;
332
333 CMM_ACCESS_ONCE(session->active) = 0;
334 cds_list_for_each_entry(event, &session->events, list) {
335 ret = _ltt_event_unregister(event);
336 WARN_ON(ret);
337 }
338 synchronize_trace(); /* Wait for in-flight events to complete */
339 cds_list_for_each_entry_safe(wildcard, tmpwildcard, &session->wildcards, list)
340 _ltt_wildcard_destroy(wildcard);
341 cds_list_for_each_entry_safe(event, tmpevent, &session->events, list)
342 _ltt_event_destroy(event);
343 cds_list_for_each_entry_safe(chan, tmpchan, &session->chan, list)
344 _ltt_channel_destroy(chan);
345 cds_list_del(&session->list);
346 free(session);
347 }
348
349 int ltt_session_enable(struct ltt_session *session)
350 {
351 int ret = 0;
352 struct ltt_channel *chan;
353
354 if (session->active) {
355 ret = -EBUSY;
356 goto end;
357 }
358
359 /*
360 * Snapshot the number of events per channel to know the type of header
361 * we need to use.
362 */
363 cds_list_for_each_entry(chan, &session->chan, list) {
364 if (chan->header_type)
365 continue; /* don't change it if session stop/restart */
366 if (chan->free_event_id < 31)
367 chan->header_type = 1; /* compact */
368 else
369 chan->header_type = 2; /* large */
370 }
371
372 CMM_ACCESS_ONCE(session->active) = 1;
373 CMM_ACCESS_ONCE(session->been_active) = 1;
374 ret = _ltt_session_metadata_statedump(session);
375 if (ret)
376 CMM_ACCESS_ONCE(session->active) = 0;
377 end:
378 return ret;
379 }
380
381 int ltt_session_disable(struct ltt_session *session)
382 {
383 int ret = 0;
384
385 if (!session->active) {
386 ret = -EBUSY;
387 goto end;
388 }
389 CMM_ACCESS_ONCE(session->active) = 0;
390 end:
391 return ret;
392 }
393
394 int ltt_channel_enable(struct ltt_channel *channel)
395 {
396 int old;
397
398 if (channel == channel->session->metadata)
399 return -EPERM;
400 old = uatomic_xchg(&channel->enabled, 1);
401 if (old)
402 return -EEXIST;
403 return 0;
404 }
405
406 int ltt_channel_disable(struct ltt_channel *channel)
407 {
408 int old;
409
410 if (channel == channel->session->metadata)
411 return -EPERM;
412 old = uatomic_xchg(&channel->enabled, 0);
413 if (!old)
414 return -EEXIST;
415 return 0;
416 }
417
418 int ltt_event_enable(struct ltt_event *event)
419 {
420 int old;
421
422 if (event->chan == event->chan->session->metadata)
423 return -EPERM;
424 old = uatomic_xchg(&event->enabled, 1);
425 if (old)
426 return -EEXIST;
427 return 0;
428 }
429
430 int ltt_event_disable(struct ltt_event *event)
431 {
432 int old;
433
434 if (event->chan == event->chan->session->metadata)
435 return -EPERM;
436 old = uatomic_xchg(&event->enabled, 0);
437 if (!old)
438 return -EEXIST;
439 return 0;
440 }
441
442 struct ltt_channel *ltt_channel_create(struct ltt_session *session,
443 const char *transport_name,
444 void *buf_addr,
445 size_t subbuf_size, size_t num_subbuf,
446 unsigned int switch_timer_interval,
447 unsigned int read_timer_interval,
448 int **shm_fd, int **wait_fd,
449 uint64_t **memory_map_size,
450 struct ltt_channel *chan_priv_init)
451 {
452 struct ltt_channel *chan = NULL;
453 struct ltt_transport *transport;
454
455 if (session->been_active)
456 goto active; /* Refuse to add channel to active session */
457 transport = ltt_transport_find(transport_name);
458 if (!transport) {
459 DBG("LTTng transport %s not found\n",
460 transport_name);
461 goto notransport;
462 }
463 chan_priv_init->id = session->free_chan_id++;
464 chan_priv_init->session = session;
465 /*
466 * Note: the channel creation op already writes into the packet
467 * headers. Therefore the "chan" information used as input
468 * should be already accessible.
469 */
470 chan = transport->ops.channel_create(transport_name, buf_addr,
471 subbuf_size, num_subbuf, switch_timer_interval,
472 read_timer_interval, shm_fd, wait_fd,
473 memory_map_size, chan_priv_init);
474 if (!chan)
475 goto create_error;
476 chan->enabled = 1;
477 chan->ops = &transport->ops;
478 cds_list_add(&chan->list, &session->chan);
479 return chan;
480
481 create_error:
482 notransport:
483 active:
484 return NULL;
485 }
486
487 /*
488 * Only used internally at session destruction.
489 */
490 static
491 void _ltt_channel_destroy(struct ltt_channel *chan)
492 {
493 cds_list_del(&chan->list);
494 lttng_destroy_context(chan->ctx);
495 chan->ops->channel_destroy(chan);
496 }
497
498 /*
499 * Supports event creation while tracing session is active.
500 */
501 int ltt_event_create(struct ltt_channel *chan,
502 struct lttng_ust_event *event_param,
503 void *filter,
504 struct ltt_event **_event)
505 {
506 const struct lttng_event_desc *desc = NULL; /* silence gcc */
507 struct ltt_event *event;
508 int ret = 0;
509
510 if (chan->used_event_id == -1U) {
511 ret = -ENOMEM;
512 goto full;
513 }
514 /*
515 * This is O(n^2) (for each event, the loop is called at event
516 * creation). Might require a hash if we have lots of events.
517 */
518 cds_list_for_each_entry(event, &chan->session->events, list) {
519 if (event->desc && !strncmp(event->desc->name,
520 event_param->name,
521 LTTNG_UST_SYM_NAME_LEN - 1)) {
522 ret = -EEXIST;
523 goto exist;
524 }
525 }
526
527 /*
528 * Check if loglevel match. Refuse to connect event if not.
529 */
530 if (event_param->instrumentation == LTTNG_UST_TRACEPOINT) {
531 desc = ltt_event_get(event_param->name);
532 if (desc) {
533 if (!ltt_loglevel_match(desc,
534 event_param->loglevel_type,
535 event_param->loglevel)) {
536 ret = -EPERM;
537 goto no_loglevel_match;
538 }
539 }
540 /*
541 * If descriptor is not there, it will be added to
542 * pending probes.
543 */
544 }
545 event = zmalloc(sizeof(struct ltt_event));
546 if (!event) {
547 ret = -ENOMEM;
548 goto cache_error;
549 }
550 event->chan = chan;
551 event->filter = filter;
552 /*
553 * used_event_id counts the maximum number of event IDs that can
554 * register if all probes register.
555 */
556 chan->used_event_id++;
557 event->enabled = 1;
558 event->instrumentation = event_param->instrumentation;
559 /* Populate ltt_event structure before tracepoint registration. */
560 cmm_smp_wmb();
561 switch (event_param->instrumentation) {
562 case LTTNG_UST_TRACEPOINT:
563 event->desc = desc;
564 if (event->desc) {
565 ret = __tracepoint_probe_register(event_param->name,
566 event->desc->probe_callback,
567 event, event->desc->signature);
568 if (ret)
569 goto register_error;
570 event->id = chan->free_event_id++;
571 } else {
572 /*
573 * If the probe is not present, event->desc stays NULL,
574 * waiting for the probe to register, and the event->id
575 * stays unallocated.
576 */
577 ret = add_pending_probe(event, event_param->name,
578 event_param->loglevel_type,
579 event_param->loglevel);
580 if (ret)
581 goto add_pending_error;
582 }
583 break;
584 default:
585 WARN_ON_ONCE(1);
586 }
587 if (event->desc) {
588 ret = _ltt_event_metadata_statedump(chan->session, chan, event);
589 if (ret)
590 goto statedump_error;
591 }
592 cds_list_add(&event->list, &chan->session->events);
593 *_event = event;
594 return 0;
595
596 statedump_error:
597 if (event->desc) {
598 WARN_ON_ONCE(__tracepoint_probe_unregister(event_param->name,
599 event->desc->probe_callback,
600 event));
601 ltt_event_put(event->desc);
602 }
603 add_pending_error:
604 register_error:
605 free(event);
606 cache_error:
607 no_loglevel_match:
608 exist:
609 full:
610 return ret;
611 }
612
613 /*
614 * Only used internally at session destruction.
615 */
616 int _ltt_event_unregister(struct ltt_event *event)
617 {
618 int ret = -EINVAL;
619
620 switch (event->instrumentation) {
621 case LTTNG_UST_TRACEPOINT:
622 if (event->desc) {
623 ret = __tracepoint_probe_unregister(event->desc->name,
624 event->desc->probe_callback,
625 event);
626 if (ret)
627 return ret;
628 } else {
629 remove_pending_probe(event->pending_probe);
630 ret = 0;
631 }
632 break;
633 default:
634 WARN_ON_ONCE(1);
635 }
636 return ret;
637 }
638
639 /*
640 * Only used internally at session destruction.
641 */
642 static
643 void _ltt_event_destroy(struct ltt_event *event)
644 {
645 switch (event->instrumentation) {
646 case LTTNG_UST_TRACEPOINT:
647 if (event->desc) {
648 ltt_event_put(event->desc);
649 }
650 break;
651 default:
652 WARN_ON_ONCE(1);
653 }
654 cds_list_del(&event->list);
655 lttng_destroy_context(event->ctx);
656 free(event);
657 }
658
659 /*
660 * We have exclusive access to our metadata buffer (protected by the
661 * ust_lock), so we can do racy operations such as looking for
662 * remaining space left in packet and write, since mutual exclusion
663 * protects us from concurrent writes.
664 */
665 int lttng_metadata_printf(struct ltt_session *session,
666 const char *fmt, ...)
667 {
668 struct lttng_ust_lib_ring_buffer_ctx ctx;
669 struct ltt_channel *chan = session->metadata;
670 char *str = NULL;
671 int ret = 0, waitret;
672 size_t len, reserve_len, pos;
673 va_list ap;
674
675 WARN_ON_ONCE(!CMM_ACCESS_ONCE(session->active));
676
677 va_start(ap, fmt);
678 ret = vasprintf(&str, fmt, ap);
679 va_end(ap);
680 if (ret < 0)
681 return -ENOMEM;
682
683 len = strlen(str);
684 pos = 0;
685
686 for (pos = 0; pos < len; pos += reserve_len) {
687 reserve_len = min_t(size_t,
688 chan->ops->packet_avail_size(chan->chan, chan->handle),
689 len - pos);
690 lib_ring_buffer_ctx_init(&ctx, chan->chan, NULL, reserve_len,
691 sizeof(char), -1, chan->handle);
692 /*
693 * We don't care about metadata buffer's records lost
694 * count, because we always retry here. Report error if
695 * we need to bail out after timeout or being
696 * interrupted.
697 */
698 waitret = wait_cond_interruptible_timeout(
699 ({
700 ret = chan->ops->event_reserve(&ctx, 0);
701 ret != -ENOBUFS || !ret;
702 }),
703 LTTNG_METADATA_TIMEOUT_MSEC);
704 if (waitret == -ETIMEDOUT || waitret == -EINTR || ret) {
705 DBG("LTTng: Failure to write metadata to buffers (%s)\n",
706 waitret == -EINTR ? "interrupted" :
707 (ret == -ENOBUFS ? "timeout" : "I/O error"));
708 if (waitret == -EINTR)
709 ret = waitret;
710 goto end;
711 }
712 chan->ops->event_write(&ctx, &str[pos], reserve_len);
713 chan->ops->event_commit(&ctx);
714 }
715 end:
716 free(str);
717 return ret;
718 }
719
720 static
721 int _ltt_field_statedump(struct ltt_session *session,
722 const struct lttng_event_field *field)
723 {
724 int ret = 0;
725
726 switch (field->type.atype) {
727 case atype_integer:
728 ret = lttng_metadata_printf(session,
729 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } _%s;\n",
730 field->type.u.basic.integer.size,
731 field->type.u.basic.integer.alignment,
732 field->type.u.basic.integer.signedness,
733 (field->type.u.basic.integer.encoding == lttng_encode_none)
734 ? "none"
735 : (field->type.u.basic.integer.encoding == lttng_encode_UTF8)
736 ? "UTF8"
737 : "ASCII",
738 field->type.u.basic.integer.base,
739 #if (BYTE_ORDER == BIG_ENDIAN)
740 field->type.u.basic.integer.reverse_byte_order ? " byte_order = le;" : "",
741 #else
742 field->type.u.basic.integer.reverse_byte_order ? " byte_order = be;" : "",
743 #endif
744 field->name);
745 break;
746 case atype_float:
747 ret = lttng_metadata_printf(session,
748 " floating_point { exp_dig = %u; mant_dig = %u; align = %u;%s } _%s;\n",
749 field->type.u.basic._float.exp_dig,
750 field->type.u.basic._float.mant_dig,
751 field->type.u.basic._float.alignment,
752 #if (BYTE_ORDER == BIG_ENDIAN)
753 field->type.u.basic.integer.reverse_byte_order ? " byte_order = le;" : "",
754 #else
755 field->type.u.basic.integer.reverse_byte_order ? " byte_order = be;" : "",
756 #endif
757 field->name);
758 break;
759 case atype_enum:
760 ret = lttng_metadata_printf(session,
761 " %s %s;\n",
762 field->type.u.basic.enumeration.name,
763 field->name);
764 break;
765 case atype_array:
766 {
767 const struct lttng_basic_type *elem_type;
768
769 elem_type = &field->type.u.array.elem_type;
770 ret = lttng_metadata_printf(session,
771 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } _%s[%u];\n",
772 elem_type->u.basic.integer.size,
773 elem_type->u.basic.integer.alignment,
774 elem_type->u.basic.integer.signedness,
775 (elem_type->u.basic.integer.encoding == lttng_encode_none)
776 ? "none"
777 : (elem_type->u.basic.integer.encoding == lttng_encode_UTF8)
778 ? "UTF8"
779 : "ASCII",
780 elem_type->u.basic.integer.base,
781 #if (BYTE_ORDER == BIG_ENDIAN)
782 elem_type->u.basic.integer.reverse_byte_order ? " byte_order = le;" : "",
783 #else
784 elem_type->u.basic.integer.reverse_byte_order ? " byte_order = be;" : "",
785 #endif
786 field->name, field->type.u.array.length);
787 break;
788 }
789 case atype_sequence:
790 {
791 const struct lttng_basic_type *elem_type;
792 const struct lttng_basic_type *length_type;
793
794 elem_type = &field->type.u.sequence.elem_type;
795 length_type = &field->type.u.sequence.length_type;
796 ret = lttng_metadata_printf(session,
797 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } __%s_length;\n",
798 length_type->u.basic.integer.size,
799 (unsigned int) length_type->u.basic.integer.alignment,
800 length_type->u.basic.integer.signedness,
801 (length_type->u.basic.integer.encoding == lttng_encode_none)
802 ? "none"
803 : ((length_type->u.basic.integer.encoding == lttng_encode_UTF8)
804 ? "UTF8"
805 : "ASCII"),
806 length_type->u.basic.integer.base,
807 #if (BYTE_ORDER == BIG_ENDIAN)
808 length_type->u.basic.integer.reverse_byte_order ? " byte_order = le;" : "",
809 #else
810 length_type->u.basic.integer.reverse_byte_order ? " byte_order = be;" : "",
811 #endif
812 field->name);
813 if (ret)
814 return ret;
815
816 ret = lttng_metadata_printf(session,
817 " integer { size = %u; align = %u; signed = %u; encoding = %s; base = %u;%s } _%s[ __%s_length ];\n",
818 elem_type->u.basic.integer.size,
819 (unsigned int) elem_type->u.basic.integer.alignment,
820 elem_type->u.basic.integer.signedness,
821 (elem_type->u.basic.integer.encoding == lttng_encode_none)
822 ? "none"
823 : ((elem_type->u.basic.integer.encoding == lttng_encode_UTF8)
824 ? "UTF8"
825 : "ASCII"),
826 elem_type->u.basic.integer.base,
827 #if (BYTE_ORDER == BIG_ENDIAN)
828 elem_type->u.basic.integer.reverse_byte_order ? " byte_order = le;" : "",
829 #else
830 elem_type->u.basic.integer.reverse_byte_order ? " byte_order = be;" : "",
831 #endif
832 field->name,
833 field->name);
834 break;
835 }
836
837 case atype_string:
838 /* Default encoding is UTF8 */
839 ret = lttng_metadata_printf(session,
840 " string%s _%s;\n",
841 field->type.u.basic.string.encoding == lttng_encode_ASCII ?
842 " { encoding = ASCII; }" : "",
843 field->name);
844 break;
845 default:
846 WARN_ON_ONCE(1);
847 return -EINVAL;
848 }
849 return ret;
850 }
851
852 static
853 int _ltt_context_metadata_statedump(struct ltt_session *session,
854 struct lttng_ctx *ctx)
855 {
856 int ret = 0;
857 int i;
858
859 if (!ctx)
860 return 0;
861 for (i = 0; i < ctx->nr_fields; i++) {
862 const struct lttng_ctx_field *field = &ctx->fields[i];
863
864 ret = _ltt_field_statedump(session, &field->event_field);
865 if (ret)
866 return ret;
867 }
868 return ret;
869 }
870
871 static
872 int _ltt_fields_metadata_statedump(struct ltt_session *session,
873 struct ltt_event *event)
874 {
875 const struct lttng_event_desc *desc = event->desc;
876 int ret = 0;
877 int i;
878
879 for (i = 0; i < desc->nr_fields; i++) {
880 const struct lttng_event_field *field = &desc->fields[i];
881
882 ret = _ltt_field_statedump(session, field);
883 if (ret)
884 return ret;
885 }
886 return ret;
887 }
888
889 static
890 int _ltt_event_metadata_statedump(struct ltt_session *session,
891 struct ltt_channel *chan,
892 struct ltt_event *event)
893 {
894 int ret = 0;
895 int loglevel = TRACE_DEFAULT;
896
897 if (event->metadata_dumped || !CMM_ACCESS_ONCE(session->active))
898 return 0;
899 if (chan == session->metadata)
900 return 0;
901 /*
902 * Don't print events for which probe load is pending.
903 */
904 if (!event->desc)
905 return 0;
906
907 ret = lttng_metadata_printf(session,
908 "event {\n"
909 " name = \"%s\";\n"
910 " id = %u;\n"
911 " stream_id = %u;\n",
912 event->desc->name,
913 event->id,
914 event->chan->id);
915 if (ret)
916 goto end;
917
918 if (event->desc->loglevel)
919 loglevel = *(*event->desc->loglevel);
920
921 ret = lttng_metadata_printf(session,
922 " loglevel = %d;\n",
923 loglevel);
924 if (ret)
925 goto end;
926
927 if (event->ctx) {
928 ret = lttng_metadata_printf(session,
929 " context := struct {\n");
930 if (ret)
931 goto end;
932 }
933 ret = _ltt_context_metadata_statedump(session, event->ctx);
934 if (ret)
935 goto end;
936 if (event->ctx) {
937 ret = lttng_metadata_printf(session,
938 " };\n");
939 if (ret)
940 goto end;
941 }
942
943 ret = lttng_metadata_printf(session,
944 " fields := struct {\n"
945 );
946 if (ret)
947 goto end;
948
949 ret = _ltt_fields_metadata_statedump(session, event);
950 if (ret)
951 goto end;
952
953 /*
954 * LTTng space reservation can only reserve multiples of the
955 * byte size.
956 */
957 ret = lttng_metadata_printf(session,
958 " };\n"
959 "};\n\n");
960 if (ret)
961 goto end;
962
963 event->metadata_dumped = 1;
964 end:
965 return ret;
966
967 }
968
969 static
970 int _ltt_channel_metadata_statedump(struct ltt_session *session,
971 struct ltt_channel *chan)
972 {
973 int ret = 0;
974
975 if (chan->metadata_dumped || !CMM_ACCESS_ONCE(session->active))
976 return 0;
977 if (chan == session->metadata)
978 return 0;
979
980 WARN_ON_ONCE(!chan->header_type);
981 ret = lttng_metadata_printf(session,
982 "stream {\n"
983 " id = %u;\n"
984 " event.header := %s;\n"
985 " packet.context := struct packet_context;\n",
986 chan->id,
987 chan->header_type == 1 ? "struct event_header_compact" :
988 "struct event_header_large");
989 if (ret)
990 goto end;
991
992 if (chan->ctx) {
993 ret = lttng_metadata_printf(session,
994 " event.context := struct {\n");
995 if (ret)
996 goto end;
997 }
998 ret = _ltt_context_metadata_statedump(session, chan->ctx);
999 if (ret)
1000 goto end;
1001 if (chan->ctx) {
1002 ret = lttng_metadata_printf(session,
1003 " };\n");
1004 if (ret)
1005 goto end;
1006 }
1007
1008 ret = lttng_metadata_printf(session,
1009 "};\n\n");
1010
1011 chan->metadata_dumped = 1;
1012 end:
1013 return ret;
1014 }
1015
1016 static
1017 int _ltt_stream_packet_context_declare(struct ltt_session *session)
1018 {
1019 return lttng_metadata_printf(session,
1020 "struct packet_context {\n"
1021 " uint64_clock_monotonic_t timestamp_begin;\n"
1022 " uint64_clock_monotonic_t timestamp_end;\n"
1023 " uint32_t events_discarded;\n"
1024 " uint32_t content_size;\n"
1025 " uint32_t packet_size;\n"
1026 " uint32_t cpu_id;\n"
1027 "};\n\n"
1028 );
1029 }
1030
1031 /*
1032 * Compact header:
1033 * id: range: 0 - 30.
1034 * id 31 is reserved to indicate an extended header.
1035 *
1036 * Large header:
1037 * id: range: 0 - 65534.
1038 * id 65535 is reserved to indicate an extended header.
1039 */
1040 static
1041 int _ltt_event_header_declare(struct ltt_session *session)
1042 {
1043 return lttng_metadata_printf(session,
1044 "struct event_header_compact {\n"
1045 " enum : uint5_t { compact = 0 ... 30, extended = 31 } id;\n"
1046 " variant <id> {\n"
1047 " struct {\n"
1048 " uint27_clock_monotonic_t timestamp;\n"
1049 " } compact;\n"
1050 " struct {\n"
1051 " uint32_t id;\n"
1052 " uint64_clock_monotonic_t timestamp;\n"
1053 " } extended;\n"
1054 " } v;\n"
1055 "} align(%u);\n"
1056 "\n"
1057 "struct event_header_large {\n"
1058 " enum : uint16_t { compact = 0 ... 65534, extended = 65535 } id;\n"
1059 " variant <id> {\n"
1060 " struct {\n"
1061 " uint32_clock_monotonic_t timestamp;\n"
1062 " } compact;\n"
1063 " struct {\n"
1064 " uint32_t id;\n"
1065 " uint64_clock_monotonic_t timestamp;\n"
1066 " } extended;\n"
1067 " } v;\n"
1068 "} align(%u);\n\n",
1069 lttng_alignof(uint32_t) * CHAR_BIT,
1070 lttng_alignof(uint16_t) * CHAR_BIT
1071 );
1072 }
1073
1074 /*
1075 * Approximation of NTP time of day to clock monotonic correlation,
1076 * taken at start of trace.
1077 * Yes, this is only an approximation. Yes, we can (and will) do better
1078 * in future versions.
1079 */
1080 static
1081 uint64_t measure_clock_offset(void)
1082 {
1083 uint64_t offset, monotonic[2], realtime;
1084 struct timespec rts = { 0, 0 };
1085 int ret;
1086
1087 monotonic[0] = trace_clock_read64();
1088 ret = clock_gettime(CLOCK_REALTIME, &rts);
1089 if (ret < 0)
1090 return 0;
1091 monotonic[1] = trace_clock_read64();
1092 offset = (monotonic[0] + monotonic[1]) >> 1;
1093 realtime = (uint64_t) rts.tv_sec * 1000000000ULL;
1094 realtime += rts.tv_nsec;
1095 offset = realtime - offset;
1096 return offset;
1097 }
1098
1099 /*
1100 * Output metadata into this session's metadata buffers.
1101 */
1102 static
1103 int _ltt_session_metadata_statedump(struct ltt_session *session)
1104 {
1105 unsigned char *uuid_c = session->uuid;
1106 char uuid_s[LTTNG_UST_UUID_STR_LEN],
1107 clock_uuid_s[LTTNG_UST_UUID_STR_LEN];
1108 struct ltt_channel *chan;
1109 struct ltt_event *event;
1110 int ret = 0;
1111 char procname[LTTNG_UST_PROCNAME_LEN] = "";
1112
1113 if (!CMM_ACCESS_ONCE(session->active))
1114 return 0;
1115 if (session->metadata_dumped)
1116 goto skip_session;
1117 if (!session->metadata) {
1118 DBG("LTTng: attempt to start tracing, but metadata channel is not found. Operation abort.\n");
1119 return -EPERM;
1120 }
1121
1122 snprintf(uuid_s, sizeof(uuid_s),
1123 "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
1124 uuid_c[0], uuid_c[1], uuid_c[2], uuid_c[3],
1125 uuid_c[4], uuid_c[5], uuid_c[6], uuid_c[7],
1126 uuid_c[8], uuid_c[9], uuid_c[10], uuid_c[11],
1127 uuid_c[12], uuid_c[13], uuid_c[14], uuid_c[15]);
1128
1129 ret = lttng_metadata_printf(session,
1130 "typealias integer { size = 8; align = %u; signed = false; } := uint8_t;\n"
1131 "typealias integer { size = 16; align = %u; signed = false; } := uint16_t;\n"
1132 "typealias integer { size = 32; align = %u; signed = false; } := uint32_t;\n"
1133 "typealias integer { size = 64; align = %u; signed = false; } := uint64_t;\n"
1134 "typealias integer { size = 5; align = 1; signed = false; } := uint5_t;\n"
1135 "typealias integer { size = 27; align = 1; signed = false; } := uint27_t;\n"
1136 "\n"
1137 "trace {\n"
1138 " major = %u;\n"
1139 " minor = %u;\n"
1140 " uuid = \"%s\";\n"
1141 " byte_order = %s;\n"
1142 " packet.header := struct {\n"
1143 " uint32_t magic;\n"
1144 " uint8_t uuid[16];\n"
1145 " uint32_t stream_id;\n"
1146 " };\n"
1147 "};\n\n",
1148 lttng_alignof(uint8_t) * CHAR_BIT,
1149 lttng_alignof(uint16_t) * CHAR_BIT,
1150 lttng_alignof(uint32_t) * CHAR_BIT,
1151 lttng_alignof(uint64_t) * CHAR_BIT,
1152 CTF_SPEC_MAJOR,
1153 CTF_SPEC_MINOR,
1154 uuid_s,
1155 #if (BYTE_ORDER == BIG_ENDIAN)
1156 "be"
1157 #else
1158 "le"
1159 #endif
1160 );
1161 if (ret)
1162 goto end;
1163
1164 /* ignore error, just use empty string if error. */
1165 lttng_ust_getprocname(procname);
1166 procname[LTTNG_UST_PROCNAME_LEN - 1] = '\0';
1167 ret = lttng_metadata_printf(session,
1168 "env {\n"
1169 " vpid = %d;\n"
1170 " procname = \"%s\";\n"
1171 " domain = \"ust\";\n"
1172 " tracer_name = \"lttng-ust\";\n"
1173 " tracer_major = %u;\n"
1174 " tracer_minor = %u;\n"
1175 " tracer_patchlevel = %u;\n"
1176 "};\n\n",
1177 (int) getpid(),
1178 procname,
1179 LTTNG_UST_MAJOR_VERSION,
1180 LTTNG_UST_MINOR_VERSION,
1181 LTTNG_UST_PATCHLEVEL_VERSION
1182 );
1183 if (ret)
1184 goto end;
1185
1186 ret = lttng_metadata_printf(session,
1187 "clock {\n"
1188 " name = %s;\n",
1189 "monotonic"
1190 );
1191 if (ret)
1192 goto end;
1193
1194 if (!trace_clock_uuid(clock_uuid_s)) {
1195 ret = lttng_metadata_printf(session,
1196 " uuid = \"%s\";\n",
1197 clock_uuid_s
1198 );
1199 if (ret)
1200 goto end;
1201 }
1202
1203 ret = lttng_metadata_printf(session,
1204 " description = \"Monotonic Clock\";\n"
1205 " freq = %" PRIu64 "; /* Frequency, in Hz */\n"
1206 " /* clock value offset from Epoch is: offset * (1/freq) */\n"
1207 " offset = %" PRIu64 ";\n"
1208 "};\n\n",
1209 trace_clock_freq(),
1210 measure_clock_offset()
1211 );
1212 if (ret)
1213 goto end;
1214
1215 ret = lttng_metadata_printf(session,
1216 "typealias integer {\n"
1217 " size = 27; align = 1; signed = false;\n"
1218 " map = clock.monotonic.value;\n"
1219 "} := uint27_clock_monotonic_t;\n"
1220 "\n"
1221 "typealias integer {\n"
1222 " size = 32; align = %u; signed = false;\n"
1223 " map = clock.monotonic.value;\n"
1224 "} := uint32_clock_monotonic_t;\n"
1225 "\n"
1226 "typealias integer {\n"
1227 " size = 64; align = %u; signed = false;\n"
1228 " map = clock.monotonic.value;\n"
1229 "} := uint64_clock_monotonic_t;\n\n",
1230 lttng_alignof(uint32_t) * CHAR_BIT,
1231 lttng_alignof(uint64_t) * CHAR_BIT
1232 );
1233 if (ret)
1234 goto end;
1235
1236 ret = _ltt_stream_packet_context_declare(session);
1237 if (ret)
1238 goto end;
1239
1240 ret = _ltt_event_header_declare(session);
1241 if (ret)
1242 goto end;
1243
1244 skip_session:
1245 cds_list_for_each_entry(chan, &session->chan, list) {
1246 ret = _ltt_channel_metadata_statedump(session, chan);
1247 if (ret)
1248 goto end;
1249 }
1250
1251 cds_list_for_each_entry(event, &session->events, list) {
1252 ret = _ltt_event_metadata_statedump(session, event->chan, event);
1253 if (ret)
1254 goto end;
1255 }
1256 session->metadata_dumped = 1;
1257 end:
1258 return ret;
1259 }
1260
1261 void lttng_ust_events_exit(void)
1262 {
1263 struct ltt_session *session, *tmpsession;
1264
1265 cds_list_for_each_entry_safe(session, tmpsession, &sessions, list)
1266 ltt_session_destroy(session);
1267 }
1268
1269 /* WILDCARDS */
1270
1271 static
1272 int wildcard_same_loglevel(struct wildcard_entry *e,
1273 enum lttng_ust_loglevel_type loglevel_type,
1274 int loglevel)
1275 {
1276 if (e->loglevel_type == loglevel_type && e->loglevel == loglevel)
1277 return 1;
1278 else
1279 return 0;
1280 }
1281
1282 #if 0
1283 static
1284 int wildcard_is_within(struct wildcard_entry *e,
1285 enum lttng_ust_loglevel_type loglevel_type,
1286 int loglevel)
1287 {
1288 if (e->loglevel_type == LTTNG_UST_LOGLEVEL_ALL
1289 || e->loglevel == -1)
1290 return 1;
1291 switch (e->loglevel_type) {
1292 case LTTNG_UST_LOGLEVEL_RANGE:
1293 switch (loglevel_type) {
1294 case LTTNG_UST_LOGLEVEL_RANGE:
1295 if (e->loglevel >= loglevel)
1296 return 1;
1297 else
1298 return 0;
1299 case LTTNG_UST_LOGLEVEL_SINGLE:
1300 if (e->loglevel <= 0 && loglevel == 0)
1301 return 1;
1302 else
1303 return 0;
1304 }
1305 case LTTNG_UST_LOGLEVEL_SINGLE:
1306 switch (loglevel_type) {
1307 case LTTNG_UST_LOGLEVEL_RANGE:
1308 if (loglevel <= 0)
1309 return 1;
1310 else
1311 return 0;
1312 case LTTNG_UST_LOGLEVEL_SINGLE:
1313 if (e->loglevel == loglevel)
1314 return 1;
1315 else
1316 return 0;
1317 }
1318 }
1319 }
1320 #endif
1321
1322 /*
1323 * Add the wildcard to the wildcard list. Must be called with
1324 * ust lock held.
1325 */
1326 static
1327 struct session_wildcard *add_wildcard(struct ltt_channel *chan,
1328 struct lttng_ust_event *event_param)
1329 {
1330 struct wildcard_entry *e;
1331 struct session_wildcard *sw;
1332 size_t name_len = strlen(event_param->name) + 1;
1333 int found = 0;
1334
1335 /*
1336 * Try to find global wildcard entry. Given that this is shared
1337 * across all sessions, we need to check for exact loglevel
1338 * match, not just whether contained within the existing ones.
1339 */
1340 cds_list_for_each_entry(e, &wildcard_list, list) {
1341 if (!strncmp(event_param->name, e->name,
1342 LTTNG_UST_SYM_NAME_LEN - 1)) {
1343 if (wildcard_same_loglevel(e,
1344 event_param->loglevel_type,
1345 event_param->loglevel)) {
1346 found = 1;
1347 break;
1348 }
1349 }
1350 }
1351
1352 if (!found) {
1353 /*
1354 * Create global wildcard entry if not found. Using
1355 * zmalloc here to allocate a variable length element.
1356 * Could cause some memory fragmentation if overused.
1357 */
1358 e = zmalloc(sizeof(struct wildcard_entry) + name_len);
1359 if (!e)
1360 return ERR_PTR(-ENOMEM);
1361 memcpy(&e->name[0], event_param->name, name_len);
1362 e->loglevel_type = event_param->loglevel_type;
1363 e->loglevel = event_param->loglevel;
1364 cds_list_add(&e->list, &wildcard_list);
1365 CDS_INIT_LIST_HEAD(&e->session_list);
1366 }
1367
1368 /* session wildcard */
1369 cds_list_for_each_entry(sw, &e->session_list, session_list) {
1370 if (chan == sw->chan) {
1371 DBG("wildcard %s busy for this channel",
1372 event_param->name);
1373 return ERR_PTR(-EEXIST); /* Already there */
1374 }
1375 }
1376 sw = zmalloc(sizeof(struct session_wildcard));
1377 if (!sw)
1378 return ERR_PTR(-ENOMEM);
1379 sw->chan = chan;
1380 sw->enabled = 1;
1381 memcpy(&sw->event_param, event_param, sizeof(sw->event_param));
1382 sw->event_param.instrumentation = LTTNG_UST_TRACEPOINT;
1383 sw->event_param.loglevel_type = event_param->loglevel_type;
1384 sw->event_param.loglevel = event_param->loglevel;
1385 CDS_INIT_LIST_HEAD(&sw->events);
1386 cds_list_add(&sw->list, &chan->session->wildcards);
1387 cds_list_add(&sw->session_list, &e->session_list);
1388 sw->entry = e;
1389 ltt_probes_create_wildcard_events(e, sw);
1390 return sw;
1391 }
1392
1393 /*
1394 * Remove the wildcard from the wildcard list. Must be called with
1395 * ust_lock held. Only called at session teardown.
1396 */
1397 static
1398 void _remove_wildcard(struct session_wildcard *wildcard)
1399 {
1400 struct ltt_event *ev, *tmp;
1401
1402 /*
1403 * Just remove the events owned (for enable/disable) by this
1404 * wildcard from the list. The session teardown will take care
1405 * of freeing the event memory.
1406 */
1407 cds_list_for_each_entry_safe(ev, tmp, &wildcard->events,
1408 wildcard_list) {
1409 cds_list_del(&ev->wildcard_list);
1410 }
1411 cds_list_del(&wildcard->session_list);
1412 cds_list_del(&wildcard->list);
1413 if (cds_list_empty(&wildcard->entry->session_list)) {
1414 cds_list_del(&wildcard->entry->list);
1415 free(wildcard->entry);
1416 }
1417 free(wildcard);
1418 }
1419
1420 int ltt_wildcard_create(struct ltt_channel *chan,
1421 struct lttng_ust_event *event_param,
1422 struct session_wildcard **_sw)
1423 {
1424 struct session_wildcard *sw;
1425
1426 sw = add_wildcard(chan, event_param);
1427 if (!sw || IS_ERR(sw)) {
1428 return PTR_ERR(sw);
1429 }
1430 *_sw = sw;
1431 return 0;
1432 }
1433
1434 static
1435 void _ltt_wildcard_destroy(struct session_wildcard *sw)
1436 {
1437 _remove_wildcard(sw);
1438 }
1439
1440 int ltt_wildcard_enable(struct session_wildcard *wildcard)
1441 {
1442 struct ltt_event *ev;
1443 int ret;
1444
1445 if (wildcard->enabled)
1446 return -EEXIST;
1447 cds_list_for_each_entry(ev, &wildcard->events, wildcard_list) {
1448 ret = ltt_event_enable(ev);
1449 if (ret) {
1450 DBG("Error: enable error.\n");
1451 return ret;
1452 }
1453 }
1454 wildcard->enabled = 1;
1455 return 0;
1456 }
1457
1458 int ltt_wildcard_disable(struct session_wildcard *wildcard)
1459 {
1460 struct ltt_event *ev;
1461 int ret;
1462
1463 if (!wildcard->enabled)
1464 return -EEXIST;
1465 cds_list_for_each_entry(ev, &wildcard->events, wildcard_list) {
1466 ret = ltt_event_disable(ev);
1467 if (ret) {
1468 DBG("Error: disable error.\n");
1469 return ret;
1470 }
1471 }
1472 wildcard->enabled = 0;
1473 return 0;
1474 }
1475
1476 /*
1477 * Take the TLS "fault" in libuuid if dlopen'd, which can take the
1478 * dynamic linker mutex, outside of the UST lock, since the UST lock is
1479 * taken in constructors, which are called with dynamic linker mutex
1480 * held.
1481 */
1482 void lttng_fixup_event_tls(void)
1483 {
1484 unsigned char uuid[LTTNG_UST_UUID_STR_LEN];
1485
1486 (void) lttng_ust_uuid_generate(uuid);
1487 }
This page took 0.058742 seconds and 4 git commands to generate.