Update ChangeLog to 2.0-pre15
[lttng-modules.git] / lttng-abi.h
1 #ifndef _LTTNG_ABI_H
2 #define _LTTNG_ABI_H
3
4 /*
5 * lttng-abi.h
6 *
7 * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 *
9 * LTTng ABI header
10 *
11 * Dual LGPL v2.1/GPL v2 license.
12 */
13
14 #include <linux/fs.h>
15
16 #define LTTNG_KERNEL_SYM_NAME_LEN 256
17
18 enum lttng_kernel_instrumentation {
19 LTTNG_KERNEL_TRACEPOINT = 0,
20 LTTNG_KERNEL_KPROBE = 1,
21 LTTNG_KERNEL_FUNCTION = 2,
22 LTTNG_KERNEL_KRETPROBE = 3,
23 LTTNG_KERNEL_NOOP = 4, /* not hooked */
24 LTTNG_KERNEL_SYSCALL = 5,
25 };
26
27 /*
28 * LTTng consumer mode
29 */
30 enum lttng_kernel_output {
31 LTTNG_KERNEL_SPLICE = 0,
32 LTTNG_KERNEL_MMAP = 1,
33 };
34
35 /*
36 * LTTng DebugFS ABI structures.
37 */
38 #define LTTNG_KERNEL_CHANNEL_PADDING LTTNG_KERNEL_SYM_NAME_LEN + 32
39 struct lttng_kernel_channel {
40 int overwrite; /* 1: overwrite, 0: discard */
41 uint64_t subbuf_size; /* in bytes */
42 uint64_t num_subbuf;
43 unsigned int switch_timer_interval; /* usecs */
44 unsigned int read_timer_interval; /* usecs */
45 enum lttng_kernel_output output; /* splice, mmap */
46 char padding[LTTNG_KERNEL_CHANNEL_PADDING];
47 };
48
49 struct lttng_kernel_kretprobe {
50 uint64_t addr;
51
52 uint64_t offset;
53 char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN];
54 };
55
56 /*
57 * Either addr is used, or symbol_name and offset.
58 */
59 struct lttng_kernel_kprobe {
60 uint64_t addr;
61
62 uint64_t offset;
63 char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN];
64 };
65
66 struct lttng_kernel_function_tracer {
67 char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN];
68 };
69
70 /*
71 * For syscall tracing, name = '\0' means "enable all".
72 */
73 #define LTTNG_KERNEL_EVENT_PADDING1 16
74 #define LTTNG_KERNEL_EVENT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32
75 struct lttng_kernel_event {
76 char name[LTTNG_KERNEL_SYM_NAME_LEN]; /* event name */
77 enum lttng_kernel_instrumentation instrumentation;
78 char padding[LTTNG_KERNEL_EVENT_PADDING1];
79
80 /* Per instrumentation type configuration */
81 union {
82 struct lttng_kernel_kretprobe kretprobe;
83 struct lttng_kernel_kprobe kprobe;
84 struct lttng_kernel_function_tracer ftrace;
85 char padding[LTTNG_KERNEL_EVENT_PADDING2];
86 } u;
87 };
88
89 struct lttng_kernel_tracer_version {
90 uint32_t version;
91 uint32_t patchlevel;
92 uint32_t sublevel;
93 };
94
95 enum lttng_kernel_calibrate_type {
96 LTTNG_KERNEL_CALIBRATE_KRETPROBE,
97 };
98
99 struct lttng_kernel_calibrate {
100 enum lttng_kernel_calibrate_type type; /* type (input) */
101 };
102
103 enum lttng_kernel_context_type {
104 LTTNG_KERNEL_CONTEXT_PID = 0,
105 LTTNG_KERNEL_CONTEXT_PERF_COUNTER = 1,
106 LTTNG_KERNEL_CONTEXT_PROCNAME = 2,
107 LTTNG_KERNEL_CONTEXT_PRIO = 3,
108 LTTNG_KERNEL_CONTEXT_NICE = 4,
109 LTTNG_KERNEL_CONTEXT_VPID = 5,
110 LTTNG_KERNEL_CONTEXT_TID = 6,
111 LTTNG_KERNEL_CONTEXT_VTID = 7,
112 LTTNG_KERNEL_CONTEXT_PPID = 8,
113 LTTNG_KERNEL_CONTEXT_VPPID = 9,
114 };
115
116 struct lttng_kernel_perf_counter_ctx {
117 uint32_t type;
118 uint64_t config;
119 char name[LTTNG_KERNEL_SYM_NAME_LEN];
120 };
121
122 #define LTTNG_KERNEL_CONTEXT_PADDING1 16
123 #define LTTNG_KERNEL_CONTEXT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32
124 struct lttng_kernel_context {
125 enum lttng_kernel_context_type ctx;
126 char padding[LTTNG_KERNEL_CONTEXT_PADDING1];
127
128 union {
129 struct lttng_kernel_perf_counter_ctx perf_counter;
130 char padding[LTTNG_KERNEL_CONTEXT_PADDING2];
131 } u;
132 };
133
134 /* LTTng file descriptor ioctl */
135 #define LTTNG_KERNEL_SESSION _IO(0xF6, 0x40)
136 #define LTTNG_KERNEL_TRACER_VERSION \
137 _IOR(0xF6, 0x41, struct lttng_kernel_tracer_version)
138 #define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x42)
139 #define LTTNG_KERNEL_WAIT_QUIESCENT _IO(0xF6, 0x43)
140 #define LTTNG_KERNEL_CALIBRATE \
141 _IOWR(0xF6, 0x44, struct lttng_kernel_calibrate)
142
143 /* Session FD ioctl */
144 #define LTTNG_KERNEL_METADATA \
145 _IOW(0xF6, 0x50, struct lttng_kernel_channel)
146 #define LTTNG_KERNEL_CHANNEL \
147 _IOW(0xF6, 0x51, struct lttng_kernel_channel)
148 #define LTTNG_KERNEL_SESSION_START _IO(0xF6, 0x52)
149 #define LTTNG_KERNEL_SESSION_STOP _IO(0xF6, 0x53)
150
151 /* Channel FD ioctl */
152 #define LTTNG_KERNEL_STREAM _IO(0xF6, 0x60)
153 #define LTTNG_KERNEL_EVENT \
154 _IOW(0xF6, 0x61, struct lttng_kernel_event)
155
156 /* Event and Channel FD ioctl */
157 #define LTTNG_KERNEL_CONTEXT \
158 _IOW(0xF6, 0x70, struct lttng_kernel_context)
159
160 /* Event, Channel and Session ioctl */
161 #define LTTNG_KERNEL_ENABLE _IO(0xF6, 0x80)
162 #define LTTNG_KERNEL_DISABLE _IO(0xF6, 0x81)
163
164 #endif /* _LTTNG_ABI_H */
This page took 0.034641 seconds and 4 git commands to generate.