Namespace LTTng modules ABI with lttng_kernel_abi_ prefix
[lttng-modules.git] / include / lttng / abi.h
CommitLineData
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 */
606828e4
MD
20#define LTTNG_KERNEL_ABI_MAJOR_VERSION 2
21#define LTTNG_KERNEL_ABI_MINOR_VERSION 6
22
23#define LTTNG_KERNEL_ABI_SYM_NAME_LEN 256
24#define LTTNG_KERNEL_ABI_SESSION_NAME_LEN 256
25#define LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN 26
26
27enum lttng_kernel_abi_instrumentation {
28 LTTNG_KERNEL_ABI_TRACEPOINT = 0,
29 LTTNG_KERNEL_ABI_KPROBE = 1,
30 LTTNG_KERNEL_ABI_FUNCTION = 2,
31 LTTNG_KERNEL_ABI_KRETPROBE = 3,
32 LTTNG_KERNEL_ABI_NOOP = 4, /* not hooked */
33 LTTNG_KERNEL_ABI_SYSCALL = 5,
34 LTTNG_KERNEL_ABI_UPROBE = 6,
57a13317
MD
35};
36
96ba7208
JD
37/*
38 * LTTng consumer mode
39 */
606828e4
MD
40enum lttng_kernel_abi_output {
41 LTTNG_KERNEL_ABI_SPLICE = 0,
42 LTTNG_KERNEL_ABI_MMAP = 1,
96ba7208
JD
43};
44
57a13317
MD
45/*
46 * LTTng DebugFS ABI structures.
47 */
606828e4
MD
48#define LTTNG_KERNEL_ABI_CHANNEL_PADDING LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32
49struct lttng_kernel_abi_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 */
606828e4 54 uint32_t output; /* enum lttng_kernel_abi_output (splice, mmap) */
6dccd6c1 55 int overwrite; /* 1: overwrite, 0: discard */
606828e4 56 char padding[LTTNG_KERNEL_ABI_CHANNEL_PADDING];
1a598612 57} __attribute__((packed));
57a13317 58
606828e4
MD
59enum lttng_kernel_abi_kretprobe_entryexit {
60 LTTNG_KERNEL_ABI_KRETPROBE_ENTRYEXIT = 0,
61 LTTNG_KERNEL_ABI_KRETPROBE_ENTRY = 1,
62 LTTNG_KERNEL_ABI_KRETPROBE_EXIT = 2,
88a82b17
MD
63};
64
606828e4 65struct lttng_kernel_abi_kretprobe {
7371f44c
MD
66 uint64_t addr;
67
68 uint64_t offset;
606828e4
MD
69 char symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN];
70 uint8_t entryexit; /* enum lttng_kernel_abi_kretprobe_entryexit */
1a598612 71} __attribute__((packed));
7371f44c 72
38d024ae
MD
73/*
74 * Either addr is used, or symbol_name and offset.
75 */
606828e4 76struct lttng_kernel_abi_kprobe {
80c16bcf 77 uint64_t addr;
38d024ae 78
80c16bcf 79 uint64_t offset;
606828e4 80 char symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN];
1a598612 81} __attribute__((packed));
d6d808f3 82
606828e4
MD
83struct lttng_kernel_abi_function_tracer {
84 char symbol_name[LTTNG_KERNEL_ABI_SYM_NAME_LEN];
1a598612 85} __attribute__((packed));
f17701fb 86
606828e4 87struct lttng_kernel_abi_uprobe {
56377c91 88 int fd;
3aed4dca
FD
89} __attribute__((packed));
90
606828e4 91struct lttng_kernel_abi_event_callsite_uprobe {
149b9a9d
YB
92 uint64_t offset;
93} __attribute__((packed));
94
606828e4 95struct lttng_kernel_abi_event_callsite {
3aed4dca 96 union {
606828e4 97 struct lttng_kernel_abi_event_callsite_uprobe uprobe;
3aed4dca
FD
98 } u;
99} __attribute__((packed));
100
606828e4
MD
101enum lttng_kernel_abi_syscall_entryexit {
102 LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT = 0,
103 LTTNG_KERNEL_ABI_SYSCALL_ENTRY = 1,
104 LTTNG_KERNEL_ABI_SYSCALL_EXIT = 2,
badfe9f5
MD
105};
106
606828e4
MD
107enum lttng_kernel_abi_syscall_abi {
108 LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL = 0,
109 LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE = 1,
110 LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT = 2,
badfe9f5
MD
111};
112
606828e4
MD
113enum lttng_kernel_abi_syscall_match {
114 LTTNG_KERNEL_ABI_SYSCALL_MATCH_NAME = 0,
115 LTTNG_KERNEL_ABI_SYSCALL_MATCH_NR = 1, /* Not implemented. */
badfe9f5
MD
116};
117
606828e4
MD
118struct lttng_kernel_abi_syscall {
119 uint8_t entryexit; /* enum lttng_kernel_abi_syscall_entryexit */
120 uint8_t abi; /* enum lttng_kernel_abi_syscall_abi */
121 uint8_t match; /* enum lttng_kernel_abi_syscall_match */
badfe9f5
MD
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 */
606828e4
MD
129#define LTTNG_KERNEL_ABI_EVENT_PADDING1 8
130#define LTTNG_KERNEL_ABI_EVENT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32
131struct lttng_kernel_abi_event {
132 char name[LTTNG_KERNEL_ABI_SYM_NAME_LEN]; /* event name */
133 uint32_t instrumentation; /* enum lttng_kernel_abi_instrumentation */
d4f52727 134 uint64_t token; /* User-provided token */
606828e4 135 char padding[LTTNG_KERNEL_ABI_EVENT_PADDING1];
8e099bae 136
d6d808f3
MD
137 /* Per instrumentation type configuration */
138 union {
606828e4
MD
139 struct lttng_kernel_abi_kretprobe kretprobe;
140 struct lttng_kernel_abi_kprobe kprobe;
141 struct lttng_kernel_abi_function_tracer ftrace;
142 struct lttng_kernel_abi_uprobe uprobe;
143 struct lttng_kernel_abi_syscall syscall;
144 char padding[LTTNG_KERNEL_ABI_EVENT_PADDING2];
d6d808f3 145 } u;
1a598612 146} __attribute__((packed));
c099397a 147
606828e4
MD
148#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_PADDING 32
149struct lttng_kernel_abi_event_notifier {
150 struct lttng_kernel_abi_event event;
99f52fcc 151 uint64_t error_counter_index;
dffef45d 152
606828e4 153 char padding[LTTNG_KERNEL_ABI_EVENT_NOTIFIER_PADDING];
dffef45d
FD
154} __attribute__((packed));
155
606828e4 156#define LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX 4
dd1ee958 157
606828e4
MD
158enum lttng_kernel_abi_counter_arithmetic {
159 LTTNG_KERNEL_ABI_COUNTER_ARITHMETIC_MODULAR = 0,
99f52fcc
FD
160};
161
606828e4
MD
162enum lttng_kernel_abi_counter_bitness {
163 LTTNG_KERNEL_ABI_COUNTER_BITNESS_32 = 0,
164 LTTNG_KERNEL_ABI_COUNTER_BITNESS_64 = 1,
99f52fcc
FD
165};
166
606828e4 167struct lttng_kernel_abi_counter_dimension {
99f52fcc
FD
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
606828e4
MD
175#define LTTNG_KERNEL_ABI_COUNTER_CONF_PADDING1 67
176struct lttng_kernel_abi_counter_conf {
177 uint32_t arithmetic; /* enum lttng_kernel_abi_counter_arithmetic */
178 uint32_t bitness; /* enum lttng_kernel_abi_counter_bitness */
99f52fcc
FD
179 uint32_t number_dimensions;
180 int64_t global_sum_step;
606828e4 181 struct lttng_kernel_abi_counter_dimension dimensions[LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX];
dd1ee958 182 uint8_t coalesce_hits;
606828e4 183 char padding[LTTNG_KERNEL_ABI_COUNTER_CONF_PADDING1];
99f52fcc
FD
184} __attribute__((packed));
185
606828e4 186struct lttng_kernel_abi_counter_index {
99f52fcc 187 uint32_t number_dimensions;
606828e4 188 uint64_t dimension_indexes[LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX];
99f52fcc
FD
189} __attribute__((packed));
190
606828e4 191struct lttng_kernel_abi_counter_value {
99f52fcc
FD
192 int64_t value;
193 uint8_t underflow;
194 uint8_t overflow;
195} __attribute__((packed));
196
606828e4
MD
197#define LTTNG_KERNEL_ABI_COUNTER_READ_PADDING 32
198struct lttng_kernel_abi_counter_read {
199 struct lttng_kernel_abi_counter_index index;
99f52fcc 200 int32_t cpu; /* -1 for global counter, >= 0 for specific cpu. */
606828e4
MD
201 struct lttng_kernel_abi_counter_value value; /* output */
202 char padding[LTTNG_KERNEL_ABI_COUNTER_READ_PADDING];
99f52fcc
FD
203} __attribute__((packed));
204
606828e4
MD
205#define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE_PADDING 32
206struct lttng_kernel_abi_counter_aggregate {
207 struct lttng_kernel_abi_counter_index index;
208 struct lttng_kernel_abi_counter_value value; /* output */
209 char padding[LTTNG_KERNEL_ABI_COUNTER_AGGREGATE_PADDING];
99f52fcc
FD
210} __attribute__((packed));
211
606828e4
MD
212#define LTTNG_KERNEL_ABI_COUNTER_CLEAR_PADDING 32
213struct lttng_kernel_abi_counter_clear {
214 struct lttng_kernel_abi_counter_index index;
215 char padding[LTTNG_KERNEL_ABI_COUNTER_CLEAR_PADDING];
99f52fcc
FD
216} __attribute__((packed));
217
606828e4
MD
218#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING 32
219struct lttng_kernel_abi_event_notifier_notification {
99d223ad
FD
220 uint64_t token;
221 uint16_t capture_buf_size;
606828e4 222 char padding[LTTNG_KERNEL_ABI_EVENT_NOTIFIER_NOTIFICATION_PADDING];
99d223ad
FD
223} __attribute__((packed));
224
606828e4 225struct lttng_kernel_abi_tracer_version {
c6c9e10f
MD
226 uint32_t major;
227 uint32_t minor;
80c16bcf 228 uint32_t patchlevel;
1a598612 229} __attribute__((packed));
80c16bcf 230
606828e4 231struct lttng_kernel_abi_tracer_abi_version {
42cabb80
MD
232 uint32_t major;
233 uint32_t minor;
234} __attribute__((packed));
235
606828e4
MD
236struct lttng_kernel_abi_session_name {
237 char name[LTTNG_KERNEL_ABI_SESSION_NAME_LEN];
7f859fbf
JR
238} __attribute__((packed));
239
606828e4
MD
240struct lttng_kernel_abi_session_creation_time {
241 char iso8601[LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN];
1c88f269
JR
242} __attribute__((packed));
243
606828e4
MD
244enum lttng_kernel_abi_calibrate_type {
245 LTTNG_KERNEL_ABI_CALIBRATE_KRETPROBE,
57105fc2
MD
246};
247
606828e4
MD
248struct lttng_kernel_abi_calibrate {
249 uint32_t type; /* enum lttng_kernel_abi_calibrate_type (input) */
1a598612 250} __attribute__((packed));
57105fc2 251
606828e4 252struct lttng_kernel_abi_syscall_mask {
12e579db
MD
253 uint32_t len; /* in bits */
254 char mask[];
255} __attribute__((packed));
256
606828e4
MD
257enum lttng_kernel_abi_context_type {
258 LTTNG_KERNEL_ABI_CONTEXT_PID = 0,
259 LTTNG_KERNEL_ABI_CONTEXT_PERF_COUNTER = 1,
260 LTTNG_KERNEL_ABI_CONTEXT_PROCNAME = 2,
261 LTTNG_KERNEL_ABI_CONTEXT_PRIO = 3,
262 LTTNG_KERNEL_ABI_CONTEXT_NICE = 4,
263 LTTNG_KERNEL_ABI_CONTEXT_VPID = 5,
264 LTTNG_KERNEL_ABI_CONTEXT_TID = 6,
265 LTTNG_KERNEL_ABI_CONTEXT_VTID = 7,
266 LTTNG_KERNEL_ABI_CONTEXT_PPID = 8,
267 LTTNG_KERNEL_ABI_CONTEXT_VPPID = 9,
268 LTTNG_KERNEL_ABI_CONTEXT_HOSTNAME = 10,
269 LTTNG_KERNEL_ABI_CONTEXT_CPU_ID = 11,
270 LTTNG_KERNEL_ABI_CONTEXT_INTERRUPTIBLE = 12,
271 LTTNG_KERNEL_ABI_CONTEXT_PREEMPTIBLE = 13,
272 LTTNG_KERNEL_ABI_CONTEXT_NEED_RESCHEDULE = 14,
273 LTTNG_KERNEL_ABI_CONTEXT_MIGRATABLE = 15,
274 LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_KERNEL = 16,
275 LTTNG_KERNEL_ABI_CONTEXT_CALLSTACK_USER = 17,
276 LTTNG_KERNEL_ABI_CONTEXT_CGROUP_NS = 18,
277 LTTNG_KERNEL_ABI_CONTEXT_IPC_NS = 19,
278 LTTNG_KERNEL_ABI_CONTEXT_MNT_NS = 20,
279 LTTNG_KERNEL_ABI_CONTEXT_NET_NS = 21,
280 LTTNG_KERNEL_ABI_CONTEXT_PID_NS = 22,
281 LTTNG_KERNEL_ABI_CONTEXT_USER_NS = 23,
282 LTTNG_KERNEL_ABI_CONTEXT_UTS_NS = 24,
283 LTTNG_KERNEL_ABI_CONTEXT_UID = 25,
284 LTTNG_KERNEL_ABI_CONTEXT_EUID = 26,
285 LTTNG_KERNEL_ABI_CONTEXT_SUID = 27,
286 LTTNG_KERNEL_ABI_CONTEXT_GID = 28,
287 LTTNG_KERNEL_ABI_CONTEXT_EGID = 29,
288 LTTNG_KERNEL_ABI_CONTEXT_SGID = 30,
289 LTTNG_KERNEL_ABI_CONTEXT_VUID = 31,
290 LTTNG_KERNEL_ABI_CONTEXT_VEUID = 32,
291 LTTNG_KERNEL_ABI_CONTEXT_VSUID = 33,
292 LTTNG_KERNEL_ABI_CONTEXT_VGID = 34,
293 LTTNG_KERNEL_ABI_CONTEXT_VEGID = 35,
294 LTTNG_KERNEL_ABI_CONTEXT_VSGID = 36,
295 LTTNG_KERNEL_ABI_CONTEXT_TIME_NS = 37,
8070f5c0
MD
296};
297
606828e4 298struct lttng_kernel_abi_perf_counter_ctx {
8070f5c0
MD
299 uint32_t type;
300 uint64_t config;
606828e4 301 char name[LTTNG_KERNEL_ABI_SYM_NAME_LEN];
1a598612 302} __attribute__((packed));
8070f5c0 303
606828e4
MD
304#define LTTNG_KERNEL_ABI_CONTEXT_PADDING1 16
305#define LTTNG_KERNEL_ABI_CONTEXT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32
306struct lttng_kernel_abi_context {
307 uint32_t ctx; /*enum lttng_kernel_abi_context_type */
308 char padding[LTTNG_KERNEL_ABI_CONTEXT_PADDING1];
8e099bae 309
8070f5c0 310 union {
606828e4
MD
311 struct lttng_kernel_abi_perf_counter_ctx perf_counter;
312 char padding[LTTNG_KERNEL_ABI_CONTEXT_PADDING2];
8070f5c0 313 } u;
1a598612 314} __attribute__((packed));
8070f5c0 315
606828e4
MD
316#define LTTNG_KERNEL_ABI_FILTER_BYTECODE_MAX_LEN 65536
317struct lttng_kernel_abi_filter_bytecode {
07dfc1d0
MD
318 uint32_t len;
319 uint32_t reloc_offset;
320 uint64_t seqnum;
321 char data[0];
322} __attribute__((packed));
323
606828e4
MD
324#define LTTNG_KERNEL_ABI_CAPTURE_BYTECODE_MAX_LEN 65536
325struct lttng_kernel_abi_capture_bytecode {
99d223ad
FD
326 uint32_t len;
327 uint32_t reloc_offset;
328 uint64_t seqnum;
329 char data[0];
330} __attribute__((packed));
331
606828e4
MD
332enum lttng_kernel_abi_tracker_type {
333 LTTNG_KERNEL_ABI_TRACKER_UNKNOWN = -1,
d1f652f8 334
606828e4
MD
335 LTTNG_KERNEL_ABI_TRACKER_PID = 0,
336 LTTNG_KERNEL_ABI_TRACKER_VPID = 1,
337 LTTNG_KERNEL_ABI_TRACKER_UID = 2,
338 LTTNG_KERNEL_ABI_TRACKER_VUID = 3,
339 LTTNG_KERNEL_ABI_TRACKER_GID = 4,
340 LTTNG_KERNEL_ABI_TRACKER_VGID = 5,
d1f652f8
MD
341};
342
606828e4
MD
343struct lttng_kernel_abi_tracker_args {
344 uint32_t type; /* enum lttng_kernel_abi_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. */
606828e4
MD
350#define LTTNG_KERNEL_ABI_SESSION _IO(0xF6, 0x45)
351#define LTTNG_KERNEL_ABI_TRACER_VERSION \
352 _IOR(0xF6, 0x46, struct lttng_kernel_abi_tracer_version)
353#define LTTNG_KERNEL_ABI_TRACEPOINT_LIST _IO(0xF6, 0x47)
354#define LTTNG_KERNEL_ABI_WAIT_QUIESCENT _IO(0xF6, 0x48)
355#define LTTNG_KERNEL_ABI_CALIBRATE \
356 _IOWR(0xF6, 0x49, struct lttng_kernel_abi_calibrate)
357#define LTTNG_KERNEL_ABI_SYSCALL_LIST _IO(0xF6, 0x4A)
358#define LTTNG_KERNEL_ABI_TRACER_ABI_VERSION \
359 _IOR(0xF6, 0x4B, struct lttng_kernel_abi_tracer_abi_version)
360#define LTTNG_KERNEL_ABI_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. */
606828e4
MD
364#define LTTNG_KERNEL_ABI_METADATA \
365 _IOW(0xF6, 0x54, struct lttng_kernel_abi_channel)
366#define LTTNG_KERNEL_ABI_CHANNEL \
367 _IOW(0xF6, 0x55, struct lttng_kernel_abi_channel)
368#define LTTNG_KERNEL_ABI_SESSION_START _IO(0xF6, 0x56)
369#define LTTNG_KERNEL_ABI_SESSION_STOP _IO(0xF6, 0x57)
370#define LTTNG_KERNEL_ABI_SESSION_TRACK_PID \
e0130fab 371 _IOR(0xF6, 0x58, int32_t)
606828e4 372#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_PID \
e0130fab 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 */
606828e4
MD
380#define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58)
381#define LTTNG_KERNEL_ABI_SESSION_METADATA_REGEN _IO(0xF6, 0x59)
7f859fbf 382
2df37e95 383/* lttng/abi-old.h reserve 0x5A and 0x5B. */
606828e4
MD
384#define LTTNG_KERNEL_ABI_SESSION_STATEDUMP _IO(0xF6, 0x5C)
385#define LTTNG_KERNEL_ABI_SESSION_SET_NAME \
386 _IOR(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
387#define LTTNG_KERNEL_ABI_SESSION_SET_CREATION_TIME \
388 _IOR(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
33749530
MD
389
390/* Channel FD ioctl */
2df37e95 391/* lttng/abi-old.h reserve 0x60 and 0x61. */
606828e4
MD
392#define LTTNG_KERNEL_ABI_STREAM _IO(0xF6, 0x62)
393#define LTTNG_KERNEL_ABI_EVENT \
394 _IOW(0xF6, 0x63, struct lttng_kernel_abi_event)
395#define LTTNG_KERNEL_ABI_SYSCALL_MASK \
396 _IOWR(0xF6, 0x64, struct lttng_kernel_abi_syscall_mask)
57a13317 397
8070f5c0 398/* Event and Channel FD ioctl */
2df37e95 399/* lttng/abi-old.h reserve 0x70. */
606828e4
MD
400#define LTTNG_KERNEL_ABI_CONTEXT \
401 _IOW(0xF6, 0x71, struct lttng_kernel_abi_context)
8070f5c0 402
99f52fcc 403/* Event, Event notifier, Channel, Counter and Session ioctl */
2df37e95 404/* lttng/abi-old.h reserve 0x80 and 0x81. */
606828e4
MD
405#define LTTNG_KERNEL_ABI_ENABLE _IO(0xF6, 0x82)
406#define LTTNG_KERNEL_ABI_DISABLE _IO(0xF6, 0x83)
e64957da 407
99f52fcc 408/* Trigger group and session ioctl */
606828e4
MD
409#define LTTNG_KERNEL_ABI_COUNTER \
410 _IOW(0xF6, 0x84, struct lttng_kernel_abi_counter_conf)
99f52fcc 411
dffef45d 412/* Event and Event notifier FD ioctl */
606828e4
MD
413#define LTTNG_KERNEL_ABI_FILTER _IO(0xF6, 0x90)
414#define LTTNG_KERNEL_ABI_ADD_CALLSITE _IO(0xF6, 0x91)
07dfc1d0 415
d1f652f8 416/* Session FD ioctl (continued) */
606828e4
MD
417#define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_IDS \
418 _IOR(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
419#define LTTNG_KERNEL_ABI_SESSION_TRACK_ID \
420 _IOR(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
421#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_ID \
422 _IOR(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
d1f652f8 423
dffef45d 424/* Event notifier group file descriptor ioctl */
606828e4
MD
425#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_CREATE \
426 _IOW(0xF6, 0xB0, struct lttng_kernel_abi_event_notifier)
427#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD \
21f58fb7 428 _IO(0xF6, 0xB1)
dffef45d 429
99d223ad 430/* Event notifier file descriptor ioctl */
606828e4 431#define LTTNG_KERNEL_ABI_CAPTURE _IO(0xF6, 0xB8)
99d223ad 432
99f52fcc 433/* Counter file descriptor ioctl */
606828e4
MD
434#define LTTNG_KERNEL_ABI_COUNTER_READ \
435 _IOWR(0xF6, 0xC0, struct lttng_kernel_abi_counter_read)
436#define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE \
437 _IOWR(0xF6, 0xC1, struct lttng_kernel_abi_counter_aggregate)
438#define LTTNG_KERNEL_ABI_COUNTER_CLEAR \
439 _IOW(0xF6, 0xC2, struct lttng_kernel_abi_counter_clear)
99f52fcc
FD
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 449/* returns the timestamp begin of the current sub-buffer */
606828e4 450#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t)
3b731ab1 451/* returns the timestamp end of the current sub-buffer */
606828e4 452#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t)
1aca53e1 453/* returns the number of events discarded of the current sub-buffer */
606828e4 454#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t)
1aca53e1 455/* returns the packet payload size of the current sub-buffer */
606828e4 456#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t)
1aca53e1 457/* returns the packet size of the current sub-buffer*/
606828e4 458#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t)
1aca53e1 459/* returns the stream id (invariant for the stream) */
606828e4 460#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t)
1aca53e1 461/* returns the current timestamp as perceived from the tracer */
606828e4 462#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t)
1aca53e1 463/* returns the packet sequence number of the current sub-buffer */
606828e4 464#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t)
1aca53e1 465/* returns the stream instance id (invariant for the stream) */
606828e4 466#define LTTNG_KERNEL_ABI_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 */
606828e4
MD
470#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_TIMESTAMP_BEGIN \
471 LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_BEGIN
3b731ab1 472/* returns the timestamp end of the current sub-buffer */
606828e4
MD
473#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_TIMESTAMP_END \
474 LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_END
1aca53e1 475/* returns the number of events discarded of the current sub-buffer */
606828e4
MD
476#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_EVENTS_DISCARDED \
477 LTTNG_KERNEL_ABI_RING_BUFFER_GET_EVENTS_DISCARDED
1aca53e1 478/* returns the packet payload size of the current sub-buffer */
606828e4
MD
479#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_CONTENT_SIZE \
480 LTTNG_KERNEL_ABI_RING_BUFFER_GET_CONTENT_SIZE
1aca53e1 481/* returns the packet size of the current sub-buffer */
606828e4
MD
482#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_PACKET_SIZE \
483 LTTNG_KERNEL_ABI_RING_BUFFER_GET_PACKET_SIZE
1aca53e1 484/* returns the stream id (invariant for the stream) */
606828e4
MD
485#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_STREAM_ID \
486 LTTNG_KERNEL_ABI_RING_BUFFER_GET_STREAM_ID
1aca53e1 487/* returns the current timestamp as perceived from the tracer */
606828e4
MD
488#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_CURRENT_TIMESTAMP \
489 LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP
1aca53e1 490/* returns the packet sequence number of the current sub-buffer */
606828e4
MD
491#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_SEQ_NUM \
492 LTTNG_KERNEL_ABI_RING_BUFFER_GET_SEQ_NUM
1aca53e1 493/* returns the stream instance id (invariant for the stream) */
606828e4
MD
494#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_INSTANCE_ID \
495 LTTNG_KERNEL_ABI_RING_BUFFER_INSTANCE_ID
3b731ab1
JD
496#endif /* CONFIG_COMPAT */
497
e8951e63 498#endif /* _LTTNG_ABI_H */
This page took 0.070078 seconds and 4 git commands to generate.