Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion testing/libc/arch_libc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
# ##############################################################################

if(CONFIG_TESTING_ARCH_LIBC)
if(CONFIG_TESTING_ARCH_LIBC_BENCH)
set(bench_srcs arch_libc_bench.c)
endif()

nuttx_add_application(
NAME
${CONFIG_TESTING_ARCH_LIBC_PROGNAME}
Expand All @@ -31,5 +35,6 @@ if(CONFIG_TESTING_ARCH_LIBC)
MODULE
${CONFIG_TESTING_ARCH_LIBC}
SRCS
arch_libc_test_main.c)
arch_libc_test_main.c
${bench_srcs})
endif()
38 changes: 38 additions & 0 deletions testing/libc/arch_libc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ config TESTING_ARCH_LIBC_STRCPY
bool "test strcpy"
default y

config TESTING_ARCH_LIBC_MEMCCPY
bool "test memccpy"
default y

config TESTING_ARCH_LIBC_STPNCPY
bool "test stpncpy"
default y

config TESTING_ARCH_LIBC_STRLCPY
bool "test strlcpy"
default y

config TESTING_ARCH_LIBC_STRLEN
bool "test strlen"
default y
Expand Down Expand Up @@ -75,6 +87,32 @@ config TESTING_ARCH_LIBC_STRCHRNUL
bool "test strchrnul"
default y

config TESTING_ARCH_LIBC_BENCH
bool "throughput benchmark"
default n
---help---
Measure each function across a size sweep and every source and
destination alignment pair, reporting MB/s and cycles per byte.
An implementation usually takes its wide path only when the
pointers meet some alignment condition, so an aligned measurement
alone does not show what the rest of the input space costs.

if TESTING_ARCH_LIBC_BENCH

config TESTING_ARCH_LIBC_BENCH_BUFSIZE
int "benchmark buffer size"
default 262144
---help---
Size of each of the two buffers the benchmark allocates.

config TESTING_ARCH_LIBC_BENCH_MINMS
int "minimum milliseconds per measurement"
default 250
---help---
Each measurement repeats until it has run for at least this long.

endif

config TESTING_ARCH_LIBC_PROGNAME
string "Program name"
default "arch_libctest"
Expand Down
4 changes: 4 additions & 0 deletions testing/libc/arch_libc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ MODULE = $(CONFIG_TESTING_ARCH_LIBC)

# arch libc test

ifneq ($(CONFIG_TESTING_ARCH_LIBC_BENCH),)
CSRCS += arch_libc_bench.c
endif

MAINSRC = arch_libc_test_main.c

include $(APPDIR)/Application.mk
Loading
Loading