* [PATCH v1] tracing/remotes: Align field offset in remote_event_format_show()
@ 2026-10-09 13:28 Vincent Donnefort
2026-10-09 14:39 ` Fuad Tabba
0 siblings, 1 reply; 2+ messages in thread
From: Vincent Donnefort @ 2026-10-09 13:28 UTC (permalink / raw)
To: rostedt, mhiramat, linux-trace-kernel
Cc: mathieu.desnoyers, kernel-team, linux-kernel, Vincent Donnefort,
Fuad Tabba
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.
Fixes: 072529158e60 ("tracing: Add events to trace remotes")
Reported-by: Fuad Tabba <fuad.tabba@linux.dev>
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
---
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);
base-commit: a90ee4305c4a5df72c11b31dacfdc76e00fcf78a
--
2.56.0.385.gd3acb90ef8-goog
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v1] tracing/remotes: Align field offset in remote_event_format_show()
2026-10-09 13:28 [PATCH v1] tracing/remotes: Align field offset in remote_event_format_show() Vincent Donnefort
@ 2026-10-09 14:39 ` Fuad Tabba
0 siblings, 0 replies; 2+ messages in thread
From: Fuad Tabba @ 2026-10-09 14:39 UTC (permalink / raw)
To: Vincent Donnefort
Cc: rostedt, mhiramat, linux-trace-kernel, mathieu.desnoyers,
kernel-team, linux-kernel
Hi Vincent,
On Fri, 09 Oct 2026 14:28:48 +0100, Vincent Donnefort
<vdonnefort@google.com> wrote:
> 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.
Tested in pKVM: the format files under remotes/hypervisor now report
hyp_enter's vcpu at offset 4 and selftest's id at 8, matching the
structs, and the hypervisor ftracetest still passes.
Reviewed-by: Fuad Tabba <fuad.tabba@linux.dev>
Tested-by: Fuad Tabba <fuad.tabba@linux.dev>
Cheers,
/fuad
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-09 14:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-09 13:28 [PATCH v1] tracing/remotes: Align field offset in remote_event_format_show() Vincent Donnefort
2026-10-09 14:39 ` Fuad Tabba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®