Commit | Line | Data |
---|---|---|
b7cdc182 | 1 | /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) |
9f36eaed | 2 | * |
2df37e95 | 3 | * lttng/abi.h |
57a13317 | 4 | * |
80996790 | 5 | * LTTng ABI header |
17baffe2 | 6 | * |
886d51a3 | 7 | * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
57a13317 MD |
8 | */ |
9 | ||
9f36eaed MJ |
10 | #ifndef _LTTNG_ABI_H |
11 | #define _LTTNG_ABI_H | |
12 | ||
57a13317 | 13 | #include <linux/fs.h> |
99f52fcc | 14 | #include <linux/types.h> |
57a13317 | 15 | |
42cabb80 MD |
16 | /* |
17 | * Major/minor version of ABI exposed to lttng tools. Major number | |
18 | * should be increased when an incompatible ABI change is done. | |
19 | */ | |
3c997079 | 20 | #define LTTNG_MODULES_ABI_MAJOR_VERSION 2 |
911ae48d | 21 | #define LTTNG_MODULES_ABI_MINOR_VERSION 5 |
42cabb80 | 22 | |
f8695253 | 23 | #define LTTNG_KERNEL_SYM_NAME_LEN 256 |
7f859fbf | 24 | #define LTTNG_KERNEL_SESSION_NAME_LEN 256 |
1c88f269 | 25 | #define LTTNG_KERNEL_SESSION_CREATION_TIME_ISO8601_LEN 26 |
d6d808f3 | 26 | |
38d024ae | 27 | enum lttng_kernel_instrumentation { |
4c183524 MD |
28 | LTTNG_KERNEL_TRACEPOINT = 0, |
29 | LTTNG_KERNEL_KPROBE = 1, | |
30 | LTTNG_KERNEL_FUNCTION = 2, | |
7371f44c | 31 | LTTNG_KERNEL_KRETPROBE = 3, |
1ec65de1 | 32 | LTTNG_KERNEL_NOOP = 4, /* not hooked */ |
43880ee8 | 33 | LTTNG_KERNEL_SYSCALL = 5, |
149b9a9d | 34 | LTTNG_KERNEL_UPROBE = 6, |
57a13317 MD |
35 | }; |
36 | ||
96ba7208 JD |
37 | /* |
38 | * LTTng consumer mode | |
39 | */ | |
40 | enum lttng_kernel_output { | |
41 | LTTNG_KERNEL_SPLICE = 0, | |
42 | LTTNG_KERNEL_MMAP = 1, | |
43 | }; | |
44 | ||
57a13317 MD |
45 | /* |
46 | * LTTng DebugFS ABI structures. | |
47 | */ | |
8e099bae | 48 | #define LTTNG_KERNEL_CHANNEL_PADDING LTTNG_KERNEL_SYM_NAME_LEN + 32 |
38d024ae | 49 | struct lttng_kernel_channel { |
9e245ead | 50 | uint64_t subbuf_size; /* in bytes */ |
80c16bcf | 51 | uint64_t num_subbuf; |
9e245ead MD |
52 | unsigned int switch_timer_interval; /* usecs */ |
53 | unsigned int read_timer_interval; /* usecs */ | |
b6c846f1 | 54 | uint32_t output; /* enum lttng_kernel_output (splice, mmap) */ |
6dccd6c1 | 55 | int overwrite; /* 1: overwrite, 0: discard */ |
8e099bae | 56 | char padding[LTTNG_KERNEL_CHANNEL_PADDING]; |
1a598612 | 57 | } __attribute__((packed)); |
57a13317 | 58 | |
7371f44c MD |
59 | struct lttng_kernel_kretprobe { |
60 | uint64_t addr; | |
61 | ||
62 | uint64_t offset; | |
f8695253 | 63 | char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; |
1a598612 | 64 | } __attribute__((packed)); |
7371f44c | 65 | |
38d024ae MD |
66 | /* |
67 | * Either addr is used, or symbol_name and offset. | |
68 | */ | |
69 | struct lttng_kernel_kprobe { | |
80c16bcf | 70 | uint64_t addr; |
38d024ae | 71 | |
80c16bcf | 72 | uint64_t offset; |
f8695253 | 73 | char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; |
1a598612 | 74 | } __attribute__((packed)); |
d6d808f3 | 75 | |
f17701fb | 76 | struct lttng_kernel_function_tracer { |
f8695253 | 77 | char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; |
1a598612 | 78 | } __attribute__((packed)); |
f17701fb | 79 | |
149b9a9d | 80 | struct lttng_kernel_uprobe { |
56377c91 | 81 | int fd; |
3aed4dca FD |
82 | } __attribute__((packed)); |
83 | ||
84 | struct lttng_kernel_event_callsite_uprobe { | |
149b9a9d YB |
85 | uint64_t offset; |
86 | } __attribute__((packed)); | |
87 | ||
3aed4dca FD |
88 | struct lttng_kernel_event_callsite { |
89 | union { | |
90 | struct lttng_kernel_event_callsite_uprobe uprobe; | |
91 | } u; | |
92 | } __attribute__((packed)); | |
93 | ||
badfe9f5 | 94 | enum lttng_kernel_syscall_entryexit { |
c5d12b5b FD |
95 | LTTNG_KERNEL_SYSCALL_ENTRYEXIT = 0, |
96 | LTTNG_KERNEL_SYSCALL_ENTRY = 1, | |
97 | LTTNG_KERNEL_SYSCALL_EXIT = 2, | |
badfe9f5 MD |
98 | }; |
99 | ||
100 | enum lttng_kernel_syscall_abi { | |
101 | LTTNG_KERNEL_SYSCALL_ABI_ALL = 0, | |
8a8ac9a8 FD |
102 | LTTNG_KERNEL_SYSCALL_ABI_NATIVE = 1, |
103 | LTTNG_KERNEL_SYSCALL_ABI_COMPAT = 2, | |
badfe9f5 MD |
104 | }; |
105 | ||
106 | enum lttng_kernel_syscall_match { | |
cff6938b FD |
107 | LTTNG_KERNEL_SYSCALL_MATCH_NAME = 0, |
108 | LTTNG_KERNEL_SYSCALL_MATCH_NR = 1, /* Not implemented. */ | |
badfe9f5 MD |
109 | }; |
110 | ||
111 | struct lttng_kernel_syscall { | |
112 | uint8_t entryexit; /* enum lttng_kernel_syscall_entryexit */ | |
113 | uint8_t abi; /* enum lttng_kernel_syscall_abi */ | |
114 | uint8_t match; /* enum lttng_kernel_syscall_match */ | |
115 | uint8_t padding; | |
116 | uint32_t nr; /* For LTTNG_SYSCALL_MATCH_NR */ | |
117 | } __attribute__((packed)); | |
118 | ||
43880ee8 | 119 | /* |
3c997079 | 120 | * For syscall tracing, name = "*" means "enable all". |
43880ee8 | 121 | */ |
d4f52727 | 122 | #define LTTNG_KERNEL_EVENT_PADDING1 8 |
8e099bae | 123 | #define LTTNG_KERNEL_EVENT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32 |
d6d808f3 | 124 | struct lttng_kernel_event { |
f8695253 | 125 | char name[LTTNG_KERNEL_SYM_NAME_LEN]; /* event name */ |
b6c846f1 | 126 | uint32_t instrumentation; /* enum lttng_kernel_instrumentation */ |
d4f52727 | 127 | uint64_t token; /* User-provided token */ |
8e099bae MD |
128 | char padding[LTTNG_KERNEL_EVENT_PADDING1]; |
129 | ||
d6d808f3 MD |
130 | /* Per instrumentation type configuration */ |
131 | union { | |
7371f44c | 132 | struct lttng_kernel_kretprobe kretprobe; |
d6d808f3 | 133 | struct lttng_kernel_kprobe kprobe; |
f17701fb | 134 | struct lttng_kernel_function_tracer ftrace; |
149b9a9d | 135 | struct lttng_kernel_uprobe uprobe; |
badfe9f5 | 136 | struct lttng_kernel_syscall syscall; |
8e099bae | 137 | char padding[LTTNG_KERNEL_EVENT_PADDING2]; |
d6d808f3 | 138 | } u; |
1a598612 | 139 | } __attribute__((packed)); |
c099397a | 140 | |
dffef45d FD |
141 | #define LTTNG_KERNEL_EVENT_NOTIFIER_PADDING1 16 |
142 | struct lttng_kernel_event_notifier { | |
143 | struct lttng_kernel_event event; | |
99f52fcc | 144 | uint64_t error_counter_index; |
dffef45d FD |
145 | |
146 | char padding[LTTNG_KERNEL_EVENT_NOTIFIER_PADDING1]; | |
147 | } __attribute__((packed)); | |
148 | ||
99f52fcc FD |
149 | enum lttng_kernel_counter_arithmetic { |
150 | LTTNG_KERNEL_COUNTER_ARITHMETIC_MODULAR = 1, | |
151 | }; | |
152 | ||
153 | enum lttng_kernel_counter_bitness { | |
154 | LTTNG_KERNEL_COUNTER_BITNESS_32 = 1, | |
155 | LTTNG_KERNEL_COUNTER_BITNESS_64 = 2, | |
156 | }; | |
157 | ||
158 | struct lttng_kernel_counter_dimension { | |
159 | uint64_t size; | |
160 | uint64_t underflow_index; | |
161 | uint64_t overflow_index; | |
162 | uint8_t has_underflow; | |
163 | uint8_t has_overflow; | |
164 | } __attribute__((packed)); | |
165 | ||
166 | #define LTTNG_KERNEL_COUNTER_DIMENSION_MAX 4 | |
167 | struct lttng_kernel_counter_conf { | |
168 | uint32_t arithmetic; /* enum lttng_kernel_counter_arithmetic */ | |
169 | uint32_t bitness; /* enum lttng_kernel_counter_bitness */ | |
170 | uint32_t number_dimensions; | |
171 | int64_t global_sum_step; | |
172 | struct lttng_kernel_counter_dimension dimensions[LTTNG_KERNEL_COUNTER_DIMENSION_MAX]; | |
173 | } __attribute__((packed)); | |
174 | ||
175 | struct lttng_kernel_counter_index { | |
176 | uint32_t number_dimensions; | |
177 | uint64_t dimension_indexes[LTTNG_KERNEL_COUNTER_DIMENSION_MAX]; | |
178 | } __attribute__((packed)); | |
179 | ||
180 | struct lttng_kernel_counter_value { | |
181 | int64_t value; | |
182 | uint8_t underflow; | |
183 | uint8_t overflow; | |
184 | } __attribute__((packed)); | |
185 | ||
186 | #define LTTNG_KERNEL_COUNTER_READ_PADDING 32 | |
187 | struct lttng_kernel_counter_read { | |
188 | struct lttng_kernel_counter_index index; | |
189 | int32_t cpu; /* -1 for global counter, >= 0 for specific cpu. */ | |
190 | struct lttng_kernel_counter_value value; /* output */ | |
191 | char padding[LTTNG_KERNEL_COUNTER_READ_PADDING]; | |
192 | } __attribute__((packed)); | |
193 | ||
194 | #define LTTNG_KERNEL_COUNTER_AGGREGATE_PADDING 32 | |
195 | struct lttng_kernel_counter_aggregate { | |
196 | struct lttng_kernel_counter_index index; | |
197 | struct lttng_kernel_counter_value value; /* output */ | |
198 | char padding[LTTNG_KERNEL_COUNTER_AGGREGATE_PADDING]; | |
199 | } __attribute__((packed)); | |
200 | ||
201 | #define LTTNG_KERNEL_COUNTER_CLEAR_PADDING 32 | |
202 | struct lttng_kernel_counter_clear { | |
203 | struct lttng_kernel_counter_index index; | |
204 | char padding[LTTNG_KERNEL_COUNTER_CLEAR_PADDING]; | |
205 | } __attribute__((packed)); | |
206 | ||
99d223ad FD |
207 | #define LTTNG_KERNEL_EVENT_NOTIFIER_NOTIFICATION_PADDING 32 |
208 | struct lttng_kernel_event_notifier_notification { | |
209 | uint64_t token; | |
210 | uint16_t capture_buf_size; | |
211 | char padding[LTTNG_KERNEL_EVENT_NOTIFIER_NOTIFICATION_PADDING]; | |
212 | } __attribute__((packed)); | |
213 | ||
80c16bcf | 214 | struct lttng_kernel_tracer_version { |
c6c9e10f MD |
215 | uint32_t major; |
216 | uint32_t minor; | |
80c16bcf | 217 | uint32_t patchlevel; |
1a598612 | 218 | } __attribute__((packed)); |
80c16bcf | 219 | |
42cabb80 MD |
220 | struct lttng_kernel_tracer_abi_version { |
221 | uint32_t major; | |
222 | uint32_t minor; | |
223 | } __attribute__((packed)); | |
224 | ||
7f859fbf JR |
225 | struct lttng_kernel_session_name { |
226 | char name[LTTNG_KERNEL_SESSION_NAME_LEN]; | |
227 | } __attribute__((packed)); | |
228 | ||
1c88f269 JR |
229 | struct lttng_kernel_session_creation_time { |
230 | char iso8601[LTTNG_KERNEL_SESSION_CREATION_TIME_ISO8601_LEN]; | |
231 | } __attribute__((packed)); | |
232 | ||
3db41b2c MD |
233 | enum lttng_kernel_calibrate_type { |
234 | LTTNG_KERNEL_CALIBRATE_KRETPROBE, | |
57105fc2 MD |
235 | }; |
236 | ||
3db41b2c | 237 | struct lttng_kernel_calibrate { |
b6c846f1 | 238 | uint32_t type; /* enum lttng_kernel_calibrate_type (input) */ |
1a598612 | 239 | } __attribute__((packed)); |
57105fc2 | 240 | |
12e579db MD |
241 | struct lttng_kernel_syscall_mask { |
242 | uint32_t len; /* in bits */ | |
243 | char mask[]; | |
244 | } __attribute__((packed)); | |
245 | ||
12a313a5 | 246 | enum lttng_kernel_context_type { |
4c183524 MD |
247 | LTTNG_KERNEL_CONTEXT_PID = 0, |
248 | LTTNG_KERNEL_CONTEXT_PERF_COUNTER = 1, | |
a2563e83 | 249 | LTTNG_KERNEL_CONTEXT_PROCNAME = 2, |
4c183524 MD |
250 | LTTNG_KERNEL_CONTEXT_PRIO = 3, |
251 | LTTNG_KERNEL_CONTEXT_NICE = 4, | |
252 | LTTNG_KERNEL_CONTEXT_VPID = 5, | |
253 | LTTNG_KERNEL_CONTEXT_TID = 6, | |
254 | LTTNG_KERNEL_CONTEXT_VTID = 7, | |
255 | LTTNG_KERNEL_CONTEXT_PPID = 8, | |
256 | LTTNG_KERNEL_CONTEXT_VPPID = 9, | |
975da2c0 | 257 | LTTNG_KERNEL_CONTEXT_HOSTNAME = 10, |
b3699d90 | 258 | LTTNG_KERNEL_CONTEXT_CPU_ID = 11, |
79150a49 JD |
259 | LTTNG_KERNEL_CONTEXT_INTERRUPTIBLE = 12, |
260 | LTTNG_KERNEL_CONTEXT_PREEMPTIBLE = 13, | |
261 | LTTNG_KERNEL_CONTEXT_NEED_RESCHEDULE = 14, | |
262 | LTTNG_KERNEL_CONTEXT_MIGRATABLE = 15, | |
2fa2d39a FG |
263 | LTTNG_KERNEL_CONTEXT_CALLSTACK_KERNEL = 16, |
264 | LTTNG_KERNEL_CONTEXT_CALLSTACK_USER = 17, | |
a6cf40a4 MJ |
265 | LTTNG_KERNEL_CONTEXT_CGROUP_NS = 18, |
266 | LTTNG_KERNEL_CONTEXT_IPC_NS = 19, | |
267 | LTTNG_KERNEL_CONTEXT_MNT_NS = 20, | |
268 | LTTNG_KERNEL_CONTEXT_NET_NS = 21, | |
269 | LTTNG_KERNEL_CONTEXT_PID_NS = 22, | |
270 | LTTNG_KERNEL_CONTEXT_USER_NS = 23, | |
271 | LTTNG_KERNEL_CONTEXT_UTS_NS = 24, | |
dc923e75 MJ |
272 | LTTNG_KERNEL_CONTEXT_UID = 25, |
273 | LTTNG_KERNEL_CONTEXT_EUID = 26, | |
274 | LTTNG_KERNEL_CONTEXT_SUID = 27, | |
275 | LTTNG_KERNEL_CONTEXT_GID = 28, | |
276 | LTTNG_KERNEL_CONTEXT_EGID = 29, | |
277 | LTTNG_KERNEL_CONTEXT_SGID = 30, | |
278 | LTTNG_KERNEL_CONTEXT_VUID = 31, | |
279 | LTTNG_KERNEL_CONTEXT_VEUID = 32, | |
280 | LTTNG_KERNEL_CONTEXT_VSUID = 33, | |
281 | LTTNG_KERNEL_CONTEXT_VGID = 34, | |
282 | LTTNG_KERNEL_CONTEXT_VEGID = 35, | |
283 | LTTNG_KERNEL_CONTEXT_VSGID = 36, | |
876e2e92 | 284 | LTTNG_KERNEL_CONTEXT_TIME_NS = 37, |
8070f5c0 MD |
285 | }; |
286 | ||
287 | struct lttng_kernel_perf_counter_ctx { | |
288 | uint32_t type; | |
289 | uint64_t config; | |
f8695253 | 290 | char name[LTTNG_KERNEL_SYM_NAME_LEN]; |
1a598612 | 291 | } __attribute__((packed)); |
8070f5c0 | 292 | |
8e099bae MD |
293 | #define LTTNG_KERNEL_CONTEXT_PADDING1 16 |
294 | #define LTTNG_KERNEL_CONTEXT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32 | |
8070f5c0 | 295 | struct lttng_kernel_context { |
b6c846f1 | 296 | uint32_t ctx; /*enum lttng_kernel_context_type */ |
8e099bae MD |
297 | char padding[LTTNG_KERNEL_CONTEXT_PADDING1]; |
298 | ||
8070f5c0 | 299 | union { |
8070f5c0 | 300 | struct lttng_kernel_perf_counter_ctx perf_counter; |
8e099bae | 301 | char padding[LTTNG_KERNEL_CONTEXT_PADDING2]; |
8070f5c0 | 302 | } u; |
1a598612 | 303 | } __attribute__((packed)); |
8070f5c0 | 304 | |
f127e61e | 305 | #define LTTNG_KERNEL_FILTER_BYTECODE_MAX_LEN 65536 |
07dfc1d0 MD |
306 | struct lttng_kernel_filter_bytecode { |
307 | uint32_t len; | |
308 | uint32_t reloc_offset; | |
309 | uint64_t seqnum; | |
310 | char data[0]; | |
311 | } __attribute__((packed)); | |
312 | ||
99d223ad FD |
313 | #define LTTNG_KERNEL_CAPTURE_BYTECODE_MAX_LEN 65536 |
314 | struct lttng_kernel_capture_bytecode { | |
315 | uint32_t len; | |
316 | uint32_t reloc_offset; | |
317 | uint64_t seqnum; | |
318 | char data[0]; | |
319 | } __attribute__((packed)); | |
320 | ||
d1f652f8 MD |
321 | enum lttng_kernel_tracker_type { |
322 | LTTNG_KERNEL_TRACKER_UNKNOWN = -1, | |
323 | ||
324 | LTTNG_KERNEL_TRACKER_PID = 0, | |
325 | LTTNG_KERNEL_TRACKER_VPID = 1, | |
326 | LTTNG_KERNEL_TRACKER_UID = 2, | |
327 | LTTNG_KERNEL_TRACKER_VUID = 3, | |
328 | LTTNG_KERNEL_TRACKER_GID = 4, | |
329 | LTTNG_KERNEL_TRACKER_VGID = 5, | |
330 | }; | |
331 | ||
332 | struct lttng_kernel_tracker_args { | |
b6c846f1 | 333 | uint32_t type; /* enum lttng_kernel_tracker_type */ |
d1f652f8 MD |
334 | int32_t id; |
335 | }; | |
336 | ||
33749530 | 337 | /* LTTng file descriptor ioctl */ |
2df37e95 | 338 | /* lttng/abi-old.h reserve 0x40, 0x41, 0x42, 0x43, and 0x44. */ |
6dccd6c1 | 339 | #define LTTNG_KERNEL_SESSION _IO(0xF6, 0x45) |
33749530 | 340 | #define LTTNG_KERNEL_TRACER_VERSION \ |
6dccd6c1 JD |
341 | _IOR(0xF6, 0x46, struct lttng_kernel_tracer_version) |
342 | #define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x47) | |
343 | #define LTTNG_KERNEL_WAIT_QUIESCENT _IO(0xF6, 0x48) | |
57105fc2 | 344 | #define LTTNG_KERNEL_CALIBRATE \ |
6dccd6c1 | 345 | _IOWR(0xF6, 0x49, struct lttng_kernel_calibrate) |
29c956bb | 346 | #define LTTNG_KERNEL_SYSCALL_LIST _IO(0xF6, 0x4A) |
42cabb80 MD |
347 | #define LTTNG_KERNEL_TRACER_ABI_VERSION \ |
348 | _IOR(0xF6, 0x4B, struct lttng_kernel_tracer_abi_version) | |
750b05f2 | 349 | #define LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_CREATE _IO(0xF6, 0x4C) |
33749530 MD |
350 | |
351 | /* Session FD ioctl */ | |
2df37e95 | 352 | /* lttng/abi-old.h reserve 0x50, 0x51, 0x52, and 0x53. */ |
33749530 | 353 | #define LTTNG_KERNEL_METADATA \ |
6dccd6c1 | 354 | _IOW(0xF6, 0x54, struct lttng_kernel_channel) |
ab2277d6 | 355 | #define LTTNG_KERNEL_CHANNEL \ |
6dccd6c1 JD |
356 | _IOW(0xF6, 0x55, struct lttng_kernel_channel) |
357 | #define LTTNG_KERNEL_SESSION_START _IO(0xF6, 0x56) | |
358 | #define LTTNG_KERNEL_SESSION_STOP _IO(0xF6, 0x57) | |
e0130fab MD |
359 | #define LTTNG_KERNEL_SESSION_TRACK_PID \ |
360 | _IOR(0xF6, 0x58, int32_t) | |
361 | #define LTTNG_KERNEL_SESSION_UNTRACK_PID \ | |
362 | _IOR(0xF6, 0x59, int32_t) | |
d1f652f8 | 363 | |
fe40f016 MD |
364 | /* |
365 | * ioctl 0x58 and 0x59 are duplicated here. It works, since _IOR vs _IO | |
366 | * are generating two different ioctl numbers, but this was not done on | |
367 | * purpose. We should generally try to avoid those duplications. | |
368 | */ | |
7e6f9ef6 | 369 | #define LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58) |
9616f0bf | 370 | #define LTTNG_KERNEL_SESSION_METADATA_REGEN _IO(0xF6, 0x59) |
7f859fbf | 371 | |
2df37e95 | 372 | /* lttng/abi-old.h reserve 0x5A and 0x5B. */ |
601252cf | 373 | #define LTTNG_KERNEL_SESSION_STATEDUMP _IO(0xF6, 0x5C) |
7f859fbf JR |
374 | #define LTTNG_KERNEL_SESSION_SET_NAME \ |
375 | _IOR(0xF6, 0x5D, struct lttng_kernel_session_name) | |
1c88f269 JR |
376 | #define LTTNG_KERNEL_SESSION_SET_CREATION_TIME \ |
377 | _IOR(0xF6, 0x5E, struct lttng_kernel_session_creation_time) | |
33749530 MD |
378 | |
379 | /* Channel FD ioctl */ | |
2df37e95 | 380 | /* lttng/abi-old.h reserve 0x60 and 0x61. */ |
6dccd6c1 | 381 | #define LTTNG_KERNEL_STREAM _IO(0xF6, 0x62) |
ab2277d6 | 382 | #define LTTNG_KERNEL_EVENT \ |
6dccd6c1 | 383 | _IOW(0xF6, 0x63, struct lttng_kernel_event) |
12e579db MD |
384 | #define LTTNG_KERNEL_SYSCALL_MASK \ |
385 | _IOWR(0xF6, 0x64, struct lttng_kernel_syscall_mask) | |
57a13317 | 386 | |
8070f5c0 | 387 | /* Event and Channel FD ioctl */ |
2df37e95 | 388 | /* lttng/abi-old.h reserve 0x70. */ |
8070f5c0 | 389 | #define LTTNG_KERNEL_CONTEXT \ |
6dccd6c1 | 390 | _IOW(0xF6, 0x71, struct lttng_kernel_context) |
8070f5c0 | 391 | |
99f52fcc | 392 | /* Event, Event notifier, Channel, Counter and Session ioctl */ |
2df37e95 | 393 | /* lttng/abi-old.h reserve 0x80 and 0x81. */ |
6dccd6c1 JD |
394 | #define LTTNG_KERNEL_ENABLE _IO(0xF6, 0x82) |
395 | #define LTTNG_KERNEL_DISABLE _IO(0xF6, 0x83) | |
e64957da | 396 | |
99f52fcc FD |
397 | /* Trigger group and session ioctl */ |
398 | #define LTTNG_KERNEL_COUNTER \ | |
399 | _IOW(0xF6, 0x84, struct lttng_kernel_counter_conf) | |
400 | ||
dffef45d | 401 | /* Event and Event notifier FD ioctl */ |
07dfc1d0 | 402 | #define LTTNG_KERNEL_FILTER _IO(0xF6, 0x90) |
3aed4dca | 403 | #define LTTNG_KERNEL_ADD_CALLSITE _IO(0xF6, 0x91) |
07dfc1d0 | 404 | |
d1f652f8 MD |
405 | /* Session FD ioctl (continued) */ |
406 | #define LTTNG_KERNEL_SESSION_LIST_TRACKER_IDS \ | |
407 | _IOR(0xF6, 0xA0, struct lttng_kernel_tracker_args) | |
408 | #define LTTNG_KERNEL_SESSION_TRACK_ID \ | |
409 | _IOR(0xF6, 0xA1, struct lttng_kernel_tracker_args) | |
410 | #define LTTNG_KERNEL_SESSION_UNTRACK_ID \ | |
411 | _IOR(0xF6, 0xA2, struct lttng_kernel_tracker_args) | |
412 | ||
dffef45d FD |
413 | /* Event notifier group file descriptor ioctl */ |
414 | #define LTTNG_KERNEL_EVENT_NOTIFIER_CREATE \ | |
415 | _IOW(0xF6, 0xB0, struct lttng_kernel_event_notifier) | |
21f58fb7 FD |
416 | #define LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD \ |
417 | _IO(0xF6, 0xB1) | |
dffef45d | 418 | |
99d223ad FD |
419 | /* Event notifier file descriptor ioctl */ |
420 | #define LTTNG_KERNEL_CAPTURE _IO(0xF6, 0xB8) | |
421 | ||
99f52fcc FD |
422 | /* Counter file descriptor ioctl */ |
423 | #define LTTNG_KERNEL_COUNTER_READ \ | |
424 | _IOWR(0xF6, 0xC0, struct lttng_kernel_counter_read) | |
425 | #define LTTNG_KERNEL_COUNTER_AGGREGATE \ | |
426 | _IOWR(0xF6, 0xC1, struct lttng_kernel_counter_aggregate) | |
427 | #define LTTNG_KERNEL_COUNTER_CLEAR \ | |
428 | _IOW(0xF6, 0xC2, struct lttng_kernel_counter_clear) | |
429 | ||
430 | ||
1aca53e1 MD |
431 | /* |
432 | * LTTng-specific ioctls for the lib ringbuffer. | |
433 | * | |
434 | * Operations applying to the current sub-buffer need to occur between | |
435 | * a get/put or get_next/put_next ioctl pair. | |
436 | */ | |
437 | ||
3b731ab1 JD |
438 | /* returns the timestamp begin of the current sub-buffer */ |
439 | #define LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t) | |
440 | /* returns the timestamp end of the current sub-buffer */ | |
441 | #define LTTNG_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t) | |
1aca53e1 | 442 | /* returns the number of events discarded of the current sub-buffer */ |
3b731ab1 | 443 | #define LTTNG_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t) |
1aca53e1 | 444 | /* returns the packet payload size of the current sub-buffer */ |
3b731ab1 | 445 | #define LTTNG_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t) |
1aca53e1 | 446 | /* returns the packet size of the current sub-buffer*/ |
3b731ab1 | 447 | #define LTTNG_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t) |
1aca53e1 | 448 | /* returns the stream id (invariant for the stream) */ |
3b731ab1 | 449 | #define LTTNG_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t) |
1aca53e1 | 450 | /* returns the current timestamp as perceived from the tracer */ |
2348ca17 | 451 | #define LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t) |
1aca53e1 | 452 | /* returns the packet sequence number of the current sub-buffer */ |
5b3cf4f9 | 453 | #define LTTNG_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t) |
1aca53e1 | 454 | /* returns the stream instance id (invariant for the stream) */ |
5594698f | 455 | #define LTTNG_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t) |
3b731ab1 JD |
456 | |
457 | #ifdef CONFIG_COMPAT | |
458 | /* returns the timestamp begin of the current sub-buffer */ | |
459 | #define LTTNG_RING_BUFFER_COMPAT_GET_TIMESTAMP_BEGIN \ | |
460 | LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN | |
461 | /* returns the timestamp end of the current sub-buffer */ | |
462 | #define LTTNG_RING_BUFFER_COMPAT_GET_TIMESTAMP_END \ | |
463 | LTTNG_RING_BUFFER_GET_TIMESTAMP_END | |
1aca53e1 | 464 | /* returns the number of events discarded of the current sub-buffer */ |
3b731ab1 JD |
465 | #define LTTNG_RING_BUFFER_COMPAT_GET_EVENTS_DISCARDED \ |
466 | LTTNG_RING_BUFFER_GET_EVENTS_DISCARDED | |
1aca53e1 | 467 | /* returns the packet payload size of the current sub-buffer */ |
3b731ab1 JD |
468 | #define LTTNG_RING_BUFFER_COMPAT_GET_CONTENT_SIZE \ |
469 | LTTNG_RING_BUFFER_GET_CONTENT_SIZE | |
1aca53e1 | 470 | /* returns the packet size of the current sub-buffer */ |
3b731ab1 JD |
471 | #define LTTNG_RING_BUFFER_COMPAT_GET_PACKET_SIZE \ |
472 | LTTNG_RING_BUFFER_GET_PACKET_SIZE | |
1aca53e1 | 473 | /* returns the stream id (invariant for the stream) */ |
3b731ab1 JD |
474 | #define LTTNG_RING_BUFFER_COMPAT_GET_STREAM_ID \ |
475 | LTTNG_RING_BUFFER_GET_STREAM_ID | |
1aca53e1 | 476 | /* returns the current timestamp as perceived from the tracer */ |
2348ca17 JD |
477 | #define LTTNG_RING_BUFFER_COMPAT_GET_CURRENT_TIMESTAMP \ |
478 | LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP | |
1aca53e1 | 479 | /* returns the packet sequence number of the current sub-buffer */ |
5b3cf4f9 JD |
480 | #define LTTNG_RING_BUFFER_COMPAT_GET_SEQ_NUM \ |
481 | LTTNG_RING_BUFFER_GET_SEQ_NUM | |
1aca53e1 | 482 | /* returns the stream instance id (invariant for the stream) */ |
5594698f JD |
483 | #define LTTNG_RING_BUFFER_COMPAT_INSTANCE_ID \ |
484 | LTTNG_RING_BUFFER_INSTANCE_ID | |
3b731ab1 JD |
485 | #endif /* CONFIG_COMPAT */ |
486 | ||
e8951e63 | 487 | #endif /* _LTTNG_ABI_H */ |