Skip to content

libtraceevent: Fix BTF utest host dependencies

Cao Ruichuang linux-trace-devel 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 1 replySuperseded

Changes in v2 from the cover letter

- In patch 1, fold the read_full() call into CU_TEST() so that future CUnit failure output reports the actual failing expression instead of only "ret == 0", as suggested by Steven.
- No code changes in patch 2.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2libtraceevent utest: Handle short reads when reading BTFutest/traceevent-utest.c+31 -10 replies
2/2libtraceevent utest: Avoid host-specific getname_flags outpututest/traceevent-utest.c+19 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] libtraceevent: Fix BTF utest host dependencies

Fix two independent host-dependent failures in the BTF utest.

The first patch handles short reads from /sys/kernel/btf/vmlinux after mmap() fails. On a Rocky Linux 9.7 system, mmap() fails with ENODEV and a single read() returns 4096 bytes from a 5150407-byte BTF file, while a read loop returns the full file.

The second patch avoids failing the exact getname_flags() output check when the host kernel BTF has extra arguments appended after the expected arguments. On the same system, getname_flags() has a third parameter named "empty", so tep_btf_print_args() correctly prints:

getname_flags(filename=0x7ffe7d33f3d0, flags=0, empty=0x0)

Validation was done on x86_64 Rocky Linux 9.7, kernel 5.14.0-570.42.2.el9_6.x86_64:

  make -j$(nproc)
  make test
  ./utest/trace-utest -r traceevent

All commands completed successfully after this series.

Changes since v1:
- In patch 1, fold the read_full() call into CU_TEST() so that future CUnit failure output reports the actual failing expression instead of only "ret == 0", as suggested by Steven.
- No code changes in patch 2.

Cao Ruichuang (2):
libtraceevent utest: Handle short reads when reading BTF libtraceevent utest: Avoid host-specific getname_flags output

 utest/traceevent-utest.c | 52 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 50 insertions(+), 2 deletions(-)
Signature · 1 line
2.39.5 (Apple Git-154)