2 /* LTTng user-space tracing code
4 * Copyright 2006 Mathieu Desnoyers
21 #include "lttng_usertrace.h"
23 /* TLS for the trace buffer
24 * http://www.dis.com/gnu/gcc/C--98-Thread-Local-Edits.html
26 * Add after paragraph 4
28 * The storage for an object of thread storage duration shall be statically
29 * initialized before the first statement of the thread startup function. An
30 * object of thread storage duration shall not require dynamic
34 __thread
struct lttng_trace_info lttng_trace_info
=
38 .nesting
= ATOMIC_INIT(0),
54 static void ltt_cleanup_thread(void *arg
)
56 /* Flush the data in the lttng_trace_info */
61 void ltt_thread_init(void)
63 _pthread_cleanup_push(<tng_trace_info
.cleanup
,
64 ltt_cleanup_thread
, NULL
);
68 void __attribute__((constructor
)) __lttng_user_init(void)
72 printf("LTTng usertrace-fast init\n");