+11
−0
+160
−0
Loading
Introduce a benchmarking framework to the string_kunit test suite to measure the execution efficiency of string functions. The implementation is inspired by crc_benchmark(), measuring throughput (MB/s) and latency (ns/call) across a range of string lengths. It includes a warm-up phase, disables preemption during measurement, and uses a fixed seed for reproducible results. This framework allows for comparing different implementations (e.g., generic C vs. architecture-optimized assembly) within the KUnit environment. Initially, provide a benchmark for strlen(). Suggested-by:Andy Shevchenko <andy@kernel.org> Suggested-by:
Eric Biggers <ebiggers@kernel.org> Signed-off-by:
Feng Jiang <jiangfeng@kylinos.cn> Reviewed-by:
Kees Cook <kees@kernel.org> Link: https://patch.msgid.link/20260130025018.172925-5-jiangfeng@kylinos.cn [pjw@kernel.org: fixed a checkpatch issue] Signed-off-by:
Paul Walmsley <pjw@kernel.org>