2 /* LTTng user-space "fast" tracing header
4 * Copyright 2006 Mathieu Desnoyers
8 #ifndef _LTT_USERTRACE_FAST_H
9 #define _LTT_USERTRACE_FAST_H
12 #include <asm/atomic.h>
17 #define LTT_N_SUBBUFS 2
18 #endif //LTT_N_SUBBUFS
20 #ifndef LTT_SUBBUF_SIZE_CPU
21 #define LTT_SUBBUF_SIZE_CPU 1048576
22 #endif //LTT_BUF_SIZE_CPU
24 #define LTT_BUF_SIZE_CPU (LTT_SUBBUF_SIZE_CPU * LTT_N_SUBBUFS)
26 #ifndef LTT_SUBBUF_SIZE_FACILITIES
27 #define LTT_SUBBUF_SIZE_FACILITIES 4096
28 #endif //LTT_BUF_SIZE_FACILITIES
30 #define LTT_BUF_SIZE_FACILITIES (LTT_SUBBUF_SIZE_FACILITIES * LTT_N_SUBBUFS)
32 #ifndef LTT_USERTRACE_ROOT
33 #define LTT_USERTRACE_ROOT "/tmp/ltt-usertrace"
34 #endif //LTT_USERTRACE_ROOT
37 /* Buffer offset macros */
39 #define BUFFER_OFFSET(offset, buf) (offset & (buf->alloc_size-1))
40 #define SUBBUF_OFFSET(offset, buf) (offset & (buf->subbuf_size-1))
41 #define SUBBUF_ALIGN(offset, buf) \
42 (((offset) + buf->subbuf_size) & (~(buf->subbuf_size-1)))
43 #define SUBBUF_TRUNC(offset, buf) \
44 ((offset) & (~(buf->subbuf_size-1)))
45 #define SUBBUF_INDEX(offset, buf) \
46 (BUFFER_OFFSET(offset,buf)/buf->subbuf_size)
52 atomic_t reserve_count
[LTT_N_SUBBUFS
];
53 atomic_t commit_count
[LTT_N_SUBBUFS
];
56 atomic_t full
; /* futex on which the writer waits : 1 : full */
57 unsigned int alloc_size
;
58 unsigned int subbuf_size
;
61 struct ltt_trace_info
{
67 struct ltt_buf facilities
;
69 char facilities_buf
[LTT_BUF_SIZE_FACILITIES
] __attribute__ ((aligned (8)));
70 char cpu_buf
[LTT_BUF_SIZE_CPU
] __attribute__ ((aligned (8)));
74 extern __thread
struct ltt_trace_info
*thread_trace_info
;
76 void ltt_thread_init(void);
78 void ltt_usertrace_fast_buffer_switch(void);
80 #endif //_LTT_USERTRACE_FAST_H
This page took 0.037949 seconds and 4 git commands to generate.