The latest tagged release of libtraceevent/libtracefs/trace-cmd leads to a broken -R output: git clone git://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git git -C trace-cmd checkout trace-cmd-v3.1.5 git clone https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git git -C libtraceevent checkout libtraceevent-1.7.0 git clone https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git git -C libtracefs checkout libtracefs-1.6.3 Built on Alpine with musl libc to make that static binary: https://github.com/ARM-software/lisa/raw/d05e8efa46e10165a2b1526a89210ae1473859a8/lisa/_assets/binaries/x86_64/trace-cmd The test trace (trace.dat v6 AFAIR) is available at: https://github.com/ARM-software/lisa/raw/d05e8efa46e10165a2b1526a89210ae1473859a8/doc/traces/trace.dat $ trace-cmd report trace.dat <idle>-0 [000] 470.783794: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=sshd next_pid=3807 next_prio=120 $ trace-cmd report -R trace.dat <idle>-0 [000] 470.783794: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=0 prev_state=0 next_comm=sshd next_pid=0 next_prio=0 Note prev_pid and next_pid both equal to 0 in the raw format output. This seems to happen with all integer fields.
I bisected it to commit libtraceevent commit efd32896dd5dbcaf72927dc07102fc359f6bdd6e libtraceevent: Add warnings if fields are outside the event Compared to the old version of libtraceevent I was using, it still differs in display style (decimal instead of hex) but otherwise seems to be working.
Created attachment 303539 [details] Use data size instead of field size to see if field falls out of bounds Can you test this patch. But debugging this, I think this could be optimized a bit as well. But that's another story.
Fixed by: https://patchwork.kernel.org/project/linux-trace-devel/patch/20230106142341.15df4486@gandalf.local.home/
That seems to have fixed the issue, thanks !