usertrace fast work
[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
23struct ltt_buf {
b09f3215 24 atomic_t offset;
25 atomic_t reserve_count;
26 atomic_t commit_count;
27
28 atomic_t events_lost;
29};
30
700d350d 31struct ltt_trace_info {
1c48e587 32 int init;
b09f3215 33 int filter;
700d350d 34#ifndef LTT_USE_THREADS
35 pid_t daemon_id;
36#else
37 pthread_t daemon_id;
38#endif //LTT_USE_THREADS
b09f3215 39 atomic_t nesting;
40 struct {
41 struct ltt_buf facilities;
42 struct ltt_buf cpu;
700d350d 43 char facilities_buf[LTT_BUF_SIZE_FACILITIES] __attribute__ ((aligned (8)));
51bf1553 44 char cpu_buf[LTT_BUF_SIZE_CPU] __attribute__ ((aligned (8)));
b09f3215 45 } channel;
46};
47
700d350d 48extern __thread struct ltt_trace_info *thread_trace_info;
b09f3215 49
51bf1553 50void ltt_thread_init(void);
b09f3215 51
700d350d 52void ltt_usertrace_fast_buffer_switch(void);
53
04180f7f 54#endif //_LTT_USERTRACE_FAST_H
This page took 0.025446 seconds and 4 git commands to generate.