ring-buffer: Fix forced 8-byte alignment event length
Status from this message: NACK
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | ring-buffer: Fix event length with forced 8-byte alignmentkernel/ | +2 | 4 replies | |
| 2/2 | selftests/ftrace: Account for 8-byte aligned trace_marker_raw eventstools/ tools/ | +46 | 4 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Masami Hiramatsu (Google) |
|---|---|
| 1/2 | R-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] ring-buffer: Fix forced 8-byte alignment event length
This series fixes the event length reported by ring_buffer_event_length() when RB_FORCE_8BYTE_ALIGNMENT is enabled, and updates the ftrace trace_marker_raw selftest to account for that layout.
On architectures where CONFIG_HAVE_64BIT_ALIGNED_ACCESS is enabled, the ring buffer forces 8-byte alignment. In that mode, the event length is stored in event->array[0] even for small data events, and the payload starts from event->array[1]. However, ring_buffer_event_length() only subtracted the extra length field for large events. As a result, small events reported a payload length 4 bytes larger than expected.
This was observed on riscv64 with CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y when running the ftrace trace_marker_raw.tc selftest. The first patch fixes the ring-buffer length calculation. The second patch updates the selftest expectation when the running kernel uses forced 8-byte alignment.
Hui Wang (2):
ring-buffer: Fix event length with forced 8-byte alignment selftests/ftrace: Account for 8-byte aligned trace_marker_raw events
kernel/trace/ring_buffer.c | 3 +- .../ftrace/test.d/00basic/trace_marker_raw.tc | 16 +++++++-- .../testing/selftests/ftrace/test.d/functions | 33 +++++++++++++++++++ 3 files changed, 48 insertions(+), 4 deletions(-)
Signature · 1 line
2.43.0