From 909ab76eaef8f734bb215828e687bf13c1e6fb2a Mon Sep 17 00:00:00 2001 From: guohao15 Date: Fri, 3 Nov 2023 14:53:08 +0800 Subject: [PATCH] app:port stressapptest to nuttx stressapptest is a userspace test, primarily composed of threads doing memory copies and directIO disk read/write. It allocates a large block of memory (typically 85% of the total memory on the machine), and each thread will choose randomized blocks of memory to copy, or to write to disk. Typically there are two threads per processor, and two threads for each disk. Result checking is done as the test proceeds by CRCing the data as it is copied. https://github.com/stressapptest/stressapptest Signed-off-by: guohao15 --- testing/stressapptest/Kconfig | 27 ++++++++++++++++++++++ testing/stressapptest/Make.defs | 23 ++++++++++++++++++ testing/stressapptest/Makefile | 41 +++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 testing/stressapptest/Kconfig create mode 100644 testing/stressapptest/Make.defs create mode 100644 testing/stressapptest/Makefile diff --git a/testing/stressapptest/Kconfig b/testing/stressapptest/Kconfig new file mode 100644 index 000000000..91f59eba1 --- /dev/null +++ b/testing/stressapptest/Kconfig @@ -0,0 +1,27 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config TESTING_STRESSAPPTEST + bool "stressapptest" + default n + help + stressapptest is a userspace memory and CPU stress test tool. It + exercises the memory and CPU subsystem stressing for cache misses, + TLB misses, memory allocation, memory freeing, etc. It has been + used to find hardware bugs, test operating system reliability, and + test system stability. + http://people.redhat.com/~fche/stressapptest/ + +if TESTING_STRESSAPPTEST + +config TESTING_STRESSAPPTEST_PRIORITY + int "Priority of stressapptest process" + default 100 + +config TESTING_STRESSAPPTEST_STACKSIZE + int "Stack size of stressapptest process" + default 8192 + +endif diff --git a/testing/stressapptest/Make.defs b/testing/stressapptest/Make.defs new file mode 100644 index 000000000..c00a1e89e --- /dev/null +++ b/testing/stressapptest/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/testing/stressapptest/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_TESTING_STRESSAPPTEST),) +CONFIGURED_APPS += $(APPDIR)/testing/stressapptest +endif diff --git a/testing/stressapptest/Makefile b/testing/stressapptest/Makefile new file mode 100644 index 000000000..38c962d14 --- /dev/null +++ b/testing/stressapptest/Makefile @@ -0,0 +1,41 @@ +############################################################################ +# apps/testing/stressapptest/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +VPATH += stressapptest +VPATH += stressapptest/src +DEPPATH += --dep-path stressapptest +DEPPATH += --dep-path stressapptest/src + +CXXEXT := .cc +CXXFLAGS += -DHAVE_CONFIG_H -fpermissive + +CXXSRCS += adler32memcpy.cc disk_blocks.cc error_diag.cc finelock_queue.cc logger.cc +CXXSRCS += os.cc os_factory.cc pattern.cc queue.cc sat.cc sat_factory.cc worker.cc + +MAINSRC += main.cc +PROGNAME += stressapptest + +PRIORITY = $(CONFIG_TESTING_STRESSAPPTEST_PRIORITY) +STACKSIZE = $(CONFIG_TESTING_STRESSAPPTEST_STACKSIZE) +MODULE = $(CONFIG_TESTING_STRESSAPPTEST) + +include $(APPDIR)/Application.mk