Re: [PATCH] selftests/ftrace: Check exact trace_marker_raw payload lengths
From: Steven Rostedt
Date: Tue Apr 07 2026 - 12:55:39 EST
On Tue, 7 Apr 2026 18:12:45 +0800
CaoRuichuang <create0818@xxxxxxx> wrote:
> From: Cao Ruichuang <create0818@xxxxxxx>
>
> trace_marker_raw.tc currently depends on awk strtonum() and
> assumes that the printed raw-data byte count is rounded up to four
> bytes.
>
> That makes the test fail on systems that use mawk, and it no longer
> matches the raw_data trace output we want to validate after preserving
> true payload lengths for long records.
>
> Rewrite the test to capture a small sequence of raw marker writes and
> check the exact number of printed payload bytes in order. While doing
> that, use od for the endian probe, switch to a fixed raw marker id so
> the test only varies payload length, and disable pause-on-trace while
> streaming trace_pipe.
>
The tests are to validate the code and if the tests fail when the code is
working as designed, it is the test that is at fault, and the fix is to fix
the tests. Not to make the code match the test.
-- Steve