1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
7 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 #include <linux/types.h>
17 * Major/minor version of ABI exposed to lttng tools. Major number
18 * should be increased when an incompatible ABI change is done.
20 #define LTTNG_KERNEL_ABI_MAJOR_VERSION 2
21 #define LTTNG_KERNEL_ABI_MINOR_VERSION 6
23 #define LTTNG_KERNEL_ABI_SYM_NAME_LEN 256
24 #define LTTNG_KERNEL_ABI_SESSION_NAME_LEN 256
27 * The expected iso8601 time formats are either:
29 * - YYYYmmddTHHMMSS+HHMM (20 characters + \0)
30 * - YYYY-mm-ddTHH:MM:SS+HH:MM (25 characters + \0)
32 #define LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN 26
34 enum lttng_kernel_abi_instrumentation
{
35 LTTNG_KERNEL_ABI_TRACEPOINT
= 0,
36 LTTNG_KERNEL_ABI_KPROBE
= 1,
37 LTTNG_KERNEL_ABI_FUNCTION
= 2,
38 LTTNG_KERNEL_ABI_KRETPROBE
= 3,
39 LTTNG_KERNEL_ABI_NOOP
= 4, /* not hooked */
40 LTTNG_KERNEL_ABI_SYSCALL
= 5,
41 LTTNG_KERNEL_ABI_UPROBE
= 6,
47 enum lttng_kernel_abi_output
{
48 LTTNG_KERNEL_ABI_SPLICE
= 0,
49 LTTNG_KERNEL_ABI_MMAP
= 1,
53 * LTTng DebugFS ABI structures.
55 #define LTTNG_KERNEL_ABI_CHANNEL_PADDING LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32
56 struct lttng_kernel_abi_channel
{
57 uint64_t subbuf_size
; /* in bytes */
59 unsigned int switch_timer_interval
; /* usecs */
60 unsigned int read_timer_interval
; /* usecs */
61 uint32_t output
; /* enum lttng_kernel_abi_output (splice, mmap) */
62 int overwrite
; /* 1: overwrite, 0: discard */
63 char padding
[LTTNG_KERNEL_ABI_CHANNEL_PADDING
];
64 } __attribute__((packed
));
66 enum lttng_kernel_abi_kretprobe_entryexit
{
67 LTTNG_KERNEL_ABI_KRETPROBE_ENTRYEXIT
= 0,
68 LTTNG_KERNEL_ABI_KRETPROBE_ENTRY
= 1,
69 LTTNG_KERNEL_ABI_KRETPROBE_EXIT
= 2,
72 struct lttng_kernel_abi_kretprobe
{
76 char symbol_name
[LTTNG_KERNEL_ABI_SYM_NAME_LEN
];
77 uint8_t entryexit
; /* enum lttng_kernel_abi_kretprobe_entryexit */
78 } __attribute__((packed
));
81 * Either addr is used, or symbol_name and offset.
83 struct lttng_kernel_abi_kprobe
{
87 char symbol_name
[LTTNG_KERNEL_ABI_SYM_NAME_LEN
];
88 } __attribute__((packed
));
90 struct lttng_kernel_abi_function_tracer
{
91 char symbol_name
[LTTNG_KERNEL_ABI_SYM_NAME_LEN
];
92 } __attribute__((packed
));
94 struct lttng_kernel_abi_uprobe
{
96 } __attribute__((packed
));
98 struct lttng_kernel_abi_event_callsite_uprobe
{
100 } __attribute__((packed
));
102 struct lttng_kernel_abi_event_callsite
{
104 struct lttng_kernel_abi_event_callsite_uprobe uprobe
;
106 } __attribute__((packed
));
108 enum lttng_kernel_abi_syscall_entryexit
{
109 LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT
= 0,
110 LTTNG_KERNEL_ABI_SYSCALL_ENTRY
= 1,
111 LTTNG_KERNEL_ABI_SYSCALL_EXIT
= 2,
114 enum lttng_kernel_abi_syscall_abi
{
115 LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL
= 0,
116 LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE
= 1,
117 LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT
= 2,
120 enum lttng_kernel_abi_syscall_match
{
121 LTTNG_KERNEL_ABI_SYSCALL_MATCH_NAME
= 0,
122 LTTNG_KERNEL_ABI_SYSCALL_MATCH_NR
= 1, /* Not implemented. */
125 struct lttng_kernel_abi_syscall
{
126 uint8_t entryexit
; /* enum lttng_kernel_abi_syscall_entryexit */
127 uint8_t abi
; /* enum lttng_kernel_abi_syscall_abi */
128 uint8_t match
; /* enum lttng_kernel_abi_syscall_match */
130 uint32_t nr
; /* For LTTNG_SYSCALL_MATCH_NR */
131 } __attribute__((packed
));
134 * An immediate match requires that the requested event matches existing
135 * instrumentation when the ioctl is issued, whereas a lazy match does not
136 * have this constraint.
138 * Instrumentation default
139 * ---------------------------------------------------------------------------
140 * LTTNG_KERNEL_ABI_TRACEPOINT: lazy
141 * LTTNG_KERNEL_ABI_SYSCALL: lazy
142 * LTTNG_KERNEL_ABI_KPROBE: immediate
143 * LTTNG_KERNEL_ABI_KRETPROBE: immediate
144 * LTTNG_KERNEL_ABI_UPROBE: immediate
146 enum lttng_kernel_abi_match_check
{
147 LTTNG_KERNEL_ABI_MATCH_DEFAULT
= 0,
148 LTTNG_KERNEL_ABI_MATCH_IMMEDIATE
= 1,
149 LTTNG_KERNEL_ABI_MATCH_LAZY
= 2,
153 * Extended event parameters.
155 struct lttng_kernel_abi_event_ext
{
156 uint32_t len
; /* length of this structure */
158 uint8_t match_check
; /* enum lttng_kernel_abi_match_check */
159 } __attribute__((packed
));
162 * For syscall tracing, name = "*" means "enable all".
164 #define LTTNG_KERNEL_ABI_EVENT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32
165 struct lttng_kernel_abi_event
{
166 char name
[LTTNG_KERNEL_ABI_SYM_NAME_LEN
]; /* event name */
167 uint32_t instrumentation
; /* enum lttng_kernel_abi_instrumentation */
168 uint64_t token
; /* User-provided token */
169 uint64_t event_ext
; /* struct lttng_kernel_abi_event_ext */
171 /* Per instrumentation type configuration */
173 struct lttng_kernel_abi_kretprobe kretprobe
;
174 struct lttng_kernel_abi_kprobe kprobe
;
175 struct lttng_kernel_abi_function_tracer ftrace
;
176 struct lttng_kernel_abi_uprobe uprobe
;
177 struct lttng_kernel_abi_syscall syscall
;
178 char padding
[LTTNG_KERNEL_ABI_EVENT_PADDING2
];
180 } __attribute__((packed
));
182 #define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_PADDING 32
183 struct lttng_kernel_abi_event_notifier
{
184 struct lttng_kernel_abi_event event
;
185 uint64_t error_counter_index
;
187 char padding
[LTTNG_KERNEL_ABI_EVENT_NOTIFIER_PADDING
];
188 } __attribute__((packed
));
190 #define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING 32
191 struct lttng_kernel_abi_event_notifier_notification
{
193 uint16_t capture_buf_size
;
194 char padding
[LTTNG_KERNEL_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING
];
195 } __attribute__((packed
));
197 enum lttng_kernel_abi_key_token_type
{
198 LTTNG_KERNEL_ABI_KEY_TOKEN_STRING
= 0, /* arg: string_ptr. */
199 LTTNG_KERNEL_ABI_KEY_TOKEN_EVENT_NAME
= 1, /* no arg. */
200 LTTNG_KERNEL_ABI_KEY_TOKEN_PROVIDER_NAME
= 2, /* no arg. */
203 enum lttng_kernel_abi_counter_arithmetic
{
204 LTTNG_KERNEL_ABI_COUNTER_ARITHMETIC_MODULAR
= 0,
207 enum lttng_kernel_abi_counter_bitness
{
208 LTTNG_KERNEL_ABI_COUNTER_BITNESS_32
= 0,
209 LTTNG_KERNEL_ABI_COUNTER_BITNESS_64
= 1,
212 struct lttng_kernel_abi_key_token
{
213 uint32_t len
; /* length of child structure. */
214 uint32_t type
; /* enum lttng_kernel_abi_key_token_type */
216 * The size of this structure is fixed because it is embedded into
217 * children structures.
219 } __attribute__((packed
));
221 /* Length of this structure excludes the following string. */
222 struct lttng_kernel_abi_key_token_string
{
223 struct lttng_kernel_abi_key_token parent
;
224 uint32_t string_len
; /* string length (includes \0) */
226 /* Null-terminated string of length @string_len follows this structure. */
227 } __attribute__((packed
));
230 * token types event_name and provider_name don't have specific fields,
231 * so they do not need to derive their own specific child structure.
234 struct lttng_kernel_abi_counter_map_descriptor
{
235 uint32_t len
; /* length of this structure. */
237 uint64_t descriptor_index
; /* Descriptor index (input: [ 0 .. nr_descriptors - 1 ]) */
239 uint32_t dimension
; /* Dimension indexed (output) */
240 uint64_t user_token
; /* User-provided 64-bit token (output) */
241 uint64_t key_string
; /*
242 * Pointer (input) to key string associated with this index
243 * (output). If key_string_len is smaller than the required
244 * space, the ioctl fails with -ENOSPC, storing the required
245 * string space into @key_string_len.
247 uint32_t key_string_len
; /* Key string length (input/output, includes \0) */
248 uint64_t array_indexes
; /*
249 * Pointer (input) to array of indexes within each dimension
250 * (output). There are @dimension values populated. Each
251 * element is of type uint64_t. If arrays_indexes_len is
252 * smaller than @dimension, the ioctl fails with -ENOSPC,
253 * storing the required array index length into
256 uint32_t array_indexes_len
; /* Array indexes length (input/output). */
257 } __attribute__((packed
));
260 * Dimension indexing: All events should use the same key type to index
261 * a given map dimension.
263 enum lttng_kernel_abi_key_type
{
264 LTTNG_KERNEL_ABI_KEY_TYPE_TOKENS
= 0, /* Dimension key is a set of tokens. */
265 LTTNG_KERNEL_ABI_KEY_TYPE_INTEGER
= 1, /* Dimension key is an integer value. */
268 struct lttng_kernel_abi_counter_key_dimension
{
269 uint32_t len
; /* length of child structure */
270 uint32_t key_type
; /* enum lttng_kernel_abi_key_type */
272 * The size of this structure is fixed because it is embedded
273 * into children structures.
275 } __attribute__((packed
));
277 struct lttng_kernel_abi_counter_key_dimension_tokens
{
278 struct lttng_kernel_abi_counter_key_dimension parent
;
279 uint32_t nr_key_tokens
;
281 /* Followed by an array of nr_key_tokens struct lttng_kernel_abi_key_token elements. */
282 } __attribute__((packed
));
285 * The "integer" key type is not implemented yet, but when it will be
286 * introduced in the future, its specific key dimension will allow
287 * defining the function to apply over input argument, bytecode to run
291 enum lttng_kernel_abi_counter_action
{
292 LTTNG_KERNEL_ABI_COUNTER_ACTION_INCREMENT
= 0,
295 * Can be extended with additional actions, such as decrement,
296 * set value, run bytecode, and so on.
300 struct lttng_kernel_abi_counter_event
{
301 uint32_t len
; /* length of this structure */
302 uint32_t action
; /* enum lttng_kernel_abi_counter_action */
304 struct lttng_kernel_abi_event event
;
305 uint32_t number_key_dimensions
; /* array of dimensions is an array of var. len. elements. */
308 * Followed by additional data specific to the action, and by a
309 * variable-length array of key dimensions.
311 } __attribute__((packed
));
313 enum lttng_kernel_abi_counter_dimension_flags
{
314 LTTNG_KERNEL_ABI_COUNTER_DIMENSION_FLAG_UNDERFLOW
= (1 << 0),
315 LTTNG_KERNEL_ABI_COUNTER_DIMENSION_FLAG_OVERFLOW
= (1 << 1),
318 struct lttng_kernel_abi_counter_dimension
{
319 uint32_t key_type
; /* enum lttng_kernel_abi_key_type */
320 uint32_t flags
; /* enum lttng_kernel_abi_counter_dimension_flags */
321 uint64_t size
; /* dimension size */
322 uint64_t underflow_index
;
323 uint64_t overflow_index
;
324 } __attribute__((packed
));
326 struct lttng_kernel_abi_counter_dimension_array
{
327 uint32_t number_dimensions
;
328 uint32_t elem_len
; /* array stride (size of struct lttng_kernel_abi_counter_dimension) */
329 uint64_t ptr
; /* pointer to array of struct lttng_kernel_abi_counter_dimension */
330 } __attribute__((packed
));
332 enum lttng_kernel_abi_counter_conf_flags
{
333 LTTNG_KERNEL_ABI_COUNTER_CONF_FLAG_COALESCE_HITS
= (1 << 0),
336 struct lttng_kernel_abi_counter_conf
{
337 uint32_t len
; /* length of this structure */
338 uint32_t flags
; /* enum lttng_kernel_abi_counter_conf_flags */
339 uint32_t arithmetic
; /* enum lttng_kernel_abi_counter_arithmetic */
340 uint32_t bitness
; /* enum lttng_kernel_abi_counter_bitness */
341 int64_t global_sum_step
;
342 struct lttng_kernel_abi_counter_dimension_array dimension_array
;
343 } __attribute__((packed
));
345 struct lttng_kernel_abi_counter_index
{
346 uint32_t number_dimensions
;
347 uint64_t ptr
; /* pointer to dimension indexes (array of uint64_t) */
348 } __attribute__((packed
));
350 enum lttng_kernel_abi_counter_value_flags
{
351 LTTNG_KERNEL_ABI_COUNTER_VALUE_FLAG_UNDERFLOW
= (1 << 0),
352 LTTNG_KERNEL_ABI_COUNTER_VALUE_FLAG_OVERFLOW
= (1 << 1),
355 struct lttng_kernel_abi_counter_value
{
357 uint32_t flags
; /* enum lttng_kernel_abi_counter_value_flags */
358 } __attribute__((packed
));
360 struct lttng_kernel_abi_counter_read
{
361 uint32_t len
; /* length of this structure */
362 struct lttng_kernel_abi_counter_index index
;
363 int32_t cpu
; /* -1 for global counter, >= 0 for specific cpu. */
364 struct lttng_kernel_abi_counter_value value
; /* output */
365 } __attribute__((packed
));
367 struct lttng_kernel_abi_counter_aggregate
{
368 uint32_t len
; /* length of this structure */
369 struct lttng_kernel_abi_counter_index index
;
370 struct lttng_kernel_abi_counter_value value
; /* output */
371 } __attribute__((packed
));
373 struct lttng_kernel_abi_counter_clear
{
374 uint32_t len
; /* length of this structure */
375 struct lttng_kernel_abi_counter_index index
;
376 } __attribute__((packed
));
378 struct lttng_kernel_abi_tracer_version
{
382 } __attribute__((packed
));
384 struct lttng_kernel_abi_tracer_abi_version
{
387 } __attribute__((packed
));
389 struct lttng_kernel_abi_session_name
{
390 char name
[LTTNG_KERNEL_ABI_SESSION_NAME_LEN
];
391 } __attribute__((packed
));
393 struct lttng_kernel_abi_session_creation_time
{
394 char iso8601
[LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN
];
395 } __attribute__((packed
));
397 enum lttng_kernel_abi_calibrate_type
{
398 LTTNG_KERNEL_ABI_CALIBRATE_KRETPROBE
,
401 struct lttng_kernel_abi_calibrate
{
402 uint32_t type
; /* enum lttng_kernel_abi_calibrate_type (input) */
403 } __attribute__((packed
));
405 struct lttng_kernel_abi_syscall_mask
{
406 uint32_t len
; /* in bits */
408 } __attribute__((packed
));
410 enum lttng_kernel_abi_context_type
{
411 LTTNG_KERNEL_ABI_CONTEXT_PID
= 0,
412 LTTNG_KERNEL_ABI_CONTEXT_PERF_COUNTER
= 1,
413 LTTNG_KERNEL_ABI_CONTEXT_PROCNAME
= 2,
414 LTTNG_KERNEL_ABI_CONTEXT_PRIO
= 3,
415 LTTNG_KERNEL_ABI_CONTEXT_NICE
= 4,
416 LTTNG_KERNEL_ABI_CONTEXT_VPID
= 5,
417 LTTNG_KERNEL_ABI_CONTEXT_TID
= 6,
418 LTTNG_KERNEL_ABI_CONTEXT_VTID
= 7,
419 LTTNG_KERNEL_ABI_CONTEXT_PPID
= 8,
420 LTTNG_KERNEL_ABI_CONTEXT_VPPID
= 9,
421 LTTNG_KERNEL_ABI_CONTEXT_HOSTNAME
= 10,
422 LTTNG_KERNEL_ABI_CONTEXT_CPU_ID
= 11,
423 LTTNG_KERNEL_ABI_CONTEXT_INTERRUPTIBLE
= 12,
424 LTTNG_KERNEL_ABI_CONTEXT_PREEMPTIBLE
= 13,
425 LTTNG_KERNEL_ABI_CONTEXT_NEED_RESCHEDULE
= 14,
426 LTTNG_KERNEL_ABI_CONTEXT_MIGRATABLE
= 15,
427 LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_KERNEL
= 16,
428 LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_USER
= 17,
429 LTTNG_KERNEL_ABI_CONTEXT_CGROUP_NS
= 18,
430 LTTNG_KERNEL_ABI_CONTEXT_IPC_NS
= 19,
431 LTTNG_KERNEL_ABI_CONTEXT_MNT_NS
= 20,
432 LTTNG_KERNEL_ABI_CONTEXT_NET_NS
= 21,
433 LTTNG_KERNEL_ABI_CONTEXT_PID_NS
= 22,
434 LTTNG_KERNEL_ABI_CONTEXT_USER_NS
= 23,
435 LTTNG_KERNEL_ABI_CONTEXT_UTS_NS
= 24,
436 LTTNG_KERNEL_ABI_CONTEXT_UID
= 25,
437 LTTNG_KERNEL_ABI_CONTEXT_EUID
= 26,
438 LTTNG_KERNEL_ABI_CONTEXT_SUID
= 27,
439 LTTNG_KERNEL_ABI_CONTEXT_GID
= 28,
440 LTTNG_KERNEL_ABI_CONTEXT_EGID
= 29,
441 LTTNG_KERNEL_ABI_CONTEXT_SGID
= 30,
442 LTTNG_KERNEL_ABI_CONTEXT_VUID
= 31,
443 LTTNG_KERNEL_ABI_CONTEXT_VEUID
= 32,
444 LTTNG_KERNEL_ABI_CONTEXT_VSUID
= 33,
445 LTTNG_KERNEL_ABI_CONTEXT_VGID
= 34,
446 LTTNG_KERNEL_ABI_CONTEXT_VEGID
= 35,
447 LTTNG_KERNEL_ABI_CONTEXT_VSGID
= 36,
448 LTTNG_KERNEL_ABI_CONTEXT_TIME_NS
= 37,
451 struct lttng_kernel_abi_perf_counter_ctx
{
454 char name
[LTTNG_KERNEL_ABI_SYM_NAME_LEN
];
455 } __attribute__((packed
));
457 #define LTTNG_KERNEL_ABI_CONTEXT_PADDING1 16
458 #define LTTNG_KERNEL_ABI_CONTEXT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32
459 struct lttng_kernel_abi_context
{
460 uint32_t ctx
; /*enum lttng_kernel_abi_context_type */
461 char padding
[LTTNG_KERNEL_ABI_CONTEXT_PADDING1
];
464 struct lttng_kernel_abi_perf_counter_ctx perf_counter
;
465 char padding
[LTTNG_KERNEL_ABI_CONTEXT_PADDING2
];
467 } __attribute__((packed
));
469 #define LTTNG_KERNEL_ABI_FILTER_BYTECODE_MAX_LEN 65536
470 struct lttng_kernel_abi_filter_bytecode
{
472 uint32_t reloc_offset
;
475 } __attribute__((packed
));
477 #define LTTNG_KERNEL_ABI_CAPTURE_BYTECODE_MAX_LEN 65536
478 struct lttng_kernel_abi_capture_bytecode
{
480 uint32_t reloc_offset
;
483 } __attribute__((packed
));
485 enum lttng_kernel_abi_tracker_type
{
486 LTTNG_KERNEL_ABI_TRACKER_UNKNOWN
= -1,
488 LTTNG_KERNEL_ABI_TRACKER_PID
= 0,
489 LTTNG_KERNEL_ABI_TRACKER_VPID
= 1,
490 LTTNG_KERNEL_ABI_TRACKER_UID
= 2,
491 LTTNG_KERNEL_ABI_TRACKER_VUID
= 3,
492 LTTNG_KERNEL_ABI_TRACKER_GID
= 4,
493 LTTNG_KERNEL_ABI_TRACKER_VGID
= 5,
496 struct lttng_kernel_abi_tracker_args
{
497 uint32_t type
; /* enum lttng_kernel_abi_tracker_type */
501 /* LTTng file descriptor ioctl */
502 /* lttng/abi-old.h reserve 0x40, 0x41, 0x42, 0x43, and 0x44. */
503 #define LTTNG_KERNEL_ABI_SESSION _IO(0xF6, 0x45)
504 #define LTTNG_KERNEL_ABI_TRACER_VERSION \
505 _IOR(0xF6, 0x46, struct lttng_kernel_abi_tracer_version)
506 #define LTTNG_KERNEL_ABI_TRACEPOINT_LIST _IO(0xF6, 0x47)
507 #define LTTNG_KERNEL_ABI_WAIT_QUIESCENT _IO(0xF6, 0x48)
508 #define LTTNG_KERNEL_ABI_CALIBRATE \
509 _IOWR(0xF6, 0x49, struct lttng_kernel_abi_calibrate)
510 #define LTTNG_KERNEL_ABI_SYSCALL_LIST _IO(0xF6, 0x4A)
511 #define LTTNG_KERNEL_ABI_TRACER_ABI_VERSION \
512 _IOR(0xF6, 0x4B, struct lttng_kernel_abi_tracer_abi_version)
513 #define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_CREATE _IO(0xF6, 0x4C)
515 /* Session FD ioctl */
516 /* lttng/abi-old.h reserve 0x50, 0x51, 0x52, and 0x53. */
517 #define LTTNG_KERNEL_ABI_METADATA \
518 _IOW(0xF6, 0x54, struct lttng_kernel_abi_channel)
519 #define LTTNG_KERNEL_ABI_CHANNEL \
520 _IOW(0xF6, 0x55, struct lttng_kernel_abi_channel)
521 #define LTTNG_KERNEL_ABI_SESSION_START _IO(0xF6, 0x56)
522 #define LTTNG_KERNEL_ABI_SESSION_STOP _IO(0xF6, 0x57)
523 #define LTTNG_KERNEL_ABI_SESSION_TRACK_PID \
524 _IOW(0xF6, 0x58, int32_t)
525 #define LTTNG_KERNEL_ABI_SESSION_UNTRACK_PID \
526 _IOW(0xF6, 0x59, int32_t)
529 * ioctl 0x58 and 0x59 are duplicated here. It works, since _IOR vs _IO
530 * are generating two different ioctl numbers, but this was not done on
531 * purpose. We should generally try to avoid those duplications.
533 #define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58)
534 #define LTTNG_KERNEL_ABI_SESSION_METADATA_REGEN _IO(0xF6, 0x59)
536 /* lttng/abi-old.h reserve 0x5A and 0x5B. */
537 #define LTTNG_KERNEL_ABI_SESSION_STATEDUMP _IO(0xF6, 0x5C)
538 #define LTTNG_KERNEL_ABI_SESSION_SET_NAME \
539 _IOW(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
540 #define LTTNG_KERNEL_ABI_SESSION_SET_CREATION_TIME \
541 _IOW(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
543 /* Channel FD ioctl */
544 /* lttng/abi-old.h reserve 0x60 and 0x61. */
545 #define LTTNG_KERNEL_ABI_STREAM _IO(0xF6, 0x62)
546 #define LTTNG_KERNEL_ABI_EVENT \
547 _IOW(0xF6, 0x63, struct lttng_kernel_abi_event)
548 /* LTTNG_KERNEL_ABI_SYSCALL_MASK applies to both channel and counter fds. */
549 #define LTTNG_KERNEL_ABI_SYSCALL_MASK \
550 _IOWR(0xF6, 0x64, struct lttng_kernel_abi_syscall_mask)
552 /* Event and Channel FD ioctl */
553 /* lttng/abi-old.h reserve 0x70. */
554 #define LTTNG_KERNEL_ABI_CONTEXT \
555 _IOW(0xF6, 0x71, struct lttng_kernel_abi_context)
557 /* Event, Event notifier, Channel, Counter and Session ioctl */
558 /* lttng/abi-old.h reserve 0x80 and 0x81. */
559 #define LTTNG_KERNEL_ABI_ENABLE _IO(0xF6, 0x82)
560 #define LTTNG_KERNEL_ABI_DISABLE _IO(0xF6, 0x83)
562 /* Event notifier group and session ioctl */
564 /* (0xF6, 0x84) is reserved for old ABI. */
566 #define LTTNG_KERNEL_ABI_COUNTER \
567 _IOW(0xF6, 0x85, struct lttng_kernel_abi_counter_conf)
569 /* Event and Event notifier FD ioctl */
570 #define LTTNG_KERNEL_ABI_FILTER _IO(0xF6, 0x90)
571 #define LTTNG_KERNEL_ABI_ADD_CALLSITE _IO(0xF6, 0x91)
573 /* Session FD ioctl (continued) */
574 #define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_IDS \
575 _IOW(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
576 #define LTTNG_KERNEL_ABI_SESSION_TRACK_ID \
577 _IOW(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
578 #define LTTNG_KERNEL_ABI_SESSION_UNTRACK_ID \
579 _IOW(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
581 /* Event notifier group file descriptor ioctl */
582 #define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_CREATE \
583 _IOW(0xF6, 0xB0, struct lttng_kernel_abi_event_notifier)
584 #define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD \
587 /* Event notifier file descriptor ioctl */
588 #define LTTNG_KERNEL_ABI_CAPTURE _IO(0xF6, 0xB8)
590 /* (0xF6, {0xC0, 0xC1, 0xC2}) are reserved for old ABI. */
592 /* Counter file descriptor ioctl */
593 #define LTTNG_KERNEL_ABI_COUNTER_MAP_NR_DESCRIPTORS \
594 _IOR(0xF6, 0xC3, uint64_t)
595 #define LTTNG_KERNEL_ABI_COUNTER_MAP_DESCRIPTOR \
596 _IOWR(0xF6, 0xC4, struct lttng_kernel_abi_counter_map_descriptor)
597 #define LTTNG_KERNEL_ABI_COUNTER_EVENT \
598 _IOW(0xF6, 0xC5, struct lttng_kernel_abi_counter_event)
599 #define LTTNG_KERNEL_ABI_COUNTER_READ \
600 _IOWR(0xF6, 0xC6, struct lttng_kernel_abi_counter_read)
601 #define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE \
602 _IOWR(0xF6, 0xC7, struct lttng_kernel_abi_counter_aggregate)
603 #define LTTNG_KERNEL_ABI_COUNTER_CLEAR \
604 _IOW(0xF6, 0xC8, struct lttng_kernel_abi_counter_clear)
607 * LTTng-specific ioctls for the lib ringbuffer.
609 * Operations applying to the current sub-buffer need to occur between
610 * a get/put or get_next/put_next ioctl pair.
613 /* returns the timestamp begin of the current sub-buffer */
614 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t)
615 /* returns the timestamp end of the current sub-buffer */
616 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t)
617 /* returns the number of events discarded of the current sub-buffer */
618 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t)
619 /* returns the packet payload size of the current sub-buffer */
620 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t)
621 /* returns the packet size of the current sub-buffer*/
622 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t)
623 /* returns the stream id (invariant for the stream) */
624 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t)
625 /* returns the current timestamp as perceived from the tracer */
626 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t)
627 /* returns the packet sequence number of the current sub-buffer */
628 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t)
629 /* returns the stream instance id (invariant for the stream) */
630 #define LTTNG_KERNEL_ABI_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t)
633 * Those ioctl numbers use the wrong direction, but are kept for ABI backward
636 #define LTTNG_KERNEL_ABI_OLD_SESSION_SET_NAME \
637 _IOR(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
638 #define LTTNG_KERNEL_ABI_OLD_SESSION_SET_CREATION_TIME \
639 _IOR(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
640 #define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_PID \
641 _IOR(0xF6, 0x58, int32_t)
642 #define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_PID \
643 _IOR(0xF6, 0x59, int32_t)
644 #define LTTNG_KERNEL_ABI_OLD_SESSION_LIST_TRACKER_IDS \
645 _IOR(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
646 #define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_ID \
647 _IOR(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
648 #define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_ID \
649 _IOR(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
652 /* returns the timestamp begin of the current sub-buffer */
653 #define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_TIMESTAMP_BEGIN \
654 LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_BEGIN
655 /* returns the timestamp end of the current sub-buffer */
656 #define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_TIMESTAMP_END \
657 LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_END
658 /* returns the number of events discarded of the current sub-buffer */
659 #define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_EVENTS_DISCARDED \
660 LTTNG_KERNEL_ABI_RING_BUFFER_GET_EVENTS_DISCARDED
661 /* returns the packet payload size of the current sub-buffer */
662 #define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_CONTENT_SIZE \
663 LTTNG_KERNEL_ABI_RING_BUFFER_GET_CONTENT_SIZE
664 /* returns the packet size of the current sub-buffer */
665 #define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_PACKET_SIZE \
666 LTTNG_KERNEL_ABI_RING_BUFFER_GET_PACKET_SIZE
667 /* returns the stream id (invariant for the stream) */
668 #define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_STREAM_ID \
669 LTTNG_KERNEL_ABI_RING_BUFFER_GET_STREAM_ID
670 /* returns the current timestamp as perceived from the tracer */
671 #define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_CURRENT_TIMESTAMP \
672 LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP
673 /* returns the packet sequence number of the current sub-buffer */
674 #define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_SEQ_NUM \
675 LTTNG_KERNEL_ABI_RING_BUFFER_GET_SEQ_NUM
676 /* returns the stream instance id (invariant for the stream) */
677 #define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_INSTANCE_ID \
678 LTTNG_KERNEL_ABI_RING_BUFFER_INSTANCE_ID
679 #endif /* CONFIG_COMPAT */
681 #endif /* _LTTNG_ABI_H */