All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	stable@vger.kernel.org, Fuad Tabba <fuad.tabba@linux.dev>,
	Vincent Donnefort <vdonnefort@google.com>
Subject: [for-linus][PATCH 2/5] tracing/remotes: Align field offset in remote_event_format_show()
Date: Fri, 27 Nov 2026 13:42:05 -0500	[thread overview]
Message-ID: <20261127184241.768558453@kernel.org> (raw)
In-Reply-To: 20261127184203.439481361@kernel.org

From: Vincent Donnefort <vdonnefort@google.com>

remote_event_format_show() doesn't take into account each field's
alignment leading to an incorrect reporting of the actual field offset.
Use the existing field->align.

Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009132848.709379-1-vdonnefort@google.com
Fixes: 072529158e60 ("tracing: Add events to trace remotes")
Reported-by: Fuad Tabba <fuad.tabba@linux.dev>
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Reviewed-by: Fuad Tabba <fuad.tabba@linux.dev>
Tested-by: Fuad Tabba <fuad.tabba@linux.dev>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_remote.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/trace/trace_remote.c b/kernel/trace/trace_remote.c
index 2d5bc423efca..7e35f48ae467 100644
--- a/kernel/trace/trace_remote.c
+++ b/kernel/trace/trace_remote.c
@@ -1098,6 +1098,7 @@ static int remote_event_format_show(struct seq_file *s, void *unused)
 
 	field = &evt->fields[0];
 	while (field->name) {
+		offset = ALIGN(offset, field->align);
 		seq_printf(s, "\tfield:%s %s;\toffset:%zu;\tsize:%u;\tsigned:%d;\n",
 			   field->type, field->name, offset, field->size,
 			   field->is_signed);
-- 
2.53.0

  parent reply	other threads:[~2026-11-27 18:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 18:42 [for-linus][PATCH 0/5] tracing: Fixes for v7.4 Steven Rostedt
2026-11-27 18:42 ` [for-linus][PATCH 1/5] tracing/user_events: Fail fork when event state duplication fails Steven Rostedt
2026-11-27 18:42 ` Steven Rostedt [this message]
2026-11-27 18:42 ` [for-linus][PATCH 3/5] ftrace: Fix lost recursion records in ftrace_record_recursion() Steven Rostedt
2026-11-27 18:42 ` [for-linus][PATCH 4/5] ftrace: Reject "!!" in front of a set_ftrace_filter command Steven Rostedt
2026-11-27 18:42 ` [for-linus][PATCH 5/5] tracing/filters: Use atomic bitops and READ_ONCE() for trace_event_file::flags Steven Rostedt

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=20261127184241.768558453@kernel.org \
    --to=rostedt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=fuad.tabba@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vdonnefort@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.