stress: bump to version 1.0.7 20443/head
authorAlexandru Ardelean <alex@shruggie.ro>
Sat, 4 Feb 2023 15:58:53 +0000 (17:58 +0200)
committerAlexandru Ardelean <alex@shruggie.ro>
Mon, 6 Feb 2023 11:19:10 +0000 (13:19 +0200)
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
utils/stress/Makefile
utils/stress/patches/010-usleep.patch

index 953b21cd557978753b60bdfa0f2e7e4b6fc303ec..8e13158e5be5dd5039a17011a9f3f79e53414a0f 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=stress
+PKG_VERSION:=1.0.7
 PKG_RELEASE:=1
 
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=1.0.5
-PKG_SOURCE_URL:=https://github.com/resurrecting-open-source-projects/stress
-PKG_MIRROR_HASH:=711e42ead6fd220a98821aae0cf024930785e439d3d0d50663fed1b2cd021bd1
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://github.com/resurrecting-open-source-projects/stress/releases/download/${PKG_VERSION}/
+PKG_HASH:=e63adb57597e617c14ecb0d841b5d990460796d9e9ec69bd56fe645ef02eb239
 
 PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
 PKG_LICENSE:=GPL-2.0-only
index fde51cf858d3f4cbbc6fab87b1c1113bbb3a286a..02a2201848e1ce3e4fd2fc62014b6f023e4656f8 100644 (file)
@@ -1,46 +1,51 @@
 --- a/src/stress.c
 +++ b/src/stress.c
-@@ -263,6 +263,7 @@ main (int argc, char **argv)
+@@ -266,9 +266,12 @@ main (int argc, char **argv)
+     while ((forks = (do_cpu + do_io + do_vm + do_hdd)))
+     {
+         long long backoff, timeout = 0;
++        struct timespec b;
  
-       /* Calculate the backoff value so we get good fork throughput.  */
-       backoff = do_backoff * forks;
-+      struct timespec b = {backoff / 1000000, (backoff % 1000000) * 1000};
-       dbg (stdout, "using backoff sleep of %llius\n", backoff);
+         /* Calculate the backoff value so we get good fork throughput.  */
+         backoff = do_backoff * forks;
++        b.tv_sec = backoff / 1000000;
++        b.tv_nsec = (backoff % 1000000) * 1000;
+         dbg (stdout, "using backoff sleep of %llius\n", backoff);
  
-       /* If we are supposed to respect a timeout, calculate it.  */
-@@ -297,7 +298,7 @@ main (int argc, char **argv)
-             {
+         /* If we are supposed to respect a timeout, calculate it.  */
+@@ -304,7 +307,7 @@ main (int argc, char **argv)
              case 0:            /* child */
-               alarm (timeout);
--              usleep (backoff);
-+              nanosleep(&b, NULL);
-               if (do_dryrun)
-                 exit (0);
-               exit (hogcpu ());
-@@ -318,7 +319,7 @@ main (int argc, char **argv)
-             {
+                 worker_init();
+                 alarm (timeout);
+-                usleep (backoff);
++                nanosleep (&b, NULL);
+                 if (do_dryrun)
+                     exit (0);
+                 exit (hogcpu ());
+@@ -326,7 +329,7 @@ main (int argc, char **argv)
              case 0:            /* child */
-               alarm (timeout);
--              usleep (backoff);
-+              nanosleep(&b,&b);
-               if (do_dryrun)
-                 exit (0);
-               exit (hogio ());
-@@ -338,7 +339,7 @@ main (int argc, char **argv)
-             {
+                 worker_init();
+                 alarm (timeout);
+-                usleep (backoff);
++                nanosleep (&b, NULL);
+                 if (do_dryrun)
+                     exit (0);
+                 exit (hogio ());
+@@ -347,7 +350,7 @@ main (int argc, char **argv)
              case 0:            /* child */
-               alarm (timeout);
--              usleep (backoff);
-+              nanosleep(&b, &b);
-               if (do_dryrun)
-                 exit (0);
-               exit (hogvm
-@@ -359,7 +360,7 @@ main (int argc, char **argv)
-             {
+                 worker_init();
+                 alarm (timeout);
+-                usleep (backoff);
++                nanosleep (&b, NULL);
+                 if (do_dryrun)
+                     exit (0);
+                 exit (hogvm (do_vm_bytes, do_vm_stride, do_vm_hang, do_vm_keep));
+@@ -368,7 +371,7 @@ main (int argc, char **argv)
              case 0:            /* child */
-               alarm (timeout);
--              usleep (backoff);
-+              nanosleep(&b, &b);
-               if (do_dryrun)
-                 exit (0);
-               exit (hoghdd (do_hdd_bytes));
+                 worker_init();
+                 alarm (timeout);
+-                usleep (backoff);
++                nanosleep (&b, NULL);
+                 if (do_dryrun)
+                     exit (0);
+                 exit (hoghdd (do_hdd_bytes));