Browse Source

Merge pull request #13257 from neheb/stng

stress-ng: add
lilik-openwrt-22.03
Rosen Penev 4 years ago
committed by GitHub
parent
commit
70c5cee124
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 114 additions and 0 deletions
  1. +44
    -0
      utils/stress-ng/Makefile
  2. +70
    -0
      utils/stress-ng/patches/010-soft-float.patch

+ 44
- 0
utils/stress-ng/Makefile View File

@ -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))

+ 70
- 0
utils/stress-ng/patches/010-soft-float.patch View File

@ -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);

Loading…
Cancel
Save