Fix: common: fs_handle_seek returns negative value on success
[lttng-tools.git] / src / common / kernel-ctl / kernel-ioctl.h
CommitLineData
16421f6e 1/*
ab5be9fa
MJ
2 * Copyright (C) 2011 Julien Desfossez <julien.desfossez@polymtl.ca>
3 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
16421f6e 4 *
ab5be9fa 5 * SPDX-License-Identifier: GPL-2.0-only
16421f6e 6 *
16421f6e
DG
7 */
8
9#ifndef _LTT_KERNEL_IOCTL_H
10#define _LTT_KERNEL_IOCTL_H
11
29c62722 12#define LTTNG_MODULES_ABI_MAJOR_VERSION 2
74e89a8c 13#define LTTNG_MODULES_ABI_MINOR_VERSION 5
c052142c 14
16421f6e 15/* Get a snapshot of the current ring buffer producer and consumer positions */
f3ed775e 16#define RING_BUFFER_SNAPSHOT _IO(0xF6, 0x00)
16421f6e
DG
17/* Get the consumer position (iteration start) */
18#define RING_BUFFER_SNAPSHOT_GET_CONSUMED _IOR(0xF6, 0x01, unsigned long)
19/* Get the producer position (iteration end) */
20#define RING_BUFFER_SNAPSHOT_GET_PRODUCED _IOR(0xF6, 0x02, unsigned long)
21/* Get exclusive read access to the specified sub-buffer position */
f3ed775e 22#define RING_BUFFER_GET_SUBBUF _IOW(0xF6, 0x03, unsigned long)
16421f6e 23/* Release exclusive sub-buffer access */
f3ed775e 24#define RING_BUFFER_PUT_SUBBUF _IO(0xF6, 0x04)
16421f6e
DG
25
26/* Get exclusive read access to the next sub-buffer that can be read. */
f3ed775e 27#define RING_BUFFER_GET_NEXT_SUBBUF _IO(0xF6, 0x05)
16421f6e 28/* Release exclusive sub-buffer access, move consumer forward. */
f3ed775e 29#define RING_BUFFER_PUT_NEXT_SUBBUF _IO(0xF6, 0x06)
16421f6e 30/* returns the size of the current sub-buffer, without padding (for mmap). */
f3ed775e 31#define RING_BUFFER_GET_SUBBUF_SIZE _IOR(0xF6, 0x07, unsigned long)
16421f6e
DG
32/* returns the size of the current sub-buffer, with padding (for splice). */
33#define RING_BUFFER_GET_PADDED_SUBBUF_SIZE _IOR(0xF6, 0x08, unsigned long)
34/* returns the maximum size for sub-buffers. */
35#define RING_BUFFER_GET_MAX_SUBBUF_SIZE _IOR(0xF6, 0x09, unsigned long)
36/* returns the length to mmap. */
f3ed775e 37#define RING_BUFFER_GET_MMAP_LEN _IOR(0xF6, 0x0A, unsigned long)
16421f6e
DG
38/* returns the offset of the subbuffer belonging to the mmap reader. */
39#define RING_BUFFER_GET_MMAP_READ_OFFSET _IOR(0xF6, 0x0B, unsigned long)
f22dd891 40/* Flush the current sub-buffer, if non-empty. */
f3ed775e 41#define RING_BUFFER_FLUSH _IO(0xF6, 0x0C)
93ec662e
JD
42/* Get the current version of the metadata cache (after a get_next). */
43#define RING_BUFFER_GET_METADATA_VERSION _IOR(0xF6, 0x0D, uint64_t)
b007ec59
JG
44/*
45 * Get a snapshot of the current ring buffer producer and consumer positions,
46 * regardless of whether or not the two positions are contained within the same
47 * sub-buffer.
48 */
49#define RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS _IO(0xF6, 0x0E)
f22dd891
MD
50/* Flush the current sub-buffer, even if empty. */
51#define RING_BUFFER_FLUSH_EMPTY _IO(0xF6, 0x0F)
8024cc8c
JD
52/*
53 * Reset the position of what has been consumed from the metadata cache to 0
54 * so it can be read again.
55 */
56#define RING_BUFFER_METADATA_CACHE_DUMP _IO(0xF6, 0x10)
99930a9d
JR
57/* Clear ring buffer content */
58#define RING_BUFFER_CLEAR _IO(0xF6, 0x11)
00e2e675 59
309167d2
JD
60/* returns the timestamp begin of the current sub-buffer */
61#define LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t)
62/* returns the timestamp end of the current sub-buffer */
63#define LTTNG_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t)
64/* returns the number of events discarded */
65#define LTTNG_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t)
66/* returns the packet payload size */
67#define LTTNG_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t)
68/* returns the actual packet size */
69#define LTTNG_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t)
70/* returns the stream id */
71#define LTTNG_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t)
d3e2ba59
JD
72/* returns the current timestamp */
73#define LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t)
fb83fe64
JD
74/* returns the packet sequence number */
75#define LTTNG_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t)
000fa86f
JD
76/* returns the stream instance id */
77#define LTTNG_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t)
309167d2 78
4dbc372b
JD
79/* Old ABI (without support for 32/64 bits compat) */
80/* LTTng file descriptor ioctl */
81#define LTTNG_KERNEL_OLD_SESSION _IO(0xF6, 0x40)
82#define LTTNG_KERNEL_OLD_TRACER_VERSION \
83 _IOR(0xF6, 0x41, struct lttng_kernel_old_tracer_version)
84#define LTTNG_KERNEL_OLD_TRACEPOINT_LIST _IO(0xF6, 0x42)
85#define LTTNG_KERNEL_OLD_WAIT_QUIESCENT _IO(0xF6, 0x43)
4dbc372b
JD
86
87/* Session FD ioctl */
88#define LTTNG_KERNEL_OLD_METADATA \
89 _IOW(0xF6, 0x50, struct lttng_kernel_old_channel)
90#define LTTNG_KERNEL_OLD_CHANNEL \
91 _IOW(0xF6, 0x51, struct lttng_kernel_old_channel)
92#define LTTNG_KERNEL_OLD_SESSION_START _IO(0xF6, 0x52)
93#define LTTNG_KERNEL_OLD_SESSION_STOP _IO(0xF6, 0x53)
94
95/* Channel FD ioctl */
96#define LTTNG_KERNEL_OLD_STREAM _IO(0xF6, 0x60)
97#define LTTNG_KERNEL_OLD_EVENT \
98 _IOW(0xF6, 0x61, struct lttng_kernel_old_event)
f3ed775e 99
4dbc372b
JD
100/* Event and Channel FD ioctl */
101#define LTTNG_KERNEL_OLD_CONTEXT \
102 _IOW(0xF6, 0x70, struct lttng_kernel_old_context)
103
104/* Event, Channel and Session ioctl */
105#define LTTNG_KERNEL_OLD_ENABLE _IO(0xF6, 0x80)
106#define LTTNG_KERNEL_OLD_DISABLE _IO(0xF6, 0x81)
107
108
109/* Current ABI (with suport for 32/64 bits compat) */
857aa172 110/* LTTng file descriptor ioctl */
4dbc372b
JD
111#define LTTNG_KERNEL_SESSION _IO(0xF6, 0x45)
112#define LTTNG_KERNEL_TRACER_VERSION \
113 _IOR(0xF6, 0x46, struct lttng_kernel_tracer_version)
d02666a9 114#define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x47)
4dbc372b 115#define LTTNG_KERNEL_WAIT_QUIESCENT _IO(0xF6, 0x48)
90d13b3d 116#define LTTNG_KERNEL_SYSCALL_LIST _IO(0xF6, 0x4A)
c052142c
MD
117#define LTTNG_KERNEL_TRACER_ABI_VERSION \
118 _IOR(0xF6, 0x4B, struct lttng_kernel_tracer_abi_version)
8d609afd
JD
119
120/* Session FD ioctl */
4dbc372b
JD
121#define LTTNG_KERNEL_METADATA \
122 _IOW(0xF6, 0x54, struct lttng_kernel_channel)
123#define LTTNG_KERNEL_CHANNEL \
124 _IOW(0xF6, 0x55, struct lttng_kernel_channel)
125#define LTTNG_KERNEL_SESSION_START _IO(0xF6, 0x56)
126#define LTTNG_KERNEL_SESSION_STOP _IO(0xF6, 0x57)
ccf10263
MD
127#define LTTNG_KERNEL_SESSION_TRACK_PID \
128 _IOR(0xF6, 0x58, int32_t)
129#define LTTNG_KERNEL_SESSION_UNTRACK_PID \
130 _IOR(0xF6, 0x59, int32_t)
d2b102df
JG
131/*
132 * ioctl 0x58 and 0x59 are duplicated here. It works, since _IOR vs _IO
133 * are generating two different ioctl numbers, but this was not done on
134 * purpose. We should generally try to avoid those duplications.
135 */
a5dfbb9d 136#define LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58)
93ec662e 137#define LTTNG_KERNEL_SESSION_METADATA_REGEN _IO(0xF6, 0x59)
1eceaef1
MD
138/* 0x5A and 0x5B are reserved for a future ABI-breaking cleanup. */
139#define LTTNG_KERNEL_SESSION_STATEDUMP _IO(0xF6, 0x5C)
8ff4109e
JR
140#define LTTNG_KERNEL_SESSION_SET_NAME \
141 _IOR(0xF6, 0x5D, struct lttng_kernel_session_name)
e04b2181
JR
142#define LTTNG_KERNEL_SESSION_SET_CREATION_TIME \
143 _IOR(0xF6, 0x5E, struct lttng_kernel_session_creation_time)
8d609afd
JD
144
145/* Channel FD ioctl */
4dbc372b
JD
146#define LTTNG_KERNEL_STREAM _IO(0xF6, 0x62)
147#define LTTNG_KERNEL_EVENT \
148 _IOW(0xF6, 0x63, struct lttng_kernel_event)
e80c3634
MD
149#define LTTNG_KERNEL_SYSCALL_MASK \
150 _IOWR(0xF6, 0x64, struct lttng_kernel_syscall_mask)
f3ed775e 151
857aa172 152/* Event and Channel FD ioctl */
4dbc372b
JD
153#define LTTNG_KERNEL_CONTEXT \
154 _IOW(0xF6, 0x71, struct lttng_kernel_context)
857aa172 155
f3ed775e 156/* Event, Channel and Session ioctl */
4dbc372b
JD
157#define LTTNG_KERNEL_ENABLE _IO(0xF6, 0x82)
158#define LTTNG_KERNEL_DISABLE _IO(0xF6, 0x83)
16421f6e 159
00a62084
MD
160/* Event FD ioctl */
161#define LTTNG_KERNEL_FILTER _IO(0xF6, 0x90)
1ab8c2ad 162#define LTTNG_KERNEL_ADD_CALLSITE _IO(0xF6, 0x91)
00a62084 163
d01c0e56
MD
164/* Session FD ioctl (continued) */
165#define LTTNG_KERNEL_SESSION_LIST_TRACKER_IDS \
166 _IOR(0xF6, 0xA0, struct lttng_kernel_tracker_args)
167#define LTTNG_KERNEL_SESSION_TRACK_ID \
168 _IOR(0xF6, 0xA1, struct lttng_kernel_tracker_args)
169#define LTTNG_KERNEL_SESSION_UNTRACK_ID \
170 _IOR(0xF6, 0xA2, struct lttng_kernel_tracker_args)
171
16421f6e 172#endif /* _LTT_KERNEL_IOCTL_H */
This page took 0.058285 seconds and 4 git commands to generate.