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 |
6b4a3b2d | 21 | #define LTTNG_MODULES_ABI_MINOR_VERSION 6 |
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 | |
2af7b13b | 141 | #define LTTNG_KERNEL_EVENT_NOTIFIER_PADDING 32 |
dffef45d FD |
142 | struct lttng_kernel_event_notifier { |
143 | struct lttng_kernel_event event; | |
99f52fcc | 144 | uint64_t error_counter_index; |
dffef45d | 145 | |
2af7b13b | 146 | char padding[LTTNG_KERNEL_EVENT_NOTIFIER_PADDING]; |
dffef45d FD |
147 | } __attribute__((packed)); |
148 | ||
dd1ee958 | 149 | #define LTTNG_KERNEL_COUNTER_DIMENSION_MAX 4 |
0c023c01 MD |
150 | #define LTTNG_KERNEL_EVENT_NOTIFIER_NOTIFICATION_PADDING 32 |
151 | struct lttng_kernel_event_notifier_notification { | |
152 | uint64_t token; | |
153 | uint16_t capture_buf_size; | |
154 | char padding[LTTNG_KERNEL_EVENT_NOTIFIER_NOTIFICATION_PADDING]; | |
155 | } __attribute__((packed)); | |
156 | ||
157 | enum lttng_kernel_key_token_type { | |
158 | LTTNG_KERNEL_KEY_TOKEN_STRING = 0, /* arg: string_ptr. */ | |
159 | LTTNG_KERNEL_KEY_TOKEN_EVENT_NAME = 1, /* no arg. */ | |
160 | LTTNG_KERNEL_KEY_TOKEN_PROVIDER_NAME = 2, /* no arg. */ | |
161 | }; | |
162 | ||
163 | #define LTTNG_KERNEL_KEY_ARG_PADDING1 60 | |
164 | #define LTTNG_KERNEL_KEY_TOKEN_STRING_LEN_MAX 256 | |
165 | struct lttng_kernel_key_token { | |
166 | uint32_t type; /* enum lttng_kernel_key_token_type */ | |
167 | union { | |
168 | uint64_t string_ptr; | |
169 | char padding[LTTNG_KERNEL_KEY_ARG_PADDING1]; | |
170 | } arg; | |
171 | } __attribute__((packed)); | |
172 | ||
173 | #define LTTNG_KERNEL_NR_KEY_TOKEN 4 | |
174 | struct lttng_kernel_counter_key_dimension { | |
175 | uint32_t nr_key_tokens; | |
176 | struct lttng_kernel_key_token key_tokens[LTTNG_KERNEL_NR_KEY_TOKEN]; | |
177 | } __attribute__((packed)); | |
178 | ||
179 | struct lttng_kernel_counter_key { | |
180 | uint32_t nr_dimensions; | |
181 | struct lttng_kernel_counter_key_dimension key_dimensions[LTTNG_KERNEL_COUNTER_DIMENSION_MAX]; | |
182 | } __attribute__((packed)); | |
183 | ||
184 | #define LTTNG_KERNEL_COUNTER_EVENT_PADDING1 16 | |
185 | struct lttng_kernel_counter_event { | |
186 | struct lttng_kernel_event event; | |
187 | struct lttng_kernel_counter_key key; | |
188 | char padding[LTTNG_KERNEL_COUNTER_EVENT_PADDING1]; | |
189 | } __attribute__((packed)); | |
dd1ee958 | 190 | |
99f52fcc | 191 | enum lttng_kernel_counter_arithmetic { |
8545187a | 192 | LTTNG_KERNEL_COUNTER_ARITHMETIC_MODULAR = 0, |
99f52fcc FD |
193 | }; |
194 | ||
195 | enum lttng_kernel_counter_bitness { | |
8545187a MD |
196 | LTTNG_KERNEL_COUNTER_BITNESS_32 = 0, |
197 | LTTNG_KERNEL_COUNTER_BITNESS_64 = 1, | |
99f52fcc FD |
198 | }; |
199 | ||
200 | struct lttng_kernel_counter_dimension { | |
201 | uint64_t size; | |
202 | uint64_t underflow_index; | |
203 | uint64_t overflow_index; | |
204 | uint8_t has_underflow; | |
205 | uint8_t has_overflow; | |
206 | } __attribute__((packed)); | |
207 | ||
dd1ee958 | 208 | #define LTTNG_KERNEL_COUNTER_CONF_PADDING1 67 |
99f52fcc FD |
209 | struct lttng_kernel_counter_conf { |
210 | uint32_t arithmetic; /* enum lttng_kernel_counter_arithmetic */ | |
211 | uint32_t bitness; /* enum lttng_kernel_counter_bitness */ | |
212 | uint32_t number_dimensions; | |
213 | int64_t global_sum_step; | |
214 | struct lttng_kernel_counter_dimension dimensions[LTTNG_KERNEL_COUNTER_DIMENSION_MAX]; | |
dd1ee958 MD |
215 | uint8_t coalesce_hits; |
216 | char padding[LTTNG_KERNEL_COUNTER_CONF_PADDING1]; | |
99f52fcc FD |
217 | } __attribute__((packed)); |
218 | ||
219 | struct lttng_kernel_counter_index { | |
220 | uint32_t number_dimensions; | |
221 | uint64_t dimension_indexes[LTTNG_KERNEL_COUNTER_DIMENSION_MAX]; | |
222 | } __attribute__((packed)); | |
223 | ||
224 | struct lttng_kernel_counter_value { | |
225 | int64_t value; | |
226 | uint8_t underflow; | |
227 | uint8_t overflow; | |
228 | } __attribute__((packed)); | |
229 | ||
230 | #define LTTNG_KERNEL_COUNTER_READ_PADDING 32 | |
231 | struct lttng_kernel_counter_read { | |
232 | struct lttng_kernel_counter_index index; | |
233 | int32_t cpu; /* -1 for global counter, >= 0 for specific cpu. */ | |
234 | struct lttng_kernel_counter_value value; /* output */ | |
235 | char padding[LTTNG_KERNEL_COUNTER_READ_PADDING]; | |
236 | } __attribute__((packed)); | |
237 | ||
238 | #define LTTNG_KERNEL_COUNTER_AGGREGATE_PADDING 32 | |
239 | struct lttng_kernel_counter_aggregate { | |
240 | struct lttng_kernel_counter_index index; | |
241 | struct lttng_kernel_counter_value value; /* output */ | |
242 | char padding[LTTNG_KERNEL_COUNTER_AGGREGATE_PADDING]; | |
243 | } __attribute__((packed)); | |
244 | ||
245 | #define LTTNG_KERNEL_COUNTER_CLEAR_PADDING 32 | |
246 | struct lttng_kernel_counter_clear { | |
247 | struct lttng_kernel_counter_index index; | |
248 | char padding[LTTNG_KERNEL_COUNTER_CLEAR_PADDING]; | |
249 | } __attribute__((packed)); | |
250 | ||
0c023c01 MD |
251 | #define LTTNG_KERNEL_COUNTER_KEY_LEN 256 |
252 | #define LTTNG_KERNEL_COUNTER_MAP_DESCRIPTOR_PADDING 32 | |
253 | struct lttng_kernel_counter_map_descriptor { | |
254 | uint64_t descriptor_index; /* input. [ 0 .. nr_descriptors - 1 ] */ | |
255 | ||
256 | uint32_t dimension; /* outputs */ | |
257 | uint64_t array_index; | |
258 | uint64_t user_token; | |
259 | char key[LTTNG_KERNEL_COUNTER_KEY_LEN]; | |
260 | ||
261 | char padding[LTTNG_KERNEL_COUNTER_MAP_DESCRIPTOR_PADDING]; | |
99d223ad FD |
262 | } __attribute__((packed)); |
263 | ||
80c16bcf | 264 | struct lttng_kernel_tracer_version { |
c6c9e10f MD |
265 | uint32_t major; |
266 | uint32_t minor; | |
80c16bcf | 267 | uint32_t patchlevel; |
1a598612 | 268 | } __attribute__((packed)); |
80c16bcf | 269 | |
42cabb80 MD |
270 | struct lttng_kernel_tracer_abi_version { |
271 | uint32_t major; | |
272 | uint32_t minor; | |
273 | } __attribute__((packed)); | |
274 | ||
7f859fbf JR |
275 | struct lttng_kernel_session_name { |
276 | char name[LTTNG_KERNEL_SESSION_NAME_LEN]; | |
277 | } __attribute__((packed)); | |
278 | ||
1c88f269 JR |
279 | struct lttng_kernel_session_creation_time { |
280 | char iso8601[LTTNG_KERNEL_SESSION_CREATION_TIME_ISO8601_LEN]; | |
281 | } __attribute__((packed)); | |
282 | ||
3db41b2c MD |
283 | enum lttng_kernel_calibrate_type { |
284 | LTTNG_KERNEL_CALIBRATE_KRETPROBE, | |
57105fc2 MD |
285 | }; |
286 | ||
3db41b2c | 287 | struct lttng_kernel_calibrate { |
b6c846f1 | 288 | uint32_t type; /* enum lttng_kernel_calibrate_type (input) */ |
1a598612 | 289 | } __attribute__((packed)); |
57105fc2 | 290 | |
12e579db MD |
291 | struct lttng_kernel_syscall_mask { |
292 | uint32_t len; /* in bits */ | |
293 | char mask[]; | |
294 | } __attribute__((packed)); | |
295 | ||
12a313a5 | 296 | enum lttng_kernel_context_type { |
4c183524 MD |
297 | LTTNG_KERNEL_CONTEXT_PID = 0, |
298 | LTTNG_KERNEL_CONTEXT_PERF_COUNTER = 1, | |
a2563e83 | 299 | LTTNG_KERNEL_CONTEXT_PROCNAME = 2, |
4c183524 MD |
300 | LTTNG_KERNEL_CONTEXT_PRIO = 3, |
301 | LTTNG_KERNEL_CONTEXT_NICE = 4, | |
302 | LTTNG_KERNEL_CONTEXT_VPID = 5, | |
303 | LTTNG_KERNEL_CONTEXT_TID = 6, | |
304 | LTTNG_KERNEL_CONTEXT_VTID = 7, | |
305 | LTTNG_KERNEL_CONTEXT_PPID = 8, | |
306 | LTTNG_KERNEL_CONTEXT_VPPID = 9, | |
975da2c0 | 307 | LTTNG_KERNEL_CONTEXT_HOSTNAME = 10, |
b3699d90 | 308 | LTTNG_KERNEL_CONTEXT_CPU_ID = 11, |
79150a49 JD |
309 | LTTNG_KERNEL_CONTEXT_INTERRUPTIBLE = 12, |
310 | LTTNG_KERNEL_CONTEXT_PREEMPTIBLE = 13, | |
311 | LTTNG_KERNEL_CONTEXT_NEED_RESCHEDULE = 14, | |
312 | LTTNG_KERNEL_CONTEXT_MIGRATABLE = 15, | |
2fa2d39a FG |
313 | LTTNG_KERNEL_CONTEXT_CALLSTACK_KERNEL = 16, |
314 | LTTNG_KERNEL_CONTEXT_CALLSTACK_USER = 17, | |
a6cf40a4 MJ |
315 | LTTNG_KERNEL_CONTEXT_CGROUP_NS = 18, |
316 | LTTNG_KERNEL_CONTEXT_IPC_NS = 19, | |
317 | LTTNG_KERNEL_CONTEXT_MNT_NS = 20, | |
318 | LTTNG_KERNEL_CONTEXT_NET_NS = 21, | |
319 | LTTNG_KERNEL_CONTEXT_PID_NS = 22, | |
320 | LTTNG_KERNEL_CONTEXT_USER_NS = 23, | |
321 | LTTNG_KERNEL_CONTEXT_UTS_NS = 24, | |
dc923e75 MJ |
322 | LTTNG_KERNEL_CONTEXT_UID = 25, |
323 | LTTNG_KERNEL_CONTEXT_EUID = 26, | |
324 | LTTNG_KERNEL_CONTEXT_SUID = 27, | |
325 | LTTNG_KERNEL_CONTEXT_GID = 28, | |
326 | LTTNG_KERNEL_CONTEXT_EGID = 29, | |
327 | LTTNG_KERNEL_CONTEXT_SGID = 30, | |
328 | LTTNG_KERNEL_CONTEXT_VUID = 31, | |
329 | LTTNG_KERNEL_CONTEXT_VEUID = 32, | |
330 | LTTNG_KERNEL_CONTEXT_VSUID = 33, | |
331 | LTTNG_KERNEL_CONTEXT_VGID = 34, | |
332 | LTTNG_KERNEL_CONTEXT_VEGID = 35, | |
333 | LTTNG_KERNEL_CONTEXT_VSGID = 36, | |
876e2e92 | 334 | LTTNG_KERNEL_CONTEXT_TIME_NS = 37, |
8070f5c0 MD |
335 | }; |
336 | ||
337 | struct lttng_kernel_perf_counter_ctx { | |
338 | uint32_t type; | |
339 | uint64_t config; | |
f8695253 | 340 | char name[LTTNG_KERNEL_SYM_NAME_LEN]; |
1a598612 | 341 | } __attribute__((packed)); |
8070f5c0 | 342 | |
8e099bae MD |
343 | #define LTTNG_KERNEL_CONTEXT_PADDING1 16 |
344 | #define LTTNG_KERNEL_CONTEXT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32 | |
8070f5c0 | 345 | struct lttng_kernel_context { |
b6c846f1 | 346 | uint32_t ctx; /*enum lttng_kernel_context_type */ |
8e099bae MD |
347 | char padding[LTTNG_KERNEL_CONTEXT_PADDING1]; |
348 | ||
8070f5c0 | 349 | union { |
8070f5c0 | 350 | struct lttng_kernel_perf_counter_ctx perf_counter; |
8e099bae | 351 | char padding[LTTNG_KERNEL_CONTEXT_PADDING2]; |
8070f5c0 | 352 | } u; |
1a598612 | 353 | } __attribute__((packed)); |
8070f5c0 | 354 | |
f127e61e | 355 | #define LTTNG_KERNEL_FILTER_BYTECODE_MAX_LEN 65536 |
07dfc1d0 MD |
356 | struct lttng_kernel_filter_bytecode { |
357 | uint32_t len; | |
358 | uint32_t reloc_offset; | |
359 | uint64_t seqnum; | |
360 | char data[0]; | |
361 | } __attribute__((packed)); | |
362 | ||
99d223ad FD |
363 | #define LTTNG_KERNEL_CAPTURE_BYTECODE_MAX_LEN 65536 |
364 | struct lttng_kernel_capture_bytecode { | |
365 | uint32_t len; | |
366 | uint32_t reloc_offset; | |
367 | uint64_t seqnum; | |
368 | char data[0]; | |
369 | } __attribute__((packed)); | |
370 | ||
d1f652f8 MD |
371 | enum lttng_kernel_tracker_type { |
372 | LTTNG_KERNEL_TRACKER_UNKNOWN = -1, | |
373 | ||
374 | LTTNG_KERNEL_TRACKER_PID = 0, | |
375 | LTTNG_KERNEL_TRACKER_VPID = 1, | |
376 | LTTNG_KERNEL_TRACKER_UID = 2, | |
377 | LTTNG_KERNEL_TRACKER_VUID = 3, | |
378 | LTTNG_KERNEL_TRACKER_GID = 4, | |
379 | LTTNG_KERNEL_TRACKER_VGID = 5, | |
380 | }; | |
381 | ||
382 | struct lttng_kernel_tracker_args { | |
b6c846f1 | 383 | uint32_t type; /* enum lttng_kernel_tracker_type */ |
d1f652f8 MD |
384 | int32_t id; |
385 | }; | |
386 | ||
33749530 | 387 | /* LTTng file descriptor ioctl */ |
2df37e95 | 388 | /* lttng/abi-old.h reserve 0x40, 0x41, 0x42, 0x43, and 0x44. */ |
6dccd6c1 | 389 | #define LTTNG_KERNEL_SESSION _IO(0xF6, 0x45) |
33749530 | 390 | #define LTTNG_KERNEL_TRACER_VERSION \ |
6dccd6c1 JD |
391 | _IOR(0xF6, 0x46, struct lttng_kernel_tracer_version) |
392 | #define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x47) | |
393 | #define LTTNG_KERNEL_WAIT_QUIESCENT _IO(0xF6, 0x48) | |
57105fc2 | 394 | #define LTTNG_KERNEL_CALIBRATE \ |
6dccd6c1 | 395 | _IOWR(0xF6, 0x49, struct lttng_kernel_calibrate) |
29c956bb | 396 | #define LTTNG_KERNEL_SYSCALL_LIST _IO(0xF6, 0x4A) |
42cabb80 MD |
397 | #define LTTNG_KERNEL_TRACER_ABI_VERSION \ |
398 | _IOR(0xF6, 0x4B, struct lttng_kernel_tracer_abi_version) | |
750b05f2 | 399 | #define LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_CREATE _IO(0xF6, 0x4C) |
33749530 MD |
400 | |
401 | /* Session FD ioctl */ | |
2df37e95 | 402 | /* lttng/abi-old.h reserve 0x50, 0x51, 0x52, and 0x53. */ |
33749530 | 403 | #define LTTNG_KERNEL_METADATA \ |
6dccd6c1 | 404 | _IOW(0xF6, 0x54, struct lttng_kernel_channel) |
ab2277d6 | 405 | #define LTTNG_KERNEL_CHANNEL \ |
6dccd6c1 JD |
406 | _IOW(0xF6, 0x55, struct lttng_kernel_channel) |
407 | #define LTTNG_KERNEL_SESSION_START _IO(0xF6, 0x56) | |
408 | #define LTTNG_KERNEL_SESSION_STOP _IO(0xF6, 0x57) | |
e0130fab MD |
409 | #define LTTNG_KERNEL_SESSION_TRACK_PID \ |
410 | _IOR(0xF6, 0x58, int32_t) | |
411 | #define LTTNG_KERNEL_SESSION_UNTRACK_PID \ | |
412 | _IOR(0xF6, 0x59, int32_t) | |
d1f652f8 | 413 | |
fe40f016 MD |
414 | /* |
415 | * ioctl 0x58 and 0x59 are duplicated here. It works, since _IOR vs _IO | |
416 | * are generating two different ioctl numbers, but this was not done on | |
417 | * purpose. We should generally try to avoid those duplications. | |
418 | */ | |
7e6f9ef6 | 419 | #define LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58) |
9616f0bf | 420 | #define LTTNG_KERNEL_SESSION_METADATA_REGEN _IO(0xF6, 0x59) |
7f859fbf | 421 | |
2df37e95 | 422 | /* lttng/abi-old.h reserve 0x5A and 0x5B. */ |
601252cf | 423 | #define LTTNG_KERNEL_SESSION_STATEDUMP _IO(0xF6, 0x5C) |
7f859fbf JR |
424 | #define LTTNG_KERNEL_SESSION_SET_NAME \ |
425 | _IOR(0xF6, 0x5D, struct lttng_kernel_session_name) | |
1c88f269 JR |
426 | #define LTTNG_KERNEL_SESSION_SET_CREATION_TIME \ |
427 | _IOR(0xF6, 0x5E, struct lttng_kernel_session_creation_time) | |
33749530 MD |
428 | |
429 | /* Channel FD ioctl */ | |
2df37e95 | 430 | /* lttng/abi-old.h reserve 0x60 and 0x61. */ |
6dccd6c1 | 431 | #define LTTNG_KERNEL_STREAM _IO(0xF6, 0x62) |
ab2277d6 | 432 | #define LTTNG_KERNEL_EVENT \ |
6dccd6c1 | 433 | _IOW(0xF6, 0x63, struct lttng_kernel_event) |
0c023c01 | 434 | /* LTTNG_KERNEL_SYSCALL_MASK applies to both channel and counter fds. */ |
12e579db MD |
435 | #define LTTNG_KERNEL_SYSCALL_MASK \ |
436 | _IOWR(0xF6, 0x64, struct lttng_kernel_syscall_mask) | |
57a13317 | 437 | |
8070f5c0 | 438 | /* Event and Channel FD ioctl */ |
2df37e95 | 439 | /* lttng/abi-old.h reserve 0x70. */ |
8070f5c0 | 440 | #define LTTNG_KERNEL_CONTEXT \ |
6dccd6c1 | 441 | _IOW(0xF6, 0x71, struct lttng_kernel_context) |
8070f5c0 | 442 | |
99f52fcc | 443 | /* Event, Event notifier, Channel, Counter and Session ioctl */ |
2df37e95 | 444 | /* lttng/abi-old.h reserve 0x80 and 0x81. */ |
6dccd6c1 JD |
445 | #define LTTNG_KERNEL_ENABLE _IO(0xF6, 0x82) |
446 | #define LTTNG_KERNEL_DISABLE _IO(0xF6, 0x83) | |
e64957da | 447 | |
99f52fcc FD |
448 | /* Trigger group and session ioctl */ |
449 | #define LTTNG_KERNEL_COUNTER \ | |
450 | _IOW(0xF6, 0x84, struct lttng_kernel_counter_conf) | |
451 | ||
dffef45d | 452 | /* Event and Event notifier FD ioctl */ |
07dfc1d0 | 453 | #define LTTNG_KERNEL_FILTER _IO(0xF6, 0x90) |
3aed4dca | 454 | #define LTTNG_KERNEL_ADD_CALLSITE _IO(0xF6, 0x91) |
07dfc1d0 | 455 | |
d1f652f8 MD |
456 | /* Session FD ioctl (continued) */ |
457 | #define LTTNG_KERNEL_SESSION_LIST_TRACKER_IDS \ | |
458 | _IOR(0xF6, 0xA0, struct lttng_kernel_tracker_args) | |
459 | #define LTTNG_KERNEL_SESSION_TRACK_ID \ | |
460 | _IOR(0xF6, 0xA1, struct lttng_kernel_tracker_args) | |
461 | #define LTTNG_KERNEL_SESSION_UNTRACK_ID \ | |
462 | _IOR(0xF6, 0xA2, struct lttng_kernel_tracker_args) | |
463 | ||
dffef45d FD |
464 | /* Event notifier group file descriptor ioctl */ |
465 | #define LTTNG_KERNEL_EVENT_NOTIFIER_CREATE \ | |
466 | _IOW(0xF6, 0xB0, struct lttng_kernel_event_notifier) | |
21f58fb7 FD |
467 | #define LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD \ |
468 | _IO(0xF6, 0xB1) | |
dffef45d | 469 | |
99d223ad FD |
470 | /* Event notifier file descriptor ioctl */ |
471 | #define LTTNG_KERNEL_CAPTURE _IO(0xF6, 0xB8) | |
472 | ||
99f52fcc FD |
473 | /* Counter file descriptor ioctl */ |
474 | #define LTTNG_KERNEL_COUNTER_READ \ | |
475 | _IOWR(0xF6, 0xC0, struct lttng_kernel_counter_read) | |
476 | #define LTTNG_KERNEL_COUNTER_AGGREGATE \ | |
477 | _IOWR(0xF6, 0xC1, struct lttng_kernel_counter_aggregate) | |
478 | #define LTTNG_KERNEL_COUNTER_CLEAR \ | |
479 | _IOW(0xF6, 0xC2, struct lttng_kernel_counter_clear) | |
0c023c01 MD |
480 | #define LTTNG_KERNEL_COUNTER_MAP_NR_DESCRIPTORS \ |
481 | _IOR(0xF6, 0xC3, uint64_t) | |
482 | #define LTTNG_KERNEL_COUNTER_MAP_DESCRIPTOR \ | |
483 | _IOWR(0xF6, 0xC4, struct lttng_kernel_counter_map_descriptor) | |
484 | #define LTTNG_KERNEL_COUNTER_EVENT \ | |
485 | _IOW(0xF6, 0xC5, struct lttng_kernel_counter_event) | |
99f52fcc | 486 | |
1aca53e1 MD |
487 | /* |
488 | * LTTng-specific ioctls for the lib ringbuffer. | |
489 | * | |
490 | * Operations applying to the current sub-buffer need to occur between | |
491 | * a get/put or get_next/put_next ioctl pair. | |
492 | */ | |
493 | ||
3b731ab1 JD |
494 | /* returns the timestamp begin of the current sub-buffer */ |
495 | #define LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t) | |
496 | /* returns the timestamp end of the current sub-buffer */ | |
497 | #define LTTNG_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t) | |
1aca53e1 | 498 | /* returns the number of events discarded of the current sub-buffer */ |
3b731ab1 | 499 | #define LTTNG_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t) |
1aca53e1 | 500 | /* returns the packet payload size of the current sub-buffer */ |
3b731ab1 | 501 | #define LTTNG_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t) |
1aca53e1 | 502 | /* returns the packet size of the current sub-buffer*/ |
3b731ab1 | 503 | #define LTTNG_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t) |
1aca53e1 | 504 | /* returns the stream id (invariant for the stream) */ |
3b731ab1 | 505 | #define LTTNG_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t) |
1aca53e1 | 506 | /* returns the current timestamp as perceived from the tracer */ |
2348ca17 | 507 | #define LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t) |
1aca53e1 | 508 | /* returns the packet sequence number of the current sub-buffer */ |
5b3cf4f9 | 509 | #define LTTNG_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t) |
1aca53e1 | 510 | /* returns the stream instance id (invariant for the stream) */ |
5594698f | 511 | #define LTTNG_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t) |
3b731ab1 JD |
512 | |
513 | #ifdef CONFIG_COMPAT | |
514 | /* returns the timestamp begin of the current sub-buffer */ | |
515 | #define LTTNG_RING_BUFFER_COMPAT_GET_TIMESTAMP_BEGIN \ | |
516 | LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN | |
517 | /* returns the timestamp end of the current sub-buffer */ | |
518 | #define LTTNG_RING_BUFFER_COMPAT_GET_TIMESTAMP_END \ | |
519 | LTTNG_RING_BUFFER_GET_TIMESTAMP_END | |
1aca53e1 | 520 | /* returns the number of events discarded of the current sub-buffer */ |
3b731ab1 JD |
521 | #define LTTNG_RING_BUFFER_COMPAT_GET_EVENTS_DISCARDED \ |
522 | LTTNG_RING_BUFFER_GET_EVENTS_DISCARDED | |
1aca53e1 | 523 | /* returns the packet payload size of the current sub-buffer */ |
3b731ab1 JD |
524 | #define LTTNG_RING_BUFFER_COMPAT_GET_CONTENT_SIZE \ |
525 | LTTNG_RING_BUFFER_GET_CONTENT_SIZE | |
1aca53e1 | 526 | /* returns the packet size of the current sub-buffer */ |
3b731ab1 JD |
527 | #define LTTNG_RING_BUFFER_COMPAT_GET_PACKET_SIZE \ |
528 | LTTNG_RING_BUFFER_GET_PACKET_SIZE | |
1aca53e1 | 529 | /* returns the stream id (invariant for the stream) */ |
3b731ab1 JD |
530 | #define LTTNG_RING_BUFFER_COMPAT_GET_STREAM_ID \ |
531 | LTTNG_RING_BUFFER_GET_STREAM_ID | |
1aca53e1 | 532 | /* returns the current timestamp as perceived from the tracer */ |
2348ca17 JD |
533 | #define LTTNG_RING_BUFFER_COMPAT_GET_CURRENT_TIMESTAMP \ |
534 | LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP | |
1aca53e1 | 535 | /* returns the packet sequence number of the current sub-buffer */ |
5b3cf4f9 JD |
536 | #define LTTNG_RING_BUFFER_COMPAT_GET_SEQ_NUM \ |
537 | LTTNG_RING_BUFFER_GET_SEQ_NUM | |
1aca53e1 | 538 | /* returns the stream instance id (invariant for the stream) */ |
5594698f JD |
539 | #define LTTNG_RING_BUFFER_COMPAT_INSTANCE_ID \ |
540 | LTTNG_RING_BUFFER_INSTANCE_ID | |
3b731ab1 JD |
541 | #endif /* CONFIG_COMPAT */ |
542 | ||
e8951e63 | 543 | #endif /* _LTTNG_ABI_H */ |