file creation
[lttv.git] / usertrace-fast / ltt-usertrace-fast.h
1
2 /* LTTng user-space "fast" tracing header
3 *
4 * Copyright 2006 Mathieu Desnoyers
5 *
6 */
7
8 #ifndef _LTT_USERTRACE_FAST_H
9 #define _LTT_USERTRACE_FAST_H
10
11 #include <errno.h>
12 #include <asm/atomic.h>
13 #include <pthread.h>
14
15 #ifndef LTT_BUF_SIZE_CPU
16 #define LTT_BUF_SIZE_CPU 1048576
17 #endif //LTT_BUF_SIZE_CPU
18
19 #ifndef LTT_BUF_SIZE_FACILITIES
20 #define LTT_BUF_SIZE_FACILITIES 4096
21 #endif //LTT_BUF_SIZE_FACILITIES
22
23 #ifndef LTT_USERTRACE_ROOT
24 #define LTT_USERTRACE_ROOT "/tmp/ltt-usertrace"
25 #endif //LTT_USERTRACE_ROOT
26
27 struct ltt_buf {
28 atomic_t offset;
29 atomic_t reserve_count;
30 atomic_t commit_count;
31
32 atomic_t events_lost;
33 };
34
35 struct ltt_trace_info {
36 int init;
37 int filter;
38 #ifndef LTT_USE_THREADS
39 pid_t daemon_id;
40 #else
41 pthread_t daemon_id;
42 #endif //LTT_USE_THREADS
43 atomic_t nesting;
44 struct {
45 struct ltt_buf facilities;
46 struct ltt_buf cpu;
47 char facilities_buf[LTT_BUF_SIZE_FACILITIES] __attribute__ ((aligned (8)));
48 char cpu_buf[LTT_BUF_SIZE_CPU] __attribute__ ((aligned (8)));
49 } channel;
50 };
51
52 extern __thread struct ltt_trace_info *thread_trace_info;
53
54 void ltt_thread_init(void);
55
56 void ltt_usertrace_fast_buffer_switch(void);
57
58 #endif //_LTT_USERTRACE_FAST_H
This page took 0.031143 seconds and 4 git commands to generate.