summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorGokul K <gokul02k@gmail.com>2026-09-18 11:14:20 +0530
committerSean Christopherson <seanjc@google.com>2026-09-29 06:24:45 -0700
commit3069f4036dff6a36936c9f43f38c408db58bc846 (patch)
tree06b240830d439c614f4abd73834e6a608074ea99 /tools/perf/scripts/python/stackcollapse.py
parentdd572ec94640b07e495237d2a6afd3d29a4c2a7c (diff)
downloadlinux-next-3069f4036dff6a36936c9f43f38c408db58bc846.tar.gz
linux-next-3069f4036dff6a36936c9f43f38c408db58bc846.zip
KVM: selftests: Move test_read() into elf.c and delete lib/io.c
lib/io.c has outlived its purpose. test_read() has exactly one caller, lib/elf.c; test_write() has none at all; and test_seq_read() is a declaration in test_util.h with no definition anywhere in the tree. Both surviving helpers open with TEST_ASSERT(count >= 0, "Unexpected count, count: %li", count); which can never fire, because @count is a size_t. Building with -Wextra points this out: lib/io.c:51:27: warning: comparison of unsigned expression in '>= 0' is always true [-Wtype-limits] lib/io.c:128:27: warning: comparison of unsigned expression in '>= 0' is always true [-Wtype-limits] The comment above each assertion is worse than the assertion itself: it cites the read(2) and write(2) manpages to claim that a count of zero is allowed, but a zero count lands in "case 0" and fails the test outright. The helper has never accepted what the comment promises. Move test_read() into elf.c as a static elf_read(), named for what it does rather than reading as "test the read() syscall", and assert that @count is non-zero, which is what the code has always required and what every caller already passes. Drop the commentary describing retry behaviour that the code makes obvious. Nothing is then left in lib/io.c, so remove the file along with test_write() and the stale test_seq_read() declaration. No functional change intended. Suggested-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/all/aqxNbR9u5F1sqB3p@google.com Signed-off-by: Gokul K <gokul02k@gmail.com> Link: https://patch.msgid.link/20260918054420.338842-1-gokul02k@gmail.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions