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