tracing/remotes: Align field offset in remote_event_format_show()
PATCH 1/1 tracing/remotes: Align field offset in remote_event_format_show()
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 <[email protected]>
Signed-off-by Vincent Donnefort <[email protected]>
--- kernel/trace/trace_remote.c | 1 + 1 file changed, 1 insertion(+)
kernel/trace/trace_remote.c +1 -0
@@ -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
Signature · 1 line
2.56.0.385.gd3acb90ef8-goog
Hi Vincent,
Quoted 3 lines · Vincent Donnefort
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 existingfield->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 <[email protected]>
Tested-by Fuad Tabba <[email protected]>
Cheers,
/fuad