]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lib/string_kunit: extend benchmarks to strnlen() and chr searches
authorFeng Jiang <jiangfeng@kylinos.cn>
Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)
committerPaul Walmsley <pjw@kernel.org>
Sun, 5 Apr 2026 00:42:44 +0000 (18:42 -0600)
commite73bcb3708a69369d506e5bc6a63d4fc13d8e28a
tree11dcc0f94b8c56938943ea14b3f43549e8a1e08f
parent0020240a431187628e2636284023e63b9b7a2aa1
lib/string_kunit: extend benchmarks to strnlen() and chr searches

Extend the string benchmarking suite to include strnlen(), strchr(),
and strrchr().

For character search functions strchr() and strrchr(), the benchmark
targets the NUL character. This ensures the entire string is scanned,
providing a consistent measure of full-length processing efficiency
comparable to strlen().

Suggested-by: Andy Shevchenko <andy@kernel.org>
Suggested-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Acked-by: Andy Shevchenko <andy@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20260130025018.172925-6-jiangfeng@kylinos.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
lib/tests/string_kunit.c