apps:Move the performance tools to benchmark.

1.ramspeed
2.cachespeed
3.osperf
4.iozone
5.superPI

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1 2023-11-06 12:17:22 +08:00 committed by Xiang Xiao
parent 4d6f4d00b0
commit e6c3930b2d
22 changed files with 72 additions and 72 deletions

View File

@ -3,27 +3,27 @@
# see the file kconfig-language.txt in the NuttX tools repository. # see the file kconfig-language.txt in the NuttX tools repository.
# #
config TESTING_CACHESPEED config BENCHMARK_CACHESPEED
bool "CACHE Speed Test" bool "CACHE Speed Test"
depends on ARCH_ICACHE && ARCH_DCACHE depends on ARCH_ICACHE && ARCH_DCACHE
default n default n
---help--- ---help---
Enable a simple CACHE speed test. Enable a simple CACHE speed test.
if TESTING_CACHESPEED if BENCHMARK_CACHESPEED
config TESTING_CACHESPEED_PROGNAME config BENCHMARK_CACHESPEED_PROGNAME
string "Program name" string "Program name"
default "cachespeed" default "cachespeed"
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.
config TESTING_CACHESPEED_PRIORITY config BENCHMARK_CACHESPEED_PRIORITY
int "CACHE speed test task priority" int "CACHE speed test task priority"
default 100 default 100
config TESTING_CACHESPEED_STACKSIZE config BENCHMARK_CACHESPEED_STACKSIZE
int "CACHE speed test stack size" int "CACHE speed test stack size"
default DEFAULT_TASK_STACKSIZE default DEFAULT_TASK_STACKSIZE

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/testing/osperf/Make.defs # apps/benchmarks/cachespeed/Make.defs
# #
# Licensed to the Apache Software Foundation (ASF) under one or more # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with # contributor license agreements. See the NOTICE file distributed with
@ -18,6 +18,6 @@
# #
############################################################################ ############################################################################
ifneq ($(CONFIG_TESTING_OSPERF),) ifneq ($(CONFIG_BENCHMARK_CACHESPEED),)
CONFIGURED_APPS += $(APPDIR)/testing/osperf CONFIGURED_APPS += $(APPDIR)/benchmarks/cachespeed
endif endif

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/testing/cachespeed/Makefile # apps/benchmarks/cachespeed/Makefile
# #
# Licensed to the Apache Software Foundation (ASF) under one or more # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with # contributor license agreements. See the NOTICE file distributed with
@ -26,10 +26,10 @@ ifneq ($(CONFIG_CACHESPEED_MONOTONIC_TIME),y)
CFLAGS += -DCACHESPEED_PERFTIME CFLAGS += -DCACHESPEED_PERFTIME
endif endif
PROGNAME = $(CONFIG_TESTING_CACHESPEED_PROGNAME) PROGNAME = $(CONFIG_BENCHMARK_CACHESPEED_PROGNAME)
PRIORITY = $(CONFIG_TESTING_CACHESPEED_PRIORITY) PRIORITY = $(CONFIG_BENCHMARK_CACHESPEED_PRIORITY)
STACKSIZE = $(CONFIG_TESTING_CACHESPEED_STACKSIZE) STACKSIZE = $(CONFIG_BENCHMARK_CACHESPEED_STACKSIZE)
MODULE = $(CONFIG_TESTING_CACHESPEED) MODULE = $(CONFIG_BENCHMARK_CACHESPEED)
MAINSRC = cachespeed_main.c MAINSRC = cachespeed_main.c

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* apps/testing/cachespeed/cachespeed_main.c * apps/benchmarks/cachespeed/cachespeed_main.c
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with

View File

@ -3,27 +3,27 @@
# see the file kconfig-language.txt in the NuttX tools repository. # see the file kconfig-language.txt in the NuttX tools repository.
# #
config TESTING_IOZONE config BENCHMARK_IOZONE
tristate "IOzone, filesystem benchmark tool" tristate "IOzone, filesystem benchmark tool"
default n default n
---help--- ---help---
https://www.iozone.org/ https://www.iozone.org/
if TESTING_IOZONE if BENCHMARK_IOZONE
config TESTING_IOZONE_PROGNAME config BENCHMARK_IOZONE_PROGNAME
string "Program name" string "Program name"
default "iozone" default "iozone"
config TESTING_IOZONE_PRIORITY config BENCHMARK_IOZONE_PRIORITY
int "IOzone task priority" int "IOzone task priority"
default 100 default 100
config TESTING_IOZONE_STACKSIZE config BENCHMARK_IOZONE_STACKSIZE
int "IOzone stack size" int "IOzone stack size"
default 8192 default 8192
config TESTING_IOZONE_VERSION config BENCHMARK_IOZONE_VERSION
string "iozone version" string "iozone version"
default "3_493" default "3_493"

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/testing/iozone/Make.defs # apps/benchmarks/iozone/Make.defs
# #
# Licensed to the Apache Software Foundation (ASF) under one or more # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with # contributor license agreements. See the NOTICE file distributed with
@ -18,6 +18,6 @@
# #
############################################################################ ############################################################################
ifneq ($(CONFIG_TESTING_IOZONE),) ifneq ($(CONFIG_BENCHMARK_IOZONE),)
CONFIGURED_APPS += $(APPDIR)/testing/iozone CONFIGURED_APPS += $(APPDIR)/benchmarks/iozone
endif endif

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/testing/iozone/Make.defs # apps/benchmarks/iozone/Make.defs
# #
# Licensed to the Apache Software Foundation (ASF) under one or more # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with # contributor license agreements. See the NOTICE file distributed with
@ -20,10 +20,10 @@
include $(APPDIR)/Make.defs include $(APPDIR)/Make.defs
PROGNAME = $(CONFIG_TESTING_IOZONE_PROGNAME) PROGNAME = $(CONFIG_BENCHMARK_IOZONE_PROGNAME)
PRIORITY = $(CONFIG_TESTING_IOZONE_PRIORITY) PRIORITY = $(CONFIG_BENCHMARK_IOZONE_PRIORITY)
STACKSIZE = $(CONFIG_TESTING_IOZONE_STACKSIZE) STACKSIZE = $(CONFIG_BENCHMARK_IOZONE_STACKSIZE)
MODULE = $(CONFIG_TESTING_IOZONE) MODULE = $(CONFIG_BENCHMARK_IOZONE)
CFLAGS += -Dunix -DHAVE_ANSIC_C -DHAVE_PREAD -DNAME='"nuttx"' CFLAGS += -Dunix -DHAVE_ANSIC_C -DHAVE_PREAD -DNAME='"nuttx"'
CFLAGS += -DNO_MADVISE -DNO_FORK -D__FreeBSD__ -DNO_THREADS CFLAGS += -DNO_MADVISE -DNO_FORK -D__FreeBSD__ -DNO_THREADS
@ -37,15 +37,15 @@ CFLAGS += -DRECLEN_START=1024
CSRCS = iozone/src/current/libbif.c CSRCS = iozone/src/current/libbif.c
MAINSRC = iozone/src/current/iozone.c MAINSRC = iozone/src/current/iozone.c
CONFIG_TESTING_IOZONE_URL ?= "https://www.iozone.org/src/current/" CONFIG_BENCHMARK_IOZONE_URL ?= "https://www.iozone.org/src/current/"
IOZONE_UNPACKNAME = iozone IOZONE_UNPACKNAME = iozone
IOZONE_VERSION = $(patsubst "%",%,$(strip $(CONFIG_TESTING_IOZONE_VERSION))) IOZONE_VERSION = $(patsubst "%",%,$(strip $(CONFIG_BENCHMARK_IOZONE_VERSION)))
IOZONE_ZIP = iozone$(IOZONE_VERSION).tgz IOZONE_ZIP = iozone$(IOZONE_VERSION).tgz
$(IOZONE_ZIP): $(IOZONE_ZIP):
@echo "Downloading: $(IOZONE_ZIP)" @echo "Downloading: $(IOZONE_ZIP)"
$(Q) curl -O -L $(CONFIG_TESTING_IOZONE_URL)/$(IOZONE_ZIP) $(Q) curl -O -L $(CONFIG_BENCHMARK_IOZONE_URL)/$(IOZONE_ZIP)
$(IOZONE_UNPACKNAME): $(IOZONE_ZIP) $(IOZONE_UNPACKNAME): $(IOZONE_ZIP)
@echo "Unpacking: $(IOZONE_ZIP) -> $(IOZONE_UNPACKNAME)" @echo "Unpacking: $(IOZONE_ZIP) -> $(IOZONE_UNPACKNAME)"

View File

@ -3,20 +3,20 @@
# see the file kconfig-language.txt in the NuttX tools repository. # see the file kconfig-language.txt in the NuttX tools repository.
# #
config TESTING_OSPERF config BENCHMARK_OSPERF
tristate "System performance profiling" tristate "System performance profiling"
default n default n
---help--- ---help---
Measure the performance of core system functions, such as thread Measure the performance of core system functions, such as thread
switching and the time required for semaphore execution switching and the time required for semaphore execution
if TESTING_OSPERF if BENCHMARK_OSPERF
config TESTING_OSPERF_PRIORITY config BENCHMARK_OSPERF_PRIORITY
int "OS profiling task priority" int "OS profiling task priority"
default 100 default 100
config TESTING_OSPERF_STACKSIZE config BENCHMARK_OSPERF_STACKSIZE
int "OS profiling stack size" int "OS profiling stack size"
default DEFAULT_TASK_STACKSIZE default DEFAULT_TASK_STACKSIZE

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/testing/superpi/Make.defs # apps/benchmarks/osperf/Make.defs
# #
# Licensed to the Apache Software Foundation (ASF) under one or more # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with # contributor license agreements. See the NOTICE file distributed with
@ -18,6 +18,6 @@
# #
############################################################################ ############################################################################
ifneq ($(CONFIG_SUPERPI),) ifneq ($(CONFIG_BENCHMARK_OSPERF),)
CONFIGURED_APPS += $(APPDIR)/testing/superpi CONFIGURED_APPS += $(APPDIR)/benchmarks/osperf
endif endif

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/testing/osperf/Makefile # apps/benchmarks/osperf/Makefile
# #
# Licensed to the Apache Software Foundation (ASF) under one or more # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with # contributor license agreements. See the NOTICE file distributed with
@ -21,9 +21,9 @@
include $(APPDIR)/Make.defs include $(APPDIR)/Make.defs
PROGNAME = osperf PROGNAME = osperf
PRIORITY = $(CONFIG_TESTING_OSPERF_PRIORITY) PRIORITY = $(CONFIG_BENCHMARK_OSPERF_PRIORITY)
STACKSIZE = $(CONFIG_TESTING_OSPERF_STACKSIZE) STACKSIZE = $(CONFIG_BENCHMARK_OSPERF_STACKSIZE)
MODULE = $(CONFIG_TESTING_OSPERF) MODULE = $(CONFIG_BENCHMARK_OSPERF)
MAINSRC = osperf.c MAINSRC = osperf.c

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* apps/testing/osperf/osperf.c * apps/benchmarks/osperf/osperf.c
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
@ -145,7 +145,7 @@ static size_t pthread_switch_performance(void)
sem_init(&perf.sem, 0, 0); sem_init(&perf.sem, 0, 0);
tid = performance_thread_create(pthread_switch_task, &perf, tid = performance_thread_create(pthread_switch_task, &perf,
CONFIG_TESTING_OSPERF_PRIORITY + 1); CONFIG_BENCHMARK_OSPERF_PRIORITY + 1);
performance_start(&perf.time); performance_start(&perf.time);
sem_post(&perf.sem); sem_post(&perf.sem);

View File

@ -3,26 +3,26 @@
# see the file kconfig-language.txt in the NuttX tools repository. # see the file kconfig-language.txt in the NuttX tools repository.
# #
config TESTING_RAMSPEED config BENCHMARK_RAMSPEED
tristate "RAM Speed Test" tristate "RAM Speed Test"
default n default n
---help--- ---help---
Enable a simple RAM speed test. Enable a simple RAM speed test.
if TESTING_RAMSPEED if BENCHMARK_RAMSPEED
config TESTING_RAMSPEED_PROGNAME config BENCHMARK_RAMSPEED_PROGNAME
string "Program name" string "Program name"
default "ramspeed" default "ramspeed"
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.
config TESTING_RAMSPEED_PRIORITY config BENCHMARK_RAMSPEED_PRIORITY
int "RAM speed test task priority" int "RAM speed test task priority"
default 100 default 100
config TESTING_RAMSPEED_STACKSIZE config BENCHMARK_RAMSPEED_STACKSIZE
int "RAM speed test stack size" int "RAM speed test stack size"
default DEFAULT_TASK_STACKSIZE default DEFAULT_TASK_STACKSIZE

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/testing/cachespeed/Make.defs # apps/benchmarks/ramspeed/Make.defs
# #
# Licensed to the Apache Software Foundation (ASF) under one or more # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with # contributor license agreements. See the NOTICE file distributed with
@ -18,6 +18,6 @@
# #
############################################################################ ############################################################################
ifneq ($(CONFIG_TESTING_CACHESPEED),) ifneq ($(CONFIG_BENCHMARK_RAMSPEED),)
CONFIGURED_APPS += $(APPDIR)/testing/cachespeed CONFIGURED_APPS += $(APPDIR)/benchmarks/ramspeed
endif endif

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/testing/ramspeed/Makefile # apps/benchmarks/ramspeed/Makefile
# #
# Licensed to the Apache Software Foundation (ASF) under one or more # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with # contributor license agreements. See the NOTICE file distributed with
@ -22,10 +22,10 @@ include $(APPDIR)/Make.defs
# RAM speed test # RAM speed test
PROGNAME = $(CONFIG_TESTING_RAMSPEED_PROGNAME) PROGNAME = $(CONFIG_BENCHMARK_RAMSPEED_PROGNAME)
PRIORITY = $(CONFIG_TESTING_RAMSPEED_PRIORITY) PRIORITY = $(CONFIG_BENCHMARK_RAMSPEED_PRIORITY)
STACKSIZE = $(CONFIG_TESTING_RAMSPEED_STACKSIZE) STACKSIZE = $(CONFIG_BENCHMARK_RAMSPEED_STACKSIZE)
MODULE = $(CONFIG_TESTING_RAMSPEED) MODULE = $(CONFIG_BENCHMARK_RAMSPEED)
MAINSRC = ramspeed_main.c MAINSRC = ramspeed_main.c

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* apps/testing/ramspeed/ramspeed_main.c * apps/benchmarks/ramspeed/ramspeed_main.c
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with

View File

@ -1,21 +1,21 @@
config SUPERPI config BENCHMARK_SUPERPI
tristate "SuperPI test" tristate "SuperPI test"
default n default n
if SUPERPI if BENCHMARK_SUPERPI
config SUPERPI_PROGNAME config BENCHMARK_SUPERPI_PROGNAME
string "Program Name" string "Program Name"
default "pi_css5" default "pi_css5"
config SUPERPI_STACKSIZE config BENCHMARK_SUPERPI_STACKSIZE
int "SuperPI stack size" int "SuperPI stack size"
default DEFAULT_TASK_STACKSIZE default DEFAULT_TASK_STACKSIZE
config SUPERPI_PRIORITY config BENCHMARK_SUPERPI_PRIORITY
int "Task PRIORITY" int "Task PRIORITY"
default 100 default 100
---help--- ---help---
The higher the priority value, the lower the priority. The higher the priority value, the lower the priority.
endif # SUPERPI endif # BENCHMARK_SUPERPI

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/testing/ramspeed/Make.defs # apps/benchmarks/superpi/Make.defs
# #
# Licensed to the Apache Software Foundation (ASF) under one or more # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with # contributor license agreements. See the NOTICE file distributed with
@ -18,6 +18,6 @@
# #
############################################################################ ############################################################################
ifneq ($(CONFIG_TESTING_RAMSPEED),) ifneq ($(CONFIG_BENCHMARK_SUPERPI),)
CONFIGURED_APPS += $(APPDIR)/testing/ramspeed CONFIGURED_APPS += $(APPDIR)/benchmarks/superpi
endif endif

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/testing/superpi/Makefile # apps/benchmarks/superpi/Makefile
# #
# Licensed to the Apache Software Foundation (ASF) under one or more # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with # contributor license agreements. See the NOTICE file distributed with
@ -27,10 +27,10 @@ SUPERPI_ZIP = $(SUPERPI_VERSION).zip
UNPACK ?= unzip -q -o UNPACK ?= unzip -q -o
CSRCS += superpi/fftsg_h.c CSRCS += superpi/fftsg_h.c
PROGNAME = $(CONFIG_SUPERPI_PROGNAME) PROGNAME = $(CONFIG_BENCHMARK_SUPERPI_PROGNAME)
PRIORITY = $(CONFIG_SUPERPI_PRIORITY) PRIORITY = $(CONFIG_BENCHMARK_SUPERPI_PRIORITY)
STACKSIZE = $(CONFIG_SUPERPI_STACKSIZE) STACKSIZE = $(CONFIG_BENCHMARK_SUPERPI_STACKSIZE)
MODULE = $(CONFIG_SUPERPI) MODULE = $(CONFIG_BENCHMARK_SUPERPI)
MAINSRC = superpi/pi_fftcs.c MAINSRC = superpi/pi_fftcs.c
$(SUPERPI_ZIP): $(SUPERPI_ZIP):