From: Steven Rostedt <rostedt@goodmis.org>
To: Cao Ruichuang <create0818@163.com>
Cc: mhiramat@kernel.org, mathieu.desnoyers@efficios.com,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] ring-buffer: Preserve true payload lengths in long data events
Date: Tue, 7 Apr 2026 11:48:12 -0400 [thread overview]
Message-ID: <20260407114812.580c27d5@gandalf.local.home> (raw)
In-Reply-To: <20260407091550.67963-1-create0818@163.com>
On Tue, 7 Apr 2026 17:15:50 +0800
Cao Ruichuang <create0818@163.com> wrote:
> Long ring buffer data records currently store the aligned in-buffer size in
> their length field. That makes ring_buffer_event_length() report padded
> sizes, and small TRACE_PRINT / TRACE_RAW_DATA records lose their true
> payload length entirely when they use the short type_len encoding.
>
> Teach long data events to keep the true payload size in array[0], and let
> the ring buffer derive the aligned in-buffer size separately when it needs
> to walk or discard records. Then add a long-reserve helper and use it for
> TRACE_PRINT and TRACE_RAW_DATA so their zero-length-array tails always
> preserve the real payload size.
Sorry, I'm against this change. I made a conscious decision to have the
ring buffer meta data record the size allocated and not the size requested.
If an event needs to know the actual size, then it needs to add that
information itself. That's not the job of the ring buffer code.
NAK.
-- Steve
next prev parent reply other threads:[~2026-04-07 15:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-07 9:15 [PATCH] ring-buffer: Preserve true payload lengths in long data events Cao Ruichuang
2026-04-07 15:48 ` Steven Rostedt [this message]
2026-04-07 16:45 ` Cao Ruichuang
2026-04-15 9:29 ` kernel test robot
2026-04-15 10:36 ` kernel test robot
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=20260407114812.580c27d5@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=create0818@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.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