Tests: Fix: Use '.logfile' instead of '.log' for test app output
[lttng-tools.git] / src / common / kernel-ctl / kernel-ioctl.hpp
1 /*
2 * Copyright (C) 2011 EfficiOS Inc.
3 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 */
8
9 #ifndef _LTT_KERNEL_IOCTL_H
10 #define _LTT_KERNEL_IOCTL_H
11
12 #define LTTNG_KERNEL_ABI_MAJOR_VERSION 2
13 #define LTTNG_KERNEL_ABI_MINOR_VERSION 6
14
15 /* Get a snapshot of the current ring buffer producer and consumer positions */
16 #define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT _IO(0xF6, 0x00)
17 /* Get the consumer position (iteration start) */
18 #define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_CONSUMED _IOR(0xF6, 0x01, unsigned long)
19 /* Get the producer position (iteration end) */
20 #define LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_GET_PRODUCED _IOR(0xF6, 0x02, unsigned long)
21 /* Get exclusive read access to the specified sub-buffer position */
22 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF _IOW(0xF6, 0x03, unsigned long)
23 /* Release exclusive sub-buffer access */
24 #define LTTNG_KERNEL_ABI_RING_BUFFER_PUT_SUBBUF _IO(0xF6, 0x04)
25
26 /* Get exclusive read access to the next sub-buffer that can be read. */
27 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF _IO(0xF6, 0x05)
28 /* Release exclusive sub-buffer access, move consumer forward. */
29 #define LTTNG_KERNEL_ABI_RING_BUFFER_PUT_NEXT_SUBBUF _IO(0xF6, 0x06)
30 /* returns the size of the current sub-buffer, without padding (for mmap). */
31 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SUBBUF_SIZE _IOR(0xF6, 0x07, unsigned long)
32 /* returns the size of the current sub-buffer, with padding (for splice). */
33 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PADDED_SUBBUF_SIZE _IOR(0xF6, 0x08, unsigned long)
34 /* returns the maximum size for sub-buffers. */
35 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MAX_SUBBUF_SIZE _IOR(0xF6, 0x09, unsigned long)
36 /* returns the length to mmap. */
37 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_LEN _IOR(0xF6, 0x0A, unsigned long)
38 /* returns the offset of the subbuffer belonging to the mmap reader. */
39 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_MMAP_READ_OFFSET _IOR(0xF6, 0x0B, unsigned long)
40 /* Flush the current sub-buffer, if non-empty. */
41 #define LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH _IO(0xF6, 0x0C)
42 /* Get the current version of the metadata cache (after a get_next). */
43 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_METADATA_VERSION _IOR(0xF6, 0x0D, uint64_t)
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 LTTNG_KERNEL_ABI_RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS _IO(0xF6, 0x0E)
50 /* Flush the current sub-buffer, even if empty. */
51 #define LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY _IO(0xF6, 0x0F)
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 LTTNG_KERNEL_ABI_RING_BUFFER_METADATA_CACHE_DUMP _IO(0xF6, 0x10)
57 /* Clear ring buffer content */
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)
60
61 /* returns the timestamp begin of the current sub-buffer */
62 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t)
63 /* returns the timestamp end of the current sub-buffer */
64 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t)
65 /* returns the number of events discarded */
66 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t)
67 /* returns the packet payload size */
68 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t)
69 /* returns the actual packet size */
70 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t)
71 /* returns the stream id */
72 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t)
73 /* returns the current timestamp */
74 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t)
75 /* returns the packet sequence number */
76 #define LTTNG_KERNEL_ABI_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t)
77 /* returns the stream instance id */
78 #define LTTNG_KERNEL_ABI_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t)
79
80 /* Old ABI (without support for 32/64 bits compat) */
81 /* LTTng file descriptor ioctl */
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)
87
88 /* Session FD ioctl */
89 #define LTTNG_KERNEL_ABI_OLD_METADATA _IOW(0xF6, 0x50, struct lttng_kernel_abi_old_channel)
90 #define LTTNG_KERNEL_ABI_OLD_CHANNEL _IOW(0xF6, 0x51, struct lttng_kernel_abi_old_channel)
91 #define LTTNG_KERNEL_ABI_OLD_SESSION_START _IO(0xF6, 0x52)
92 #define LTTNG_KERNEL_ABI_OLD_SESSION_STOP _IO(0xF6, 0x53)
93
94 /* Channel FD ioctl */
95 #define LTTNG_KERNEL_ABI_OLD_STREAM _IO(0xF6, 0x60)
96 #define LTTNG_KERNEL_ABI_OLD_EVENT _IOW(0xF6, 0x61, struct lttng_kernel_abi_old_event)
97
98 /* Event and Channel FD ioctl */
99 #define LTTNG_KERNEL_ABI_OLD_CONTEXT _IOW(0xF6, 0x70, struct lttng_kernel_abi_old_context)
100
101 /* Event, Channel and Session ioctl */
102 #define LTTNG_KERNEL_ABI_OLD_ENABLE _IO(0xF6, 0x80)
103 #define LTTNG_KERNEL_ABI_OLD_DISABLE _IO(0xF6, 0x81)
104
105 /* Current ABI (with suport for 32/64 bits compat) */
106 /* LTTng file descriptor ioctl */
107 #define LTTNG_KERNEL_ABI_SESSION _IO(0xF6, 0x45)
108 #define LTTNG_KERNEL_ABI_TRACER_VERSION _IOR(0xF6, 0x46, struct lttng_kernel_abi_tracer_version)
109 #define LTTNG_KERNEL_ABI_TRACEPOINT_LIST _IO(0xF6, 0x47)
110 #define LTTNG_KERNEL_ABI_WAIT_QUIESCENT _IO(0xF6, 0x48)
111 #define LTTNG_KERNEL_ABI_SYSCALL_LIST _IO(0xF6, 0x4A)
112 #define LTTNG_KERNEL_ABI_TRACER_ABI_VERSION \
113 _IOR(0xF6, 0x4B, struct lttng_kernel_abi_tracer_abi_version)
114 #define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_CREATE _IO(0xF6, 0x4C)
115
116 /* Session FD ioctl */
117 #define LTTNG_KERNEL_ABI_METADATA _IOW(0xF6, 0x54, struct lttng_kernel_abi_channel)
118 #define LTTNG_KERNEL_ABI_CHANNEL _IOW(0xF6, 0x55, struct lttng_kernel_abi_channel)
119 #define LTTNG_KERNEL_ABI_SESSION_START _IO(0xF6, 0x56)
120 #define LTTNG_KERNEL_ABI_SESSION_STOP _IO(0xF6, 0x57)
121 #define LTTNG_KERNEL_ABI_SESSION_TRACK_PID _IOW(0xF6, 0x58, int32_t)
122 #define LTTNG_KERNEL_ABI_SESSION_UNTRACK_PID _IOW(0xF6, 0x59, int32_t)
123 /*
124 * ioctl 0x58 and 0x59 are duplicated here. It works, since _IOR vs _IO
125 * are generating two different ioctl numbers, but this was not done on
126 * purpose. We should generally try to avoid those duplications.
127 */
128 #define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58)
129 #define LTTNG_KERNEL_ABI_SESSION_METADATA_REGEN _IO(0xF6, 0x59)
130 /* 0x5A and 0x5B are reserved for a future ABI-breaking cleanup. */
131 #define LTTNG_KERNEL_ABI_SESSION_STATEDUMP _IO(0xF6, 0x5C)
132 #define LTTNG_KERNEL_ABI_SESSION_SET_NAME _IOW(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
133 #define LTTNG_KERNEL_ABI_SESSION_SET_CREATION_TIME \
134 _IOW(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
135
136 /* Channel FD ioctl */
137 #define LTTNG_KERNEL_ABI_STREAM _IO(0xF6, 0x62)
138 #define LTTNG_KERNEL_ABI_EVENT _IOW(0xF6, 0x63, struct lttng_kernel_abi_event)
139 #define LTTNG_KERNEL_ABI_SYSCALL_MASK _IOWR(0xF6, 0x64, struct lttng_kernel_abi_syscall_mask)
140
141 /* Event and Channel FD ioctl */
142 #define LTTNG_KERNEL_ABI_CONTEXT _IOW(0xF6, 0x71, struct lttng_kernel_abi_context)
143
144 /* Event, event notifier, Channel and Session ioctl */
145 #define LTTNG_KERNEL_ABI_ENABLE _IO(0xF6, 0x82)
146 #define LTTNG_KERNEL_ABI_DISABLE _IO(0xF6, 0x83)
147
148 /* Event notifier group ioctl */
149 #define LTTNG_KERNEL_ABI_COUNTER _IOW(0xF6, 0x84, struct lttng_kernel_abi_counter_conf)
150
151 /* Event and event notifier FD ioctl */
152 #define LTTNG_KERNEL_ABI_FILTER _IO(0xF6, 0x90)
153 #define LTTNG_KERNEL_ABI_ADD_CALLSITE _IO(0xF6, 0x91)
154
155 /* Session FD ioctl (continued) */
156 #define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_IDS \
157 _IOW(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
158 #define LTTNG_KERNEL_ABI_SESSION_TRACK_ID _IOW(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
159 #define LTTNG_KERNEL_ABI_SESSION_UNTRACK_ID _IOW(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
160
161 /* Event notifier group file descriptor ioctl */
162 #define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_CREATE \
163 _IOW(0xF6, 0xB0, struct lttng_kernel_abi_event_notifier)
164 #define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD _IO(0xF6, 0xB1)
165
166 /* Event notifier file descriptor ioctl */
167 #define LTTNG_KERNEL_ABI_CAPTURE _IO(0xF6, 0xB8)
168
169 /* Counter file descriptor ioctl */
170 #define LTTNG_KERNEL_ABI_COUNTER_READ IOWR(0xF6, 0xC0, struct lttng_kernel_abi_counter_read)
171 #define LTTNG_KERNEL_ABI_COUNTER_AGGREGATE \
172 _IOWR(0xF6, 0xC1, struct lttng_kernel_abi_counter_aggregate)
173 #define LTTNG_KERNEL_ABI_COUNTER_CLEAR _IOW(0xF6, 0xC2, struct lttng_kernel_abi_counter_clear)
174 #define LTTNG_KERNEL_ABI_COUNTER_MAP_NR_DESCRIPTORS _IOR(0xF6, 0xC3, uint64_t)
175 #define LTTNG_KERNEL_ABI_COUNTER_MAP_DESCRIPTOR \
176 _IOWR(0xF6, 0xC4, struct lttng_kernel_abi_counter_map_descriptor)
177 #define LTTNG_KERNEL_ABI_COUNTER_EVENT _IOW(0xF6, 0xC5, struct lttng_kernel_abi_counter_event)
178
179 /*
180 * Those ioctl numbers use the wrong direction, but are kept for ABI backward
181 * compatibility.
182 */
183 #define LTTNG_KERNEL_ABI_OLD_SESSION_SET_NAME _IOR(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
184 #define LTTNG_KERNEL_ABI_OLD_SESSION_SET_CREATION_TIME \
185 _IOR(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
186 #define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_PID _IOW(0xF6, 0x58, int32_t)
187 #define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_PID _IOW(0xF6, 0x59, int32_t)
188 #define LTTNG_KERNEL_ABI_OLD_SESSION_LIST_TRACKER_IDS \
189 _IOR(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
190 #define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_ID _IOR(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
191 #define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_ID \
192 _IOR(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
193
194 #endif /* _LTT_KERNEL_IOCTL_H */
This page took 0.038387 seconds and 5 git commands to generate.