stress-ng: add
authorRosen Penev <redacted>
Thu, 13 Aug 2020 01:45:55 +0000 (18:45 -0700)
committerRosen Penev <redacted>
Mon, 31 Aug 2020 07:20:47 +0000 (00:20 -0700)
This is a replacement for the old stress utility.

Signed-off-by: Rosen Penev <redacted>
utils/stress-ng/Makefile [new file with mode: 0644]
utils/stress-ng/patches/010-soft-float.patch [new file with mode: 0644]

diff --git a/utils/stress-ng/Makefile b/utils/stress-ng/Makefile
new file mode 100644 (file)
index 0000000..593ebd8
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=stress-ng
+PKG_VERSION:=0.11.18
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://kernel.ubuntu.com/~cking/tarballs/stress-ng
+PKG_HASH:=07c82a5c89538b5b696a79192faa70d0232352004c9e532946f7f3613d0adf23
+
+PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
+PKG_LICENSE:=GPL-2.0-only
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/stress-ng
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=stress-ng is a stress test utility
+  URL:=https://kernel.ubuntu.com/~cking/stress-ng/
+  DEPENDS:=+zlib
+endef
+
+define Package/stress-ng/description
+stress-ng will stress test a computer system in various selectable ways. It
+was designed to exercise various physical subsystems of a computer as well as
+the various operating system kernel interfaces.
+endef
+
+define Package/stress-ng/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/stress-ng $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,stress-ng))
diff --git a/utils/stress-ng/patches/010-soft-float.patch b/utils/stress-ng/patches/010-soft-float.patch
new file mode 100644 (file)
index 0000000..ef8a95a
--- /dev/null
@@ -0,0 +1,70 @@
+--- a/stress-fp-error.c
++++ b/stress-fp-error.c
+@@ -109,42 +109,43 @@ static int stress_fp_error(const stress_args_t *args)
+       do {
+               volatile double d1, d2;
+-#if defined(EDOM)
++#if defined(EDOM) && defined(FE_INVALID)
+               stress_fp_clear_error();
+               stress_fp_check(args, "log(-1.0)", log(-1.0), NAN,
+                       true, false, EDOM, FE_INVALID);
+ #endif
+-#if defined(ERANGE)
++#if defined(ERANGE) && defined(FE_DIVBYZERO)
+               stress_fp_clear_error();
+               stress_fp_check(args, "log(0.0)", log(0.0), -HUGE_VAL,
+                       false, false, ERANGE, FE_DIVBYZERO);
+ #endif
+-#if defined(EDOM)
++#if defined(EDOM) && defined(FE_INVALID)
+               stress_fp_clear_error();
+               stress_fp_check(args, "log2(-1.0)", log2(-1.0), NAN,
+                       true, false, EDOM, FE_INVALID);
+ #endif
+-#if defined(ERANGE)
++#if defined(ERANGE) && defined(FE_DIVBYZERO)
+               stress_fp_clear_error();
+               stress_fp_check(args, "log2(0.0)", log2(0.0), -HUGE_VAL,
+                       false, false, ERANGE, FE_DIVBYZERO);
+ #endif
+-#if defined(EDOM)
++#if defined(EDOM) && defined(FE_INVALID)
+               stress_fp_clear_error();
+               stress_fp_check(args, "sqrt(-1.0)", sqrt(-1.0), NAN,
+                       true, false, EDOM, FE_INVALID);
+ #endif
+-#if defined(EDOM)
++#if defined(EDOM) && defined(FE_INVALID)
+               stress_fp_clear_error();
+               stress_fp_check(args, "sqrt(-1.0)", sqrt(-1.0), NAN,
+                       true, false, EDOM, FE_INVALID);
+ #endif
++#if defined(FE_INEXACT)
+               /*
+                * Use volatiles to force compiler to generate code
+                * to perform run time computation of 1.0 / M_PI
+@@ -165,14 +166,15 @@ static int stress_fp_error(const stress_args_t *args)
+               stress_fp_check(args, "DBL_MAX + DBL_MAX / 2.0",
+                       DBL_MAX + DBL_MAX / 2.0, INFINITY,
+                       false, true, 0, FE_OVERFLOW | FE_INEXACT);
++#endif
+-#if defined(ERANGE)
++#if defined(ERANGE) && defined(FE_UNDERFLOW)
+               stress_fp_clear_error();
+               stress_fp_check(args, "exp(-1000000.0)", exp(-1000000.0), 0.0,
+                       false, false, ERANGE, FE_UNDERFLOW);
+ #endif
+-#if defined(ERANGE)
++#if defined(ERANGE) && defined(FE_OVERFLOW)
+               stress_fp_clear_error();
+               stress_fp_check(args, "exp(DBL_MAX)", exp(DBL_MAX), HUGE_VAL,
+                       false, false, ERANGE, FE_OVERFLOW);
git clone https://git.99rst.org/PROJECT