Skip to content

libtracefs utest: Fix trace cpu pipe and test_mem failures

Frank Heimes linux-trace-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3libtracefs utest: Scale trace cpu pipe test to the sub-buffer sizeutest/tracefs-utest.c+13 -10 replies
2/3libtracefs utest: Run valgrind memory test with fair schedulingMakefile+1 -00 replies
3/3libtracefs utest: Account for overruns in the trace cpu pipe testutest/tracefs-utest.c+27 -10 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/3] libtracefs utest: Fix trace cpu pipe and test_mem failures

These fix unit test failures reported here:

https://lore.kernel.org/linux-trace-devel/[email protected]/

- Patch 1: on architectures with 64K pages (ppc64el), the large step of "trace cpu pipe" writes more than 13 GB into /tmp with the memory mapped buffer, which fails with ENOSPC on a tmpfs /tmp.

- Patch 2: "make test_mem" hangs in "trace pid events filter", as the spinning threads starve the main thread under valgrind.

- Patch 3: "trace cpu pipe" fails under valgrind when the memory mapped reader can not keep up and the kernel overwrites events.

The patches are independent of each other. I can also send them separately, if that's preferred.

Related fixes for the same report:

- kbuffer: Fix out-of-bounds write in kbuffer_read_buffer()
https://lore.kernel.org/linux-trace-devel/[email protected]/T/#u
- libtracefs: Do not miss sub-buffers when reading a memory mapped buffer
https://lore.kernel.org/linux-trace-devel/[email protected]/T/#u
- libtracefs utest: Fix buffer size in follow events clear test
https://lore.kernel.org/linux-trace-devel/[email protected]/

Tested on ppc64el (POWER9, 64K pages, kernel 7.3) on top of master, together with the related fixes above: "trace cpu pipe" passes in "make test" and "make test_mem", and "make test_mem" no longer hangs.

Frank Heimes (3):
libtracefs utest: Scale trace cpu pipe test to the sub-buffer size libtracefs utest: Run valgrind memory test with fair scheduling libtracefs utest: Account for overruns in the trace cpu pipe test

 Makefile              |  1 +
 utest/tracefs-utest.c | 42 ++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 41 insertions(+), 2 deletions(-)
Signature · 1 line
2.53.0