Commit | Line | Data |
---|---|---|
16421f6e DG |
1 | /* |
2 | * Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca> | |
3 | * Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
4 | * | |
d14d33bf AM |
5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License, version 2 only, | |
7 | * as published by the Free Software Foundation. | |
16421f6e DG |
8 | * |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
d14d33bf AM |
14 | * You should have received a copy of the GNU General Public License along |
15 | * with this program; if not, write to the Free Software Foundation, Inc., | |
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
16421f6e DG |
17 | */ |
18 | ||
19 | #ifndef _LTT_KERNEL_IOCTL_H | |
20 | #define _LTT_KERNEL_IOCTL_H | |
21 | ||
29c62722 | 22 | #define LTTNG_MODULES_ABI_MAJOR_VERSION 2 |
cf0bcb51 | 23 | #define LTTNG_MODULES_ABI_MINOR_VERSION 3 |
c052142c | 24 | |
16421f6e | 25 | /* Get a snapshot of the current ring buffer producer and consumer positions */ |
f3ed775e | 26 | #define RING_BUFFER_SNAPSHOT _IO(0xF6, 0x00) |
16421f6e DG |
27 | /* Get the consumer position (iteration start) */ |
28 | #define RING_BUFFER_SNAPSHOT_GET_CONSUMED _IOR(0xF6, 0x01, unsigned long) | |
29 | /* Get the producer position (iteration end) */ | |
30 | #define RING_BUFFER_SNAPSHOT_GET_PRODUCED _IOR(0xF6, 0x02, unsigned long) | |
31 | /* Get exclusive read access to the specified sub-buffer position */ | |
f3ed775e | 32 | #define RING_BUFFER_GET_SUBBUF _IOW(0xF6, 0x03, unsigned long) |
16421f6e | 33 | /* Release exclusive sub-buffer access */ |
f3ed775e | 34 | #define RING_BUFFER_PUT_SUBBUF _IO(0xF6, 0x04) |
16421f6e DG |
35 | |
36 | /* Get exclusive read access to the next sub-buffer that can be read. */ | |
f3ed775e | 37 | #define RING_BUFFER_GET_NEXT_SUBBUF _IO(0xF6, 0x05) |
16421f6e | 38 | /* Release exclusive sub-buffer access, move consumer forward. */ |
f3ed775e | 39 | #define RING_BUFFER_PUT_NEXT_SUBBUF _IO(0xF6, 0x06) |
16421f6e | 40 | /* returns the size of the current sub-buffer, without padding (for mmap). */ |
f3ed775e | 41 | #define RING_BUFFER_GET_SUBBUF_SIZE _IOR(0xF6, 0x07, unsigned long) |
16421f6e DG |
42 | /* returns the size of the current sub-buffer, with padding (for splice). */ |
43 | #define RING_BUFFER_GET_PADDED_SUBBUF_SIZE _IOR(0xF6, 0x08, unsigned long) | |
44 | /* returns the maximum size for sub-buffers. */ | |
45 | #define RING_BUFFER_GET_MAX_SUBBUF_SIZE _IOR(0xF6, 0x09, unsigned long) | |
46 | /* returns the length to mmap. */ | |
f3ed775e | 47 | #define RING_BUFFER_GET_MMAP_LEN _IOR(0xF6, 0x0A, unsigned long) |
16421f6e DG |
48 | /* returns the offset of the subbuffer belonging to the mmap reader. */ |
49 | #define RING_BUFFER_GET_MMAP_READ_OFFSET _IOR(0xF6, 0x0B, unsigned long) | |
f3ed775e DG |
50 | /* flush the current sub-buffer */ |
51 | #define RING_BUFFER_FLUSH _IO(0xF6, 0x0C) | |
93ec662e JD |
52 | /* Get the current version of the metadata cache (after a get_next). */ |
53 | #define RING_BUFFER_GET_METADATA_VERSION _IOR(0xF6, 0x0D, uint64_t) | |
b007ec59 JG |
54 | /* |
55 | * Get a snapshot of the current ring buffer producer and consumer positions, | |
56 | * regardless of whether or not the two positions are contained within the same | |
57 | * sub-buffer. | |
58 | */ | |
59 | #define RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS _IO(0xF6, 0x0E) | |
00e2e675 | 60 | |
309167d2 JD |
61 | /* returns the timestamp begin of the current sub-buffer */ |
62 | #define LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t) | |
63 | /* returns the timestamp end of the current sub-buffer */ | |
64 | #define LTTNG_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t) | |
65 | /* returns the number of events discarded */ | |
66 | #define LTTNG_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t) | |
67 | /* returns the packet payload size */ | |
68 | #define LTTNG_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t) | |
69 | /* returns the actual packet size */ | |
70 | #define LTTNG_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t) | |
71 | /* returns the stream id */ | |
72 | #define LTTNG_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t) | |
d3e2ba59 JD |
73 | /* returns the current timestamp */ |
74 | #define LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t) | |
fb83fe64 JD |
75 | /* returns the packet sequence number */ |
76 | #define LTTNG_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t) | |
000fa86f JD |
77 | /* returns the stream instance id */ |
78 | #define LTTNG_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 */ | |
82 | #define LTTNG_KERNEL_OLD_SESSION _IO(0xF6, 0x40) | |
83 | #define LTTNG_KERNEL_OLD_TRACER_VERSION \ | |
84 | _IOR(0xF6, 0x41, struct lttng_kernel_old_tracer_version) | |
85 | #define LTTNG_KERNEL_OLD_TRACEPOINT_LIST _IO(0xF6, 0x42) | |
86 | #define LTTNG_KERNEL_OLD_WAIT_QUIESCENT _IO(0xF6, 0x43) | |
4dbc372b JD |
87 | |
88 | /* Session FD ioctl */ | |
89 | #define LTTNG_KERNEL_OLD_METADATA \ | |
90 | _IOW(0xF6, 0x50, struct lttng_kernel_old_channel) | |
91 | #define LTTNG_KERNEL_OLD_CHANNEL \ | |
92 | _IOW(0xF6, 0x51, struct lttng_kernel_old_channel) | |
93 | #define LTTNG_KERNEL_OLD_SESSION_START _IO(0xF6, 0x52) | |
94 | #define LTTNG_KERNEL_OLD_SESSION_STOP _IO(0xF6, 0x53) | |
95 | ||
96 | /* Channel FD ioctl */ | |
97 | #define LTTNG_KERNEL_OLD_STREAM _IO(0xF6, 0x60) | |
98 | #define LTTNG_KERNEL_OLD_EVENT \ | |
99 | _IOW(0xF6, 0x61, struct lttng_kernel_old_event) | |
f3ed775e | 100 | |
4dbc372b JD |
101 | /* Event and Channel FD ioctl */ |
102 | #define LTTNG_KERNEL_OLD_CONTEXT \ | |
103 | _IOW(0xF6, 0x70, struct lttng_kernel_old_context) | |
104 | ||
105 | /* Event, Channel and Session ioctl */ | |
106 | #define LTTNG_KERNEL_OLD_ENABLE _IO(0xF6, 0x80) | |
107 | #define LTTNG_KERNEL_OLD_DISABLE _IO(0xF6, 0x81) | |
108 | ||
109 | ||
110 | /* Current ABI (with suport for 32/64 bits compat) */ | |
857aa172 | 111 | /* LTTng file descriptor ioctl */ |
4dbc372b JD |
112 | #define LTTNG_KERNEL_SESSION _IO(0xF6, 0x45) |
113 | #define LTTNG_KERNEL_TRACER_VERSION \ | |
114 | _IOR(0xF6, 0x46, struct lttng_kernel_tracer_version) | |
d02666a9 | 115 | #define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x47) |
4dbc372b | 116 | #define LTTNG_KERNEL_WAIT_QUIESCENT _IO(0xF6, 0x48) |
90d13b3d | 117 | #define LTTNG_KERNEL_SYSCALL_LIST _IO(0xF6, 0x4A) |
c052142c MD |
118 | #define LTTNG_KERNEL_TRACER_ABI_VERSION \ |
119 | _IOR(0xF6, 0x4B, struct lttng_kernel_tracer_abi_version) | |
8d609afd JD |
120 | |
121 | /* Session FD ioctl */ | |
4dbc372b JD |
122 | #define LTTNG_KERNEL_METADATA \ |
123 | _IOW(0xF6, 0x54, struct lttng_kernel_channel) | |
124 | #define LTTNG_KERNEL_CHANNEL \ | |
125 | _IOW(0xF6, 0x55, struct lttng_kernel_channel) | |
126 | #define LTTNG_KERNEL_SESSION_START _IO(0xF6, 0x56) | |
127 | #define LTTNG_KERNEL_SESSION_STOP _IO(0xF6, 0x57) | |
ccf10263 MD |
128 | #define LTTNG_KERNEL_SESSION_TRACK_PID \ |
129 | _IOR(0xF6, 0x58, int32_t) | |
130 | #define LTTNG_KERNEL_SESSION_UNTRACK_PID \ | |
131 | _IOR(0xF6, 0x59, int32_t) | |
d2b102df JG |
132 | /* |
133 | * ioctl 0x58 and 0x59 are duplicated here. It works, since _IOR vs _IO | |
134 | * are generating two different ioctl numbers, but this was not done on | |
135 | * purpose. We should generally try to avoid those duplications. | |
136 | */ | |
a5dfbb9d | 137 | #define LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58) |
93ec662e | 138 | #define LTTNG_KERNEL_SESSION_METADATA_REGEN _IO(0xF6, 0x59) |
1eceaef1 MD |
139 | /* 0x5A and 0x5B are reserved for a future ABI-breaking cleanup. */ |
140 | #define LTTNG_KERNEL_SESSION_STATEDUMP _IO(0xF6, 0x5C) | |
8d609afd JD |
141 | |
142 | /* Channel FD ioctl */ | |
4dbc372b JD |
143 | #define LTTNG_KERNEL_STREAM _IO(0xF6, 0x62) |
144 | #define LTTNG_KERNEL_EVENT \ | |
145 | _IOW(0xF6, 0x63, struct lttng_kernel_event) | |
e80c3634 MD |
146 | #define LTTNG_KERNEL_SYSCALL_MASK \ |
147 | _IOWR(0xF6, 0x64, struct lttng_kernel_syscall_mask) | |
f3ed775e | 148 | |
857aa172 | 149 | /* Event and Channel FD ioctl */ |
4dbc372b JD |
150 | #define LTTNG_KERNEL_CONTEXT \ |
151 | _IOW(0xF6, 0x71, struct lttng_kernel_context) | |
857aa172 | 152 | |
f3ed775e | 153 | /* Event, Channel and Session ioctl */ |
4dbc372b JD |
154 | #define LTTNG_KERNEL_ENABLE _IO(0xF6, 0x82) |
155 | #define LTTNG_KERNEL_DISABLE _IO(0xF6, 0x83) | |
16421f6e | 156 | |
00a62084 MD |
157 | /* Event FD ioctl */ |
158 | #define LTTNG_KERNEL_FILTER _IO(0xF6, 0x90) | |
159 | ||
16421f6e | 160 | #endif /* _LTT_KERNEL_IOCTL_H */ |