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