Re: [PATCH v13 2/6] ring-buffer: Introducing ring-buffer mapping functions
From: Vincent Donnefort <hidden>
Date: 2024-02-05 09:44:03
Also in:
lkml
On Sat, Feb 03, 2024 at 07:33:51PM -0500, Steven Rostedt wrote:
On Mon, 29 Jan 2024 14:27:58 +0000 Vincent Donnefort [off-list ref] wrote:quoted
--- /dev/null +++ b/include/uapi/linux/trace_mmap.h@@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _TRACE_MMAP_H_ +#define _TRACE_MMAP_H_ + +#include <linux/types.h> + +/** + * struct trace_buffer_meta - Ring-buffer Meta-page description + * @meta_page_size: Size of this meta-page. + * @meta_struct_len: Size of this structure. + * @subbuf_size: Size of each subbuf, including the header.That is "the header"?
I mean the header of the "bpage". But that is confusing. I'll either remove that mention or just say it is aligned with the order of a system page size.
quoted
+ * @nr_subbufs: Number of subbfs in the ring-buffer. + * @reader.lost_events: Number of events lost at the time of the reader swap. + * @reader.id: subbuf ID of the current reader. From 0 to @nr_subbufs - 1 + * @reader.read: Number of bytes read on the reader subbuf.Note, flags needs a comment.quoted
+ * @entries: Number of entries in the ring-buffer. + * @overrun: Number of entries lost in the ring-buffer. + * @read: Number of entries that have been read.So does the two Reserved words, otherwise I'm going to start getting error reports about sparse warnings that check kerneldoc comments against their content. Every field needs to be represented in the kerneldoc comment.
Ack, wasn't sure it was needed.
-- Stevequoted
+ */ +struct trace_buffer_meta { + __u32 meta_page_size; + __u32 meta_struct_len; + + __u32 subbuf_size; + __u32 nr_subbufs; + + struct { + __u64 lost_events; + __u32 id; + __u32 read; + } reader; + + __u64 flags; + + __u64 entries; + __u64 overrun; + __u64 read; + + __u64 Reserved1; + __u64 Reserved2; +}; + +#endif /* _TRACE_MMAP_H_ */