b09f3215 |
1 | |
2 | /* LTTng user-space tracing header |
3 | * |
4 | * Copyright 2006 Mathieu Desnoyers |
5 | * |
6 | */ |
7 | |
8 | #ifndef _LTTNG_USERTRACE_H |
9 | #define _LTTNG_USERTRACE_H |
10 | |
11 | #include <errno.h> |
b09f3215 |
12 | #include <asm/atomic.h> |
13 | |
51bf1553 |
14 | #ifndef LTT_BUF_SIZE_CPU |
15 | #define LTT_BUF_SIZE_CPU 1048576 |
16 | #endif //LTT_BUF_SIZE_CPU |
b09f3215 |
17 | |
51bf1553 |
18 | #ifndef LTT_BUF_SIZE_FACILITIES |
19 | #define LTT_BUF_SIZE_FACILITIES 4096 |
20 | #endif //LTT_BUF_SIZE_FACILITIES |
b09f3215 |
21 | |
22 | struct ltt_buf { |
b09f3215 |
23 | atomic_t offset; |
24 | atomic_t reserve_count; |
25 | atomic_t commit_count; |
26 | |
27 | atomic_t events_lost; |
28 | }; |
29 | |
30 | struct lttng_trace_info { |
51bf1553 |
31 | struct _pthread_cleanup_buffer cleanup; |
b09f3215 |
32 | int filter; |
33 | atomic_t nesting; |
34 | struct { |
35 | struct ltt_buf facilities; |
51bf1553 |
36 | char facilities_buf[LTT_BUF_SIZE_FACILITIES] __attribute__ ((aligned (8))); |
b09f3215 |
37 | struct ltt_buf cpu; |
51bf1553 |
38 | char cpu_buf[LTT_BUF_SIZE_CPU] __attribute__ ((aligned (8))); |
b09f3215 |
39 | } channel; |
40 | }; |
41 | |
51bf1553 |
42 | extern __thread struct lttng_trace_info lttng_trace_info; |
b09f3215 |
43 | |
51bf1553 |
44 | void ltt_thread_init(void); |
b09f3215 |
45 | |
46 | #endif //_LTTNG_USERTRACE_H |