[PATCH v7 5/8] lib/string_kunit: extend benchmarks to strnlen() and chr searches

Kees Cook kees at kernel.org
Fri Jan 30 09:35:52 PST 2026


On Fri, Jan 30, 2026 at 10:50:15AM +0800, Feng Jiang wrote:
> 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 at kernel.org>
> Suggested-by: Eric Biggers <ebiggers at kernel.org>
> Signed-off-by: Feng Jiang <jiangfeng at kylinos.cn>

Reviewed-by: Kees Cook <kees at kernel.org>

-- 
Kees Cook



More information about the linux-riscv mailing list