kernctl commands to extract the stream instance id
[lttng-tools.git] / src / common / kernel-ctl / kernel-ioctl.h
1 /*
2 * Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca>
3 * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 *
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.
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 *
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.
17 */
18
19 #ifndef _LTT_KERNEL_IOCTL_H
20 #define _LTT_KERNEL_IOCTL_H
21
22 #define LTTNG_MODULES_ABI_MAJOR_VERSION 2
23 #define LTTNG_MODULES_ABI_MINOR_VERSION 0
24
25 /* Get a snapshot of the current ring buffer producer and consumer positions */
26 #define RING_BUFFER_SNAPSHOT _IO(0xF6, 0x00)
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 */
32 #define RING_BUFFER_GET_SUBBUF _IOW(0xF6, 0x03, unsigned long)
33 /* Release exclusive sub-buffer access */
34 #define RING_BUFFER_PUT_SUBBUF _IO(0xF6, 0x04)
35
36 /* Get exclusive read access to the next sub-buffer that can be read. */
37 #define RING_BUFFER_GET_NEXT_SUBBUF _IO(0xF6, 0x05)
38 /* Release exclusive sub-buffer access, move consumer forward. */
39 #define RING_BUFFER_PUT_NEXT_SUBBUF _IO(0xF6, 0x06)
40 /* returns the size of the current sub-buffer, without padding (for mmap). */
41 #define RING_BUFFER_GET_SUBBUF_SIZE _IOR(0xF6, 0x07, unsigned long)
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. */
47 #define RING_BUFFER_GET_MMAP_LEN _IOR(0xF6, 0x0A, unsigned long)
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)
50 /* flush the current sub-buffer */
51 #define RING_BUFFER_FLUSH _IO(0xF6, 0x0C)
52
53 /* returns the timestamp begin of the current sub-buffer */
54 #define LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t)
55 /* returns the timestamp end of the current sub-buffer */
56 #define LTTNG_RING_BUFFER_GET_TIMESTAMP_END _IOR(0xF6, 0x21, uint64_t)
57 /* returns the number of events discarded */
58 #define LTTNG_RING_BUFFER_GET_EVENTS_DISCARDED _IOR(0xF6, 0x22, uint64_t)
59 /* returns the packet payload size */
60 #define LTTNG_RING_BUFFER_GET_CONTENT_SIZE _IOR(0xF6, 0x23, uint64_t)
61 /* returns the actual packet size */
62 #define LTTNG_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t)
63 /* returns the stream id */
64 #define LTTNG_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t)
65 /* returns the current timestamp */
66 #define LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t)
67 /* returns the packet sequence number */
68 #define LTTNG_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t)
69 /* returns the stream instance id */
70 #define LTTNG_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t)
71
72 /* Old ABI (without support for 32/64 bits compat) */
73 /* LTTng file descriptor ioctl */
74 #define LTTNG_KERNEL_OLD_SESSION _IO(0xF6, 0x40)
75 #define LTTNG_KERNEL_OLD_TRACER_VERSION \
76 _IOR(0xF6, 0x41, struct lttng_kernel_old_tracer_version)
77 #define LTTNG_KERNEL_OLD_TRACEPOINT_LIST _IO(0xF6, 0x42)
78 #define LTTNG_KERNEL_OLD_WAIT_QUIESCENT _IO(0xF6, 0x43)
79 #define LTTNG_KERNEL_OLD_CALIBRATE \
80 _IOWR(0xF6, 0x44, struct lttng_kernel_old_calibrate)
81
82 /* Session FD ioctl */
83 #define LTTNG_KERNEL_OLD_METADATA \
84 _IOW(0xF6, 0x50, struct lttng_kernel_old_channel)
85 #define LTTNG_KERNEL_OLD_CHANNEL \
86 _IOW(0xF6, 0x51, struct lttng_kernel_old_channel)
87 #define LTTNG_KERNEL_OLD_SESSION_START _IO(0xF6, 0x52)
88 #define LTTNG_KERNEL_OLD_SESSION_STOP _IO(0xF6, 0x53)
89
90 /* Channel FD ioctl */
91 #define LTTNG_KERNEL_OLD_STREAM _IO(0xF6, 0x60)
92 #define LTTNG_KERNEL_OLD_EVENT \
93 _IOW(0xF6, 0x61, struct lttng_kernel_old_event)
94
95 /* Event and Channel FD ioctl */
96 #define LTTNG_KERNEL_OLD_CONTEXT \
97 _IOW(0xF6, 0x70, struct lttng_kernel_old_context)
98
99 /* Event, Channel and Session ioctl */
100 #define LTTNG_KERNEL_OLD_ENABLE _IO(0xF6, 0x80)
101 #define LTTNG_KERNEL_OLD_DISABLE _IO(0xF6, 0x81)
102
103
104 /* Current ABI (with suport for 32/64 bits compat) */
105 /* LTTng file descriptor ioctl */
106 #define LTTNG_KERNEL_SESSION _IO(0xF6, 0x45)
107 #define LTTNG_KERNEL_TRACER_VERSION \
108 _IOR(0xF6, 0x46, struct lttng_kernel_tracer_version)
109 #define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x47)
110 #define LTTNG_KERNEL_WAIT_QUIESCENT _IO(0xF6, 0x48)
111 #define LTTNG_KERNEL_CALIBRATE \
112 _IOWR(0xF6, 0x49, struct lttng_kernel_calibrate)
113 #define LTTNG_KERNEL_SYSCALL_LIST _IO(0xF6, 0x4A)
114 #define LTTNG_KERNEL_TRACER_ABI_VERSION \
115 _IOR(0xF6, 0x4B, struct lttng_kernel_tracer_abi_version)
116
117 /* Session FD ioctl */
118 #define LTTNG_KERNEL_METADATA \
119 _IOW(0xF6, 0x54, struct lttng_kernel_channel)
120 #define LTTNG_KERNEL_CHANNEL \
121 _IOW(0xF6, 0x55, struct lttng_kernel_channel)
122 #define LTTNG_KERNEL_SESSION_START _IO(0xF6, 0x56)
123 #define LTTNG_KERNEL_SESSION_STOP _IO(0xF6, 0x57)
124 #define LTTNG_KERNEL_SESSION_TRACK_PID \
125 _IOR(0xF6, 0x58, int32_t)
126 #define LTTNG_KERNEL_SESSION_UNTRACK_PID \
127 _IOR(0xF6, 0x59, int32_t)
128 #define LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58)
129
130 /* Channel FD ioctl */
131 #define LTTNG_KERNEL_STREAM _IO(0xF6, 0x62)
132 #define LTTNG_KERNEL_EVENT \
133 _IOW(0xF6, 0x63, struct lttng_kernel_event)
134 #define LTTNG_KERNEL_SYSCALL_MASK \
135 _IOWR(0xF6, 0x64, struct lttng_kernel_syscall_mask)
136
137 /* Event and Channel FD ioctl */
138 #define LTTNG_KERNEL_CONTEXT \
139 _IOW(0xF6, 0x71, struct lttng_kernel_context)
140
141 /* Event, Channel and Session ioctl */
142 #define LTTNG_KERNEL_ENABLE _IO(0xF6, 0x82)
143 #define LTTNG_KERNEL_DISABLE _IO(0xF6, 0x83)
144
145 /* Event FD ioctl */
146 #define LTTNG_KERNEL_FILTER _IO(0xF6, 0x90)
147
148 #endif /* _LTT_KERNEL_IOCTL_H */
This page took 0.04416 seconds and 4 git commands to generate.