Fix: consumerd: unbalanced subbuffer 'get' when checking operation availability
[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
b8e2fb80
FD
12#define LTTNG_KERNEL_ABI_MAJOR_VERSION 2
13#define LTTNG_KERNEL_ABI_MINOR_VERSION 6
c052142c 14
16421f6e 15/* Get a snapshot of the current ring buffer producer and consumer positions */
b8e2fb80 16#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT _IO(0xF6, 0x00)
16421f6e 17/* Get the consumer position (iteration start) */
b8e2fb80 18#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_CONSUMED _IOR(0xF6, 0x01, unsigned long)
16421f6e 19/* Get the producer position (iteration end) */
b8e2fb80 20#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_PRODUCED _IOR(0xF6, 0x02, unsigned long)
16421f6e 21/* Get exclusive read access to the specified sub-buffer position */
b8e2fb80 22#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF _IOW(0xF6, 0x03, unsigned long)
16421f6e 23/* Release exclusive sub-buffer access */
b8e2fb80 24#define LTTNG_KERNEL_ABI_RING_BUFFER_PUT_SUBBUF _IO(0xF6, 0x04)
16421f6e
DG
25
26/* Get exclusive read access to the next sub-buffer that can be read. */
b8e2fb80 27#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF _IO(0xF6, 0x05)
16421f6e 28/* Release exclusive sub-buffer access, move consumer forward. */
b8e2fb80 29#define LTTNG_KERNEL_ABI_RING_BUFFER_PUT_NEXT_SUBBUF _IO(0xF6, 0x06)
16421f6e 30/* returns the size of the current sub-buffer, without padding (for mmap). */
b8e2fb80 31#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF_SIZE _IOR(0xF6, 0x07, unsigned long)
16421f6e 32/* returns the size of the current sub-buffer, with padding (for splice). */
b8e2fb80 33#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PADDED_SUBBUF_SIZE _IOR(0xF6, 0x08, unsigned long)
16421f6e 34/* returns the maximum size for sub-buffers. */
b8e2fb80 35#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MAX_SUBBUF_SIZE _IOR(0xF6, 0x09, unsigned long)
16421f6e 36/* returns the length to mmap. */
b8e2fb80 37#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_LEN _IOR(0xF6, 0x0A, unsigned long)
16421f6e 38/* returns the offset of the subbuffer belonging to the mmap reader. */
b8e2fb80 39#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_READ_OFFSET _IOR(0xF6, 0x0B, unsigned long)
f22dd891 40/* Flush the current sub-buffer, if non-empty. */
b8e2fb80 41#define LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH _IO(0xF6, 0x0C)
93ec662e 42/* Get the current version of the metadata cache (after a get_next). */
b8e2fb80 43#define LTTNG_KERNEL_ABI_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 */
b8e2fb80 49#define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS _IO(0xF6, 0x0E)
f22dd891 50/* Flush the current sub-buffer, even if empty. */
b8e2fb80 51#define LTTNG_KERNEL_ABI_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 */
b8e2fb80 56#define LTTNG_KERNEL_ABI_RING_BUFFER_METADATA_CACHE_DUMP _IO(0xF6, 0x10)
99930a9d 57/* Clear ring buffer content */
b8e2fb80
FD
58#define LTTNG_KERNEL_ABI_RING_BUFFER_CLEAR _IO(0xF6, 0x11)
59#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK _IOR(0xF6, 0x12, uint32_t)
00e2e675 60
309167d2 61/* returns the timestamp begin of the current sub-buffer */
b8e2fb80 62#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t)
309167d2 63/* returns the timestamp end of the current sub-buffer */
b8e2fb80 64#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t)
309167d2 65/* returns the number of events discarded */
b8e2fb80 66#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t)
309167d2 67/* returns the packet payload size */
b8e2fb80 68#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t)
309167d2 69/* returns the actual packet size */
b8e2fb80 70#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t)
309167d2 71/* returns the stream id */
b8e2fb80 72#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t)
d3e2ba59 73/* returns the current timestamp */
b8e2fb80 74#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t)
fb83fe64 75/* returns the packet sequence number */
b8e2fb80 76#define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t)
000fa86f 77/* returns the stream instance id */
b8e2fb80 78#define LTTNG_KERNEL_ABI_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t)
309167d2 79
4dbc372b
JD
80/* Old ABI (without support for 32/64 bits compat) */
81/* LTTng file descriptor ioctl */
b8e2fb80
FD
82#define LTTNG_KERNEL_ABI_OLD_SESSION _IO(0xF6, 0x40)
83#define LTTNG_KERNEL_ABI_OLD_TRACER_VERSION \
84 _IOR(0xF6, 0x41, struct lttng_kernel_abi_old_tracer_version)
85#define LTTNG_KERNEL_ABI_OLD_TRACEPOINT_LIST _IO(0xF6, 0x42)
86#define LTTNG_KERNEL_ABI_OLD_WAIT_QUIESCENT _IO(0xF6, 0x43)
4dbc372b
JD
87
88/* Session FD ioctl */
b8e2fb80
FD
89#define LTTNG_KERNEL_ABI_OLD_METADATA \
90 _IOW(0xF6, 0x50, struct lttng_kernel_abi_old_channel)
91#define LTTNG_KERNEL_ABI_OLD_CHANNEL \
92 _IOW(0xF6, 0x51, struct lttng_kernel_abi_old_channel)
93#define LTTNG_KERNEL_ABI_OLD_SESSION_START _IO(0xF6, 0x52)
94#define LTTNG_KERNEL_ABI_OLD_SESSION_STOP _IO(0xF6, 0x53)
4dbc372b
JD
95
96/* Channel FD ioctl */
b8e2fb80
FD
97#define LTTNG_KERNEL_ABI_OLD_STREAM _IO(0xF6, 0x60)
98#define LTTNG_KERNEL_ABI_OLD_EVENT \
99 _IOW(0xF6, 0x61, struct lttng_kernel_abi_old_event)
f3ed775e 100
4dbc372b 101/* Event and Channel FD ioctl */
b8e2fb80
FD
102#define LTTNG_KERNEL_ABI_OLD_CONTEXT \
103 _IOW(0xF6, 0x70, struct lttng_kernel_abi_old_context)
4dbc372b
JD
104
105/* Event, Channel and Session ioctl */
b8e2fb80
FD
106#define LTTNG_KERNEL_ABI_OLD_ENABLE _IO(0xF6, 0x80)
107#define LTTNG_KERNEL_ABI_OLD_DISABLE _IO(0xF6, 0x81)
4dbc372b
JD
108
109
110/* Current ABI (with suport for 32/64 bits compat) */
857aa172 111/* LTTng file descriptor ioctl */
b8e2fb80
FD
112#define LTTNG_KERNEL_ABI_SESSION _IO(0xF6, 0x45)
113#define LTTNG_KERNEL_ABI_TRACER_VERSION \
114 _IOR(0xF6, 0x46, struct lttng_kernel_abi_tracer_version)
115#define LTTNG_KERNEL_ABI_TRACEPOINT_LIST _IO(0xF6, 0x47)
116#define LTTNG_KERNEL_ABI_WAIT_QUIESCENT _IO(0xF6, 0x48)
117#define LTTNG_KERNEL_ABI_SYSCALL_LIST _IO(0xF6, 0x4A)
118#define LTTNG_KERNEL_ABI_TRACER_ABI_VERSION \
119 _IOR(0xF6, 0x4B, struct lttng_kernel_abi_tracer_abi_version)
120#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_CREATE \
cfb1c9bc 121 _IO(0xF6, 0x4C)
8d609afd
JD
122
123/* Session FD ioctl */
b8e2fb80
FD
124#define LTTNG_KERNEL_ABI_METADATA \
125 _IOW(0xF6, 0x54, struct lttng_kernel_abi_channel)
126#define LTTNG_KERNEL_ABI_CHANNEL \
127 _IOW(0xF6, 0x55, struct lttng_kernel_abi_channel)
128#define LTTNG_KERNEL_ABI_SESSION_START _IO(0xF6, 0x56)
129#define LTTNG_KERNEL_ABI_SESSION_STOP _IO(0xF6, 0x57)
130#define LTTNG_KERNEL_ABI_SESSION_TRACK_PID \
acbe1c12 131 _IOW(0xF6, 0x58, int32_t)
b8e2fb80 132#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_PID \
acbe1c12 133 _IOW(0xF6, 0x59, int32_t)
d2b102df
JG
134/*
135 * ioctl 0x58 and 0x59 are duplicated here. It works, since _IOR vs _IO
136 * are generating two different ioctl numbers, but this was not done on
137 * purpose. We should generally try to avoid those duplications.
138 */
b8e2fb80
FD
139#define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58)
140#define LTTNG_KERNEL_ABI_SESSION_METADATA_REGEN _IO(0xF6, 0x59)
1eceaef1 141/* 0x5A and 0x5B are reserved for a future ABI-breaking cleanup. */
b8e2fb80
FD
142#define LTTNG_KERNEL_ABI_SESSION_STATEDUMP _IO(0xF6, 0x5C)
143#define LTTNG_KERNEL_ABI_SESSION_SET_NAME \
acbe1c12 144 _IOW(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
b8e2fb80 145#define LTTNG_KERNEL_ABI_SESSION_SET_CREATION_TIME \
acbe1c12 146 _IOW(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
8d609afd
JD
147
148/* Channel FD ioctl */
b8e2fb80
FD
149#define LTTNG_KERNEL_ABI_STREAM _IO(0xF6, 0x62)
150#define LTTNG_KERNEL_ABI_EVENT \
151 _IOW(0xF6, 0x63, struct lttng_kernel_abi_event)
152#define LTTNG_KERNEL_ABI_SYSCALL_MASK \
153 _IOWR(0xF6, 0x64, struct lttng_kernel_abi_syscall_mask)
f3ed775e 154
857aa172 155/* Event and Channel FD ioctl */
b8e2fb80
FD
156#define LTTNG_KERNEL_ABI_CONTEXT \
157 _IOW(0xF6, 0x71, struct lttng_kernel_abi_context)
857aa172 158
cfb1c9bc 159/* Event, event notifier, Channel and Session ioctl */
b8e2fb80
FD
160#define LTTNG_KERNEL_ABI_ENABLE _IO(0xF6, 0x82)
161#define LTTNG_KERNEL_ABI_DISABLE _IO(0xF6, 0x83)
16421f6e 162
90aa04a1 163/* Event notifier group ioctl */
b8e2fb80
FD
164#define LTTNG_KERNEL_ABI_COUNTER \
165 _IOW(0xF6, 0x84, struct lttng_kernel_abi_counter_conf)
90aa04a1 166
cfb1c9bc 167/* Event and event notifier FD ioctl */
b8e2fb80
FD
168#define LTTNG_KERNEL_ABI_FILTER _IO(0xF6, 0x90)
169#define LTTNG_KERNEL_ABI_ADD_CALLSITE _IO(0xF6, 0x91)
00a62084 170
d01c0e56 171/* Session FD ioctl (continued) */
b8e2fb80 172#define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_IDS \
acbe1c12 173 _IOW(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
b8e2fb80 174#define LTTNG_KERNEL_ABI_SESSION_TRACK_ID \
acbe1c12 175 _IOW(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
b8e2fb80 176#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_ID \
acbe1c12 177 _IOW(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
d01c0e56 178
cfb1c9bc 179/* Event notifier group file descriptor ioctl */
b8e2fb80
FD
180#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_CREATE \
181 _IOW(0xF6, 0xB0, struct lttng_kernel_abi_event_notifier)
182#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD \
cfb1c9bc
JR
183 _IO(0xF6, 0xB1)
184
90aa04a1 185/* Event notifier file descriptor ioctl */
b8e2fb80 186#define LTTNG_KERNEL_ABI_CAPTURE _IO(0xF6, 0xB8)
bbd6675c 187
90aa04a1 188/* Counter file descriptor ioctl */
b8e2fb80
FD
189#define LTTNG_KERNEL_ABI_COUNTER_READ \
190 IOWR(0xF6, 0xC0, struct lttng_kernel_abi_counter_read)
191#define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE \
192 _IOWR(0xF6, 0xC1, struct lttng_kernel_abi_counter_aggregate)
193#define LTTNG_KERNEL_ABI_COUNTER_CLEAR \
194 _IOW(0xF6, 0xC2, struct lttng_kernel_abi_counter_clear)
90aa04a1 195
acbe1c12
FD
196/*
197 * Those ioctl numbers use the wrong direction, but are kept for ABI backward
198 * compatibility.
199 */
200 #define LTTNG_KERNEL_ABI_OLD_SESSION_SET_NAME \
201 _IOR(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
202 #define LTTNG_KERNEL_ABI_OLD_SESSION_SET_CREATION_TIME \
203 _IOR(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
204 #define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_PID \
205 _IOW(0xF6, 0x58, int32_t)
206 #define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_PID \
207 _IOW(0xF6, 0x59, int32_t)
208 #define LTTNG_KERNEL_ABI_OLD_SESSION_LIST_TRACKER_IDS \
209 _IOR(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
210 #define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_ID \
211 _IOR(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
212 #define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_ID \
213 _IOR(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
90aa04a1 214
16421f6e 215#endif /* _LTT_KERNEL_IOCTL_H */
This page took 0.071464 seconds and 4 git commands to generate.