Linux-Trace-Devel Archive mirror
 help / color / mirror / Atom feed
From: Vincent Donnefort <vdonnefort@google.com>
To: linux-trace-devel@vger.kernel.org, rostedt@goodmis.org
Cc: Vincent Donnefort <vdonnefort@google.com>
Subject: [PATCH v3] libtracefs: Update trace_buffer_meta
Date: Fri, 23 Feb 2024 22:47:23 +0000	[thread overview]
Message-ID: <20240223224723.132673-1-vdonnefort@google.com> (raw)

The current version for struct trace_buffer_meta is taken from a work in
progress Linux patch series. Update it.

Signed-off-by: Vincent Donnefort <vdonnefort@google.com>

diff --git a/src/tracefs-mmap.c b/src/tracefs-mmap.c
index fac13df..a0130bb 100644
--- a/src/tracefs-mmap.c
+++ b/src/tracefs-mmap.c
@@ -9,26 +9,43 @@
 #include <asm/types.h>
 #include "tracefs-local.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 sub-buffer.
+ * @nr_subbufs:		Number of subbfs in the ring-buffer, including the reader.
+ * @reader.lost_events:	Number of events lost at the time of the reader swap.
+ * @reader.id:		subbuf ID of the current reader. ID range [0 : @nr_subbufs - 1]
+ * @reader.read:	Number of bytes read on the reader subbuf.
+ * @flags:		Placeholder for now, 0 until new features are supported.
+ * @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.
+ * @Reserved1:		Reserved for future use.
+ * @Reserved2:		Reserved for future use.
+ */
 struct trace_buffer_meta {
-	unsigned long	entries;
-	unsigned long	overrun;
-	unsigned long	read;
+	__u32		meta_page_size;
+	__u32		meta_struct_len;
 
-	unsigned long	subbufs_touched;
-	unsigned long	subbufs_lost;
-	unsigned long	subbufs_read;
+	__u32		subbuf_size;
+	__u32		nr_subbufs;
 
 	struct {
-		unsigned long	lost_events;	/* Events lost at the time of the reader swap */
-		__u32		id;		/* Reader subbuf ID from 0 to nr_subbufs - 1 */
-		__u32		read;		/* Number of bytes read on the reader subbuf */
+		__u64	lost_events;
+		__u32	id;
+		__u32	read;
 	} reader;
 
-	__u32		subbuf_size;		/* Size of each subbuf including the header */
-	__u32		nr_subbufs;		/* Number of subbufs in the ring-buffer */
+	__u64	flags;
+
+	__u64	entries;
+	__u64	overrun;
+	__u64	read;
 
-	__u32		meta_page_size;		/* Size of the meta-page */
-	__u32		meta_struct_len;	/* Len of this struct */
+	__u64	Reserved1;
+	__u64	Reserved2;
 };
 
 #define TRACE_MMAP_IOCTL_GET_READER		_IO('T', 0x1)

base-commit: 04505a07824592f039eac66fe565994635eb5d5d
-- 
2.44.0.rc0.258.g7320e95886-goog


                 reply	other threads:[~2024-02-23 22:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240223224723.132673-1-vdonnefort@google.com \
    --to=vdonnefort@google.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).