xref: /linux-6.15/include/uapi/linux/trace_mmap.h (revision 4ecaf7e9)
1117c3920SVincent Donnefort /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2117c3920SVincent Donnefort #ifndef _TRACE_MMAP_H_
3117c3920SVincent Donnefort #define _TRACE_MMAP_H_
4117c3920SVincent Donnefort 
5117c3920SVincent Donnefort #include <linux/types.h>
6117c3920SVincent Donnefort 
7117c3920SVincent Donnefort /**
8117c3920SVincent Donnefort  * struct trace_buffer_meta - Ring-buffer Meta-page description
9117c3920SVincent Donnefort  * @meta_page_size:	Size of this meta-page.
10117c3920SVincent Donnefort  * @meta_struct_len:	Size of this structure.
11117c3920SVincent Donnefort  * @subbuf_size:	Size of each sub-buffer.
12117c3920SVincent Donnefort  * @nr_subbufs:		Number of subbfs in the ring-buffer, including the reader.
13117c3920SVincent Donnefort  * @reader.lost_events:	Number of events lost at the time of the reader swap.
14117c3920SVincent Donnefort  * @reader.id:		subbuf ID of the current reader. ID range [0 : @nr_subbufs - 1]
15117c3920SVincent Donnefort  * @reader.read:	Number of bytes read on the reader subbuf.
16117c3920SVincent Donnefort  * @flags:		Placeholder for now, 0 until new features are supported.
17117c3920SVincent Donnefort  * @entries:		Number of entries in the ring-buffer.
18117c3920SVincent Donnefort  * @overrun:		Number of entries lost in the ring-buffer.
19117c3920SVincent Donnefort  * @read:		Number of entries that have been read.
20117c3920SVincent Donnefort  * @Reserved1:		Internal use only.
21117c3920SVincent Donnefort  * @Reserved2:		Internal use only.
22117c3920SVincent Donnefort  */
23117c3920SVincent Donnefort struct trace_buffer_meta {
24117c3920SVincent Donnefort 	__u32		meta_page_size;
25117c3920SVincent Donnefort 	__u32		meta_struct_len;
26117c3920SVincent Donnefort 
27117c3920SVincent Donnefort 	__u32		subbuf_size;
28117c3920SVincent Donnefort 	__u32		nr_subbufs;
29117c3920SVincent Donnefort 
30117c3920SVincent Donnefort 	struct {
31117c3920SVincent Donnefort 		__u64	lost_events;
32117c3920SVincent Donnefort 		__u32	id;
33117c3920SVincent Donnefort 		__u32	read;
34117c3920SVincent Donnefort 	} reader;
35117c3920SVincent Donnefort 
36117c3920SVincent Donnefort 	__u64	flags;
37117c3920SVincent Donnefort 
38117c3920SVincent Donnefort 	__u64	entries;
39117c3920SVincent Donnefort 	__u64	overrun;
40117c3920SVincent Donnefort 	__u64	read;
41117c3920SVincent Donnefort 
42117c3920SVincent Donnefort 	__u64	Reserved1;
43117c3920SVincent Donnefort 	__u64	Reserved2;
44117c3920SVincent Donnefort };
45117c3920SVincent Donnefort 
46*4ecaf7e9SSteven Rostedt (Google) #define TRACE_MMAP_IOCTL_GET_READER		_IO('R', 0x20)
47cf9f0f7cSVincent Donnefort 
48117c3920SVincent Donnefort #endif /* _TRACE_MMAP_H_ */
49