Hello community,
here is the log from the commit of package stress-ng for openSUSE:Factory checked in at 2018-01-01 22:36:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/stress-ng (Old)
and /work/SRC/openSUSE:Factory/.stress-ng.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "stress-ng"
Mon Jan 1 22:36:06 2018 rev:25 rq:560979 version:0.09.08
Changes:
--------
--- /work/SRC/openSUSE:Factory/stress-ng/stress-ng.changes 2017-12-19 10:58:14.594057817 +0100
+++ /work/SRC/openSUSE:Factory/.stress-ng.new/stress-ng.changes 2018-01-01 22:36:23.196836697 +0100
@@ -1,0 +2,22 @@
+Mon Jan 1 10:41:32 UTC 2018 - mardnh@gmx.de
+
+- Update to version 0.09.08
+ * Makefile: bump version
+ * Makefile.config: remove need for LIBBSD for wchar.h path detection
+ * stress-rawdev: fix linking failure on non linux systems
+ * Add wchar.h and bsd/wchar.h path detection, makes stress-ng.h cleaner
+ * Add rawdev raw device read stressor
+ * stress-vecmath: use uint128_put for 128 bit integer
+ * Move ALIGNED and SECTION macros to stress-ng.h
+ * Add OPTIMIZE0 level zero optimization hint macro
+ * stress-socket-diag: remove some consts, cleans up clang warnings
+ * Use the FORMAT macro for some printf style functions
+ * stress-vm: fix warning when building with PEDANTIC=1
+ * stress-tlb-shootdown: fix unterminated comment
+ * stress-timer: fix warning when building with PEDANTIC=1
+ * stress-itimer: fix warning when building with PEDANTIC=1
+ * stress-funccall: clean up warnings when building with PEDANTIC=1
+ * stress-physpage: only close an opened fd_pc file descriptor
+ * stress-tlb: fix incorrect affinity on cores
+
+-------------------------------------------------------------------
Old:
----
stress-ng-0.09.07.tar.xz
New:
----
stress-ng-0.09.08.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ stress-ng.spec ++++++
--- /var/tmp/diff_new_pack.pekXTd/_old 2018-01-01 22:36:24.620361421 +0100
+++ /var/tmp/diff_new_pack.pekXTd/_new 2018-01-01 22:36:24.624360086 +0100
@@ -1,7 +1,7 @@
#
# spec file for package stress-ng
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2015, Martin Hauke
#
# All modifications and additions to the file contributed by third parties
@@ -18,7 +18,7 @@
Name: stress-ng
-Version: 0.09.07
+Version: 0.09.08
Release: 0
Summary: Tool to load and stress a computer
License: GPL-2.0
++++++ stress-ng-0.09.07.tar.xz -> stress-ng-0.09.08.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/Makefile new/stress-ng-0.09.08/Makefile
--- old/stress-ng-0.09.07/Makefile 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/Makefile 2017-12-31 18:18:59.000000000 +0100
@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-VERSION=0.09.07
+VERSION=0.09.08
#
# Codename "portable pressure producer"
#
@@ -168,6 +168,7 @@
stress-quota.c \
stress-qsort.c \
stress-radixsort.c \
+ stress-rawdev.c \
stress-rdrand.c \
stress-readahead.c \
stress-remap-file-pages.c \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/Makefile.config new/stress-ng-0.09.08/Makefile.config
--- old/stress-ng-0.09.07/Makefile.config 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/Makefile.config 2017-12-31 18:18:59.000000000 +0100
@@ -75,6 +75,22 @@
endif
endif
+ifndef $(HAVE_BSD_WCHAR)
+HAVE_BSD_WCHAR = $(shell $(MAKE) -f Makefile.config --no-print-directory $(HAVE_NOT) have_bsd_wchar)
+ifeq ($(HAVE_BSD_WCHAR),1)
+ CONFIG_CFLAGS += -DHAVE_BSD_WCHAR
+$(info autoconfig: using bsd/wchar.h)
+endif
+endif
+
+ifndef $(HAVE_WCHAR)
+HAVE_WCHAR = $(shell $(MAKE) -f Makefile.config --no-print-directory $(HAVE_NOT) have_wchar)
+ifeq ($(HAVE_WCHAR),1)
+ CONFIG_CFLAGS += -DHAVE_WCHAR
+$(info autoconfig: using wchar.h)
+endif
+endif
+
ifndef $(HAVE_LIB_Z)
HAVE_LIB_Z = $(shell $(MAKE) -f Makefile.config --no-print-directory $(HAVE_NOT) have_lib_z)
ifeq ($(HAVE_LIB_Z),1)
@@ -792,6 +808,32 @@
@rm -f $(DIR)/test-libbsd
#
+# check if we can include bsd/wchar.h
+#
+.PHONY: have_bsd_wchar
+have_bsd_wchar: $(DIR)/test-bsd-wchar.c
+ @$(CC) $(CFLAGS) $(CPPFLAGS) $(DIR)/test-bsd-wchar.c -o $(DIR)/test-bsd-wchar 2> /dev/null || true
+ @if [ -f $(DIR)/test-bsd-wchar ]; then \
+ echo 1 ;\
+ else \
+ echo 0 ;\
+ fi
+ @rm -f $(DIR)/test-bsd-wchar
+
+#
+# check if we can include wchar.h
+#
+.PHONY: have_wchar
+have_wchar: $(DIR)/test-wchar.c
+ @$(CC) $(CFLAGS) $(CPPFLAGS) $(DIR)/test-wchar.c -o $(DIR)/test-wchar 2> /dev/null || true
+ @if [ -f $(DIR)/test-wchar ]; then \
+ echo 1 ;\
+ else \
+ echo 0 ;\
+ fi
+ @rm -f $(DIR)/test-wchar
+
+#
# check if we can build against libz
#
.PHONY: have_lib_z
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/log.c new/stress-ng-0.09.08/log.c
--- old/stress-ng-0.09.07/log.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/log.c 2017-12-31 18:18:59.000000000 +0100
@@ -144,6 +144,8 @@
* __pr_msg_fail()
* wrapper helper for pr_msg_fail
*/
+static inline void __pr_msg_fail(const uint64_t flag, char *fmt, ...) FORMAT(printf, 2, 0);
+
static inline void __pr_msg_fail(const uint64_t flag, char *fmt, ...)
{
va_list ap;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-cpu.c new/stress-ng-0.09.08/stress-cpu.c
--- old/stress-ng-0.09.07/stress-cpu.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-cpu.c 2017-12-31 18:18:59.000000000 +0100
@@ -154,17 +154,10 @@
}
/*
- * We need to stop gcc optimising out the loop additions.. sigh
- */
-#if __GNUC__ && NEED_GNUC(4, 4, 0) && !defined(__clang__)
-static void stress_cpu_loop(const char *) __attribute__((optimize("-O0")));
-#endif
-
-/*
* stress_cpu_loop()
* simple CPU busy loop
*/
-static void stress_cpu_loop(const char *name)
+static void OPTIMIZE0 stress_cpu_loop(const char *name)
{
uint32_t i, i_sum = 0;
const uint32_t sum = 134209536UL;
@@ -1283,13 +1276,6 @@
}
/*
- * Undocumented gcc-ism, force -O0 optimisation
- */
-#if __GNUC__ && NEED_GNUC(4, 4, 0) && !defined(__clang__)
-static void stress_cpu_jmp(const char *name) __attribute__((optimize("-O0")));
-#endif
-
-/*
* This could be a ternary operator, v = (v op val) ? a : b
* but it may be optimised down, so force a compare and jmp
* with -O0 and a if/else construct
@@ -1305,7 +1291,7 @@
* stress_cpu_jmp
* jmp conditionals
*/
-static void HOT stress_cpu_jmp(const char *name)
+static void HOT OPTIMIZE0 stress_cpu_jmp(const char *name)
{
register int i, next = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-funccall.c new/stress-ng-0.09.08/stress-funccall.c
--- old/stress-ng-0.09.07/stress-funccall.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-funccall.c 2017-12-31 18:19:00.000000000 +0100
@@ -43,14 +43,21 @@
typedef long double long_double_t;
#define stress_funccall_1(type) \
-extern void stress_funccall_ ## type ## _1( \
+void NOINLINE stress_funccall_ ## type ## _1( \
+ const type a); \
+ \
+void NOINLINE stress_funccall_ ## type ## _1( \
const type a) \
{ \
type ## _put(a); \
} \
#define stress_funccall_2(type) \
-extern void stress_funccall_ ## type ## _2( \
+void NOINLINE stress_funccall_ ## type ## _2( \
+ const type a, \
+ const type b); \
+ \
+void NOINLINE stress_funccall_ ## type ## _2( \
const type a, \
const type b) \
{ \
@@ -59,7 +66,12 @@
} \
#define stress_funccall_3(type) \
-extern void stress_funccall_ ## type ## _3( \
+void NOINLINE stress_funccall_ ## type ## _3( \
+ const type a, \
+ const type b, \
+ const type c); \
+ \
+void NOINLINE stress_funccall_ ## type ## _3( \
const type a, \
const type b, \
const type c) \
@@ -70,7 +82,13 @@
} \
#define stress_funccall_4(type) \
-extern void stress_funccall_ ## type ## _4( \
+void NOINLINE stress_funccall_ ## type ## _4( \
+ const type a, \
+ const type b, \
+ const type c, \
+ const type d); \
+ \
+void NOINLINE stress_funccall_ ## type ## _4( \
const type a, \
const type b, \
const type c, \
@@ -83,7 +101,14 @@
} \
#define stress_funccall_5(type) \
-extern void stress_funccall_ ## type ## _5( \
+void NOINLINE stress_funccall_ ## type ## _5( \
+ const type a, \
+ const type b, \
+ const type c, \
+ const type d, \
+ const type e); \
+ \
+void NOINLINE stress_funccall_ ## type ## _5( \
const type a, \
const type b, \
const type c, \
@@ -98,7 +123,15 @@
} \
#define stress_funccall_6(type) \
-extern void stress_funccall_ ## type ## _6( \
+void NOINLINE stress_funccall_ ## type ## _6( \
+ const type a, \
+ const type b, \
+ const type c, \
+ const type d, \
+ const type e, \
+ const type f); \
+ \
+void NOINLINE stress_funccall_ ## type ## _6( \
const type a, \
const type b, \
const type c, \
@@ -115,7 +148,16 @@
} \
#define stress_funccall_7(type) \
-extern void stress_funccall_ ## type ## _7( \
+void NOINLINE stress_funccall_ ## type ## _7( \
+ const type a, \
+ const type b, \
+ const type c, \
+ const type d, \
+ const type e, \
+ const type f, \
+ const type g); \
+ \
+void NOINLINE stress_funccall_ ## type ## _7( \
const type a, \
const type b, \
const type c, \
@@ -134,7 +176,17 @@
} \
#define stress_funccall_8(type) \
-extern void stress_funccall_ ## type ## _8( \
+void NOINLINE stress_funccall_ ## type ## _8( \
+ const type a, \
+ const type b, \
+ const type c, \
+ const type d, \
+ const type e, \
+ const type f, \
+ const type g, \
+ const type h); \
+ \
+void NOINLINE stress_funccall_ ## type ## _8( \
const type a, \
const type b, \
const type c, \
@@ -155,7 +207,18 @@
} \
#define stress_funccall_9(type) \
-extern void stress_funccall_ ## type ## _9( \
+void NOINLINE stress_funccall_ ## type ## _9( \
+ const type a, \
+ const type b, \
+ const type c, \
+ const type d, \
+ const type e, \
+ const type f, \
+ const type g, \
+ const type h, \
+ const type i); \
+ \
+void NOINLINE stress_funccall_ ## type ## _9( \
const type a, \
const type b, \
const type c, \
@@ -260,7 +323,7 @@
stress_funccall_9(long_double_t)
#define stress_funcall_type(type, rndfunc) \
-static void stress_funccall_ ## type(const args_t *args) \
+static void NOINLINE stress_funccall_ ## type(const args_t *args)\
{ \
register int ii; \
type a, b, c, d, e, f, g, h, i; \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-icache.c new/stress-ng-0.09.08/stress-icache.c
--- old/stress-ng-0.09.07/stress-icache.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-icache.c 2017-12-31 18:19:00.000000000 +0100
@@ -34,11 +34,6 @@
#define SIZE_16K (16 * SIZE_1K)
#define SIZE_64K (64 * SIZE_1K)
-#if defined(__GNUC__) && NEED_GNUC(4,6,0)
-#define SECTION(s) __attribute__((__section__(# s)))
-#define ALIGNED(a) __attribute__((aligned(a)))
-#endif
-
/*
* STRESS_ICACHE_FUNC()
* generates a simple function that is page aligned in its own
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-itimer.c new/stress-ng-0.09.08/stress-itimer.c
--- old/stress-ng-0.09.07/stress-itimer.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-itimer.c 2017-12-31 18:19:00.000000000 +0100
@@ -73,7 +73,7 @@
* stress_itimer_keep_stressing()
* returns true if we can keep on running a stressor
*/
-bool HOT OPTIMIZE3 stress_itimer_keep_stressing(void)
+static bool HOT OPTIMIZE3 stress_itimer_keep_stressing(void)
{
return (LIKELY(g_keep_stressing_flag) &&
LIKELY(!max_ops || (itimer_counter < max_ops)));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-ng.1 new/stress-ng-0.09.08/stress-ng.1
--- old/stress-ng-0.09.07/stress-ng.1 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-ng.1 2017-12-31 18:19:00.000000000 +0100
@@ -2284,6 +2284,47 @@
.B \-\-radixsort\-size N
specify number of strings to sort, default is 262144 (256 \(mu 1024).
.TP
+.B \-\-rawdev N
+start N workers that read the underlying raw drive device using direct
+IO reads. The device (with minor number 0) that stores the current working
+directory is the raw device to be read by the stressor. The read size is
+exactly the size of the underlying device block size. By default, this
+stressor will exercise all the of the rawdev methods (see the
+\-\-rawdev\-method option). This is a Linux only stressor and requires
+root privilege to be able to read the raw device.
+.TP
+.B \-\-rawdev\-ops N
+stop the rawdev stress workers after N raw device read bogo operations.
+.TP
+.B \-\-rawdev\-method M
+Available rawdev stress methods are described as follows:
+.TS
+expand;
+lBw(10n)2 lBw(\n[SZ]n)
+l l.
+Method Description
+all T{
+iterate over all the rawdev stress methods as listed below:
+T}
+sweep T{
+repeatedy read across the raw device from the 0th block to the end block in steps
+of the number of blocks on the device / 128 and back to the start again.
+T}
+wiggle T{
+repeatedy read across the raw device in 128 evenly steps with each step reading
+1024 blocks backwards from each step.
+ends T{
+repeatedy read the first and last 128 start and end blocks of the raw device
+alternating from start of the device to the end of the device.
+T}
+random T{
+repeatedy read 256 random blocks
+T}
+burst T{
+repeatedly read 256 sequential blocks starting from a random block on the raw device.
+T}
+.TE
+.TP
.B \-\-rdrand N
start N workers that read the Intel hardware random number generator (Intel
Ivybridge processors upwards).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-ng.c new/stress-ng-0.09.08/stress-ng.c
--- old/stress-ng-0.09.07/stress-ng.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-ng.c 2017-12-31 18:19:00.000000000 +0100
@@ -97,6 +97,7 @@
{ STRESS_IOPORT, stress_ioport_supported },
{ STRESS_NETLINK_PROC, stress_netlink_proc_supported },
{ STRESS_PHYSPAGE, stress_physpage_supported },
+ { STRESS_RAWDEV, stress_rawdev_supported },
{ STRESS_RDRAND, stress_rdrand_supported },
{ STRESS_SOFTLOCKUP, stress_softlockup_supported },
{ STRESS_SWAP, stress_swap_supported },
@@ -326,6 +327,7 @@
STRESSOR(qsort, QSORT, CLASS_CPU_CACHE | CLASS_CPU | CLASS_MEMORY),
STRESSOR(quota, QUOTA, CLASS_OS),
STRESSOR(radixsort, RADIXSORT, CLASS_CPU_CACHE | CLASS_CPU | CLASS_MEMORY),
+ STRESSOR(rawdev, RAWDEV, CLASS_IO),
STRESSOR(rdrand, RDRAND, CLASS_CPU),
STRESSOR(readahead, READAHEAD, CLASS_IO | CLASS_OS),
STRESSOR(remap, REMAP_FILE_PAGES, CLASS_MEMORY | CLASS_OS),
@@ -765,6 +767,9 @@
{ "radixsort", 1, 0, OPT_RADIXSORT },
{ "radixsort-ops",1, 0, OPT_RADIXSORT_OPS },
{ "radixsort-size",1, 0, OPT_RADIXSORT_SIZE },
+ { "rawdev", 1, 0, OPT_RAWDEV },
+ { "rawdev-ops",1, 0, OPT_RAWDEV_OPS },
+ { "rawdev-method",1, 0, OPT_RAWDEV_METHOD },
{ "random", 1, 0, OPT_RANDOM },
{ "rdrand", 1, 0, OPT_RDRAND },
{ "rdrand-ops", 1, 0, OPT_RDRAND_OPS },
@@ -1346,6 +1351,9 @@
{ NULL, "radixsort N", "start N workers radix sorting random strings" },
{ NULL, "radixsort-ops N", "stop after N radixsort bogo operations" },
{ NULL, "radixsort-size N", "number of strings to sort" },
+ { NULL, "rawdev N", "start N workers that read a raw device" },
+ { NULL, "rawdev-ops N", "stop after N rawdev read operations" },
+ { NULL, "rawdev-method M", "specify the rawdev reead method to use" },
{ NULL, "rdrand N", "start N workers exercising rdrand (x86 only)" },
{ NULL, "rdrand-ops N", "stop after N rdrand bogo operations" },
{ NULL, "readahead N", "start N workers exercising file readahead" },
@@ -3260,6 +3268,10 @@
stress_get_processors(&i32);
set_setting("random", TYPE_ID_INT32, &i32);
break;
+ case OPT_RAWDEV_METHOD:
+ if (stress_set_rawdev_method(optarg) < 0)
+ return EXIT_FAILURE;
+ break;
case OPT_READAHEAD_BYTES:
stress_set_readahead_bytes(optarg);
break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-ng.h new/stress-ng-0.09.08/stress-ng.h
--- old/stress-ng-0.09.07/stress-ng.h 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-ng.h 2017-12-31 18:19:00.000000000 +0100
@@ -59,13 +59,19 @@
#include
#endif
+#if defined(HAVE_BSD_WCHAR)
+#include
+#endif
+#if defined(HAVE_WCHAR)
+#include
+#endif
+
#if defined(HAVE_LIB_BSD)
#if defined(__APPLE__) || \
defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__NetBSD__) || \
defined(__OpenBSD__)
-#include
#if !defined(__APPLE__)
#include
#endif
@@ -73,10 +79,6 @@
#include
#include
#include
-#if !defined(__FreeBSD_kernel__)
-/* GNU/kFreeBSD does not support this */
-#include
-#endif
#endif
#endif
@@ -455,6 +457,13 @@
#define OPTIMIZE1
#endif
+/* -O0 attribute support */
+#if defined(__GNUC__) && !defined(__clang__) && NEED_GNUC(4,6,0)
+#define OPTIMIZE0 __attribute__((optimize("-O0")))
+#else
+#define OPTIMIZE0
+#endif
+
/* warn unused attribute */
#if defined(__GNUC__) && NEED_GNUC(4,2,0)
#define WARN_UNUSED __attribute__((warn_unused_result))
@@ -462,20 +471,28 @@
#define WARN_UNUSED
#endif
+#if defined(__GNUC__) && NEED_GNUC(3,3,0)
+#define ALIGNED(a) __attribute__((aligned(a)))
+#endif
+
/* Force aligment to nearest 128 bytes */
#if defined(__GNUC__) && NEED_GNUC(3,3,0) && defined(HAVE_ALIGNED_128)
-#define ALIGN128 __attribute__ ((aligned(128)))
+#define ALIGN128 ALIGNED(128)
#else
#define ALIGN128
#endif
/* Force aligment to nearest 64 bytes */
#if defined(__GNUC__) && NEED_GNUC(3,3,0) && defined(HAVE_ALIGNED_64)
-#define ALIGN64 __attribute__ ((aligned(64)))
+#define ALIGN64 ALIGNED(64)
#else
#define ALIGN64
#endif
+#if defined(__GNUC__) && NEED_GNUC(4,6,0)
+#define SECTION(s) __attribute__((__section__(# s)))
+#endif
+
/* Choose cacheline alignment */
#if defined(ALIGN128)
#define ALIGN_CACHELINE ALIGN128
@@ -534,9 +551,9 @@
/* Logging helpers */
extern int pr_msg(FILE *fp, const uint64_t flag,
- const char *const fmt, va_list va);
+ const char *const fmt, va_list va) FORMAT(printf, 3, 0);
extern void pr_msg_fail(const uint64_t flag, const char *name, const char *what, const int err);
-extern int pr_yaml(FILE *fp, const char *const fmt, ...) __attribute__((format(printf, 2, 3)));
+extern int pr_yaml(FILE *fp, const char *const fmt, ...) FORMAT(printf, 2, 3);
extern void pr_yaml_runinfo(FILE *fp);
extern void pr_openlog(const char *filename);
extern void pr_closelog(void);
@@ -1294,6 +1311,7 @@
STRESS_QSORT,
STRESS_QUOTA,
STRESS_RADIXSORT,
+ STRESS_RAWDEV,
STRESS_RDRAND,
STRESS_READAHEAD,
STRESS_REMAP_FILE_PAGES,
@@ -1863,6 +1881,10 @@
OPT_RADIXSORT_OPS,
OPT_RADIXSORT_SIZE,
+ OPT_RAWDEV,
+ OPT_RAWDEV_METHOD,
+ OPT_RAWDEV_OPS,
+
OPT_RDRAND,
OPT_RDRAND_OPS,
@@ -2563,6 +2585,7 @@
extern int stress_ioport_supported(void);
extern int stress_netlink_proc_supported(void);
extern int stress_physpage_supported(void);
+extern int stress_rawdev_supported(void);
extern int stress_rdrand_supported(void);
extern int stress_softlockup_supported(void);
extern int stress_swap_supported(void);
@@ -2637,6 +2660,7 @@
extern void stress_set_pty_max(const char *opt);
extern void stress_set_qsort_size(const char *opt);
extern void stress_set_radixsort_size(const char *opt);
+extern int stress_set_rawdev_method(const char *name);
extern void stress_set_readahead_bytes(const char *opt);
extern int stress_set_sctp_domain(const char *opt);
extern void stress_set_sctp_port(const char *opt);
@@ -2949,6 +2973,7 @@
STRESS(stress_qsort);
STRESS(stress_quota);
STRESS(stress_radixsort);
+STRESS(stress_rawdev);
STRESS(stress_rdrand);
STRESS(stress_readahead);
STRESS(stress_remap);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-physpage.c new/stress-ng-0.09.08/stress-physpage.c
--- old/stress-ng-0.09.07/stress-physpage.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-physpage.c 2017-12-31 18:19:00.000000000 +0100
@@ -148,8 +148,9 @@
inc_counter(args);
} while (keep_stressing());
+ if (fd_pc > 0)
+ (void)close(fd_pc);
(void)close(fd_pm);
- (void)close(fd_pc);
return EXIT_SUCCESS;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-rawdev.c new/stress-ng-0.09.08/stress-rawdev.c
--- old/stress-ng-0.09.07/stress-rawdev.c 1970-01-01 01:00:00.000000000 +0100
+++ new/stress-ng-0.09.08/stress-rawdev.c 2017-12-31 18:19:00.000000000 +0100
@@ -0,0 +1,383 @@
+/*
+ * Copyright (C) 2013-2017 Canonical, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * This code is a complete clean re-write of the stress tool by
+ * Colin Ian King and attempts to be
+ * backwardly compatible with the stress tool by Amos Waterland
+ * but has more stress tests and more
+ * functionality.
+ *
+ */
+#include "stress-ng.h"
+
+#if defined(__linux__)
+#include
+#include
+#include
+#endif
+
+typedef void (*rawdev_func)(const args_t *args, const int fd,
+ unsigned long blks, unsigned long blksz);
+
+typedef struct {
+ const char *name;
+ const rawdev_func func;
+} stress_rawdev_method_info_t;
+
+/*
+ * stress_rawdev_supported()
+ * check if we can run this as root
+ */
+int stress_rawdev_supported(void)
+{
+ if (geteuid() != 0) {
+ pr_inf("rawdev flood stressor will be skipped, "
+ "need to be running as root for this stressor\n");
+ return -1;
+ }
+ return 0;
+}
+
+#if defined(__linux__)
+char *stress_rawdev_path(const dev_t dev)
+{
+ static char path[PATH_MAX];
+ DIR *dir;
+ struct dirent *d;
+ const dev_t majdev = makedev(major(dev), 0);
+
+ dir = opendir("/dev");
+ if (!dir)
+ return NULL;
+
+ while ((d = readdir(dir)) != NULL) {
+ int ret;
+ struct stat stat_buf;
+
+ snprintf(path, sizeof(path), "/dev/%s", d->d_name);
+ ret = stat(path, &stat_buf);
+ if ((ret == 0) &&
+ (S_ISBLK(stat_buf.st_mode)) &&
+ (stat_buf.st_rdev == majdev)) {
+ (void)closedir(dir);
+ return path;
+ }
+ }
+ (void)closedir(dir);
+
+ return NULL;
+}
+
+void stress_rawdev_sweep(
+ const args_t *args,
+ const int fd,
+ unsigned long blks,
+ unsigned long blksz)
+{
+ unsigned long i;
+ int ret;
+ char buf[blksz << 1];
+ char *aligned = align_address(buf, blksz);
+ off_t offset;
+
+ for (i = 0; i < blks && keep_stressing(); i += blks >> 8) {
+ offset = (off_t)i * (off_t)blksz;
+ ret = pread(fd, aligned, (size_t)blksz, offset);
+ if (ret < 0) {
+ pr_err("%s: pread at %ju failed, errno=%d (%s)\n",
+ args->name, (intmax_t)offset, errno, strerror(errno));
+ }
+ inc_counter(args);
+ }
+ for (; i > 0 && keep_stressing(); i -= blks >> 8) {
+ offset = (off_t)i * (off_t)blksz;
+ ret = pread(fd, aligned, (size_t)blksz, offset);
+ if (ret < 0) {
+ pr_err("%s: pread at %ju failed, errno=%d (%s)\n",
+ args->name, (intmax_t)offset, errno, strerror(errno));
+ }
+ inc_counter(args);
+ }
+}
+
+void stress_rawdev_wiggle(
+ const args_t *args,
+ const int fd,
+ unsigned long blks,
+ unsigned long blksz)
+{
+ unsigned long i;
+ int ret;
+ char buf[blksz << 1];
+ char *aligned = align_address(buf, blksz);
+ off_t offset;
+
+ for (i = blks >> 8; i < blks && keep_stressing(); i += blks >> 8) {
+ unsigned long j;
+
+ for (j = 0; j < blks >> 8; j += blks >> 10) {
+ offset = (off_t)(i - j) * (off_t)blksz;
+ ret = pread(fd, aligned, (size_t)blksz, offset);
+ if (ret < 0) {
+ pr_err("%s: pread at %ju failed, errno=%d (%s)\n",
+ args->name, (intmax_t)offset, errno, strerror(errno));
+ }
+ inc_counter(args);
+ }
+ }
+}
+
+void stress_rawdev_ends(
+ const args_t *args,
+ const int fd,
+ unsigned long blks,
+ unsigned long blksz)
+{
+ unsigned long i;
+ int ret;
+ char buf[blksz << 1];
+ char *aligned = align_address(buf, blksz);
+ off_t offset;
+
+ for (i = 0; i < 128; i++) {
+ offset = (off_t)i * (off_t)blksz;
+ ret = pread(fd, aligned, (size_t)blksz, offset);
+ if (ret < 0) {
+ pr_err("%s: pread at %ju failed, errno=%d (%s)\n",
+ args->name, (intmax_t)offset, errno, strerror(errno));
+ }
+ inc_counter(args);
+
+ offset = (off_t)(blks - (i + 1)) * (off_t)blksz;
+ ret = pread(fd, aligned, (size_t)blksz, offset);
+ if (ret < 0) {
+ pr_err("%s: pread at %ju failed, errno=%d (%s)\n",
+ args->name, (intmax_t)offset, errno, strerror(errno));
+ }
+ inc_counter(args);
+ }
+}
+
+void stress_rawdev_random(
+ const args_t *args,
+ const int fd,
+ unsigned long blks,
+ unsigned long blksz)
+{
+ int i;
+ char buf[blksz << 1];
+ char *aligned = align_address(buf, blksz);
+
+ for (i = 0; i < 256 && keep_stressing(); i++) {
+ int ret;
+ off_t offset = (off_t)blksz * (mwc64() % blks);
+
+ ret = pread(fd, aligned, (size_t)blksz, offset);
+ if (ret < 0) {
+ pr_err("%s: pread at %ju failed, errno=%d (%s)\n",
+ args->name, (intmax_t)offset, errno, strerror(errno));
+ }
+ inc_counter(args);
+ }
+}
+
+void stress_rawdev_burst(
+ const args_t *args,
+ const int fd,
+ unsigned long blks,
+ unsigned long blksz)
+{
+ int i;
+ char buf[blksz << 1];
+ char *aligned = align_address(buf, blksz);
+ off_t blk = (mwc64() % blks);
+
+ for (i = 0; i < 256 && keep_stressing(); i++) {
+ int ret;
+ off_t offset = blk * blksz;
+
+ ret = pread(fd, aligned, (size_t)blksz, offset);
+ if (ret < 0) {
+ pr_err("%s: pread at %ju failed, errno=%d (%s)\n",
+ args->name, (intmax_t)offset, errno, strerror(errno));
+ }
+ blk++;
+ blk %= blks;
+ inc_counter(args);
+ }
+}
+
+static const stress_rawdev_method_info_t rawdev_methods[];
+
+/*
+ * stress_rawdev_all()
+ * iterate over all rawdev methods
+ */
+static void stress_rawdev_all(
+ const args_t *args,
+ const int fd,
+ unsigned long blks,
+ unsigned long blksz)
+{
+ static int i = 1; /* Skip over stress_rawdev_all */
+
+ rawdev_methods[i++].func(args, fd, blks, blksz);
+ if (!rawdev_methods[i].func)
+ i = 1;
+}
+
+
+/*
+ * rawdev methods
+ */
+static const stress_rawdev_method_info_t rawdev_methods[] = {
+ { "all", stress_rawdev_all },
+ { "sweep", stress_rawdev_sweep },
+ { "wiggle", stress_rawdev_wiggle },
+ { "ends", stress_rawdev_ends },
+ { "random", stress_rawdev_random },
+ { "burst", stress_rawdev_burst },
+ { NULL, NULL }
+};
+
+#endif
+
+#if defined(__linux__)
+/*
+ * stress_set_rawdev_method()
+ * set the default rawdev method
+ */
+int stress_set_rawdev_method(const char *name)
+{
+ stress_rawdev_method_info_t const *info;
+
+ for (info = rawdev_methods; info->func; info++) {
+ if (!strcmp(info->name, name)) {
+ set_setting("rawdev-method", TYPE_ID_UINTPTR_T, &info);
+ return 0;
+ }
+ }
+
+ (void)fprintf(stderr, "rawdev-method must be one of:");
+ for (info = rawdev_methods; info->func; info++) {
+ (void)fprintf(stderr, " %s", info->name);
+ }
+ (void)fprintf(stderr, "\n");
+
+ return -1;
+}
+#else
+/*
+ * stress_set_rawdev_method()
+ * set the default rawdev method
+ */
+int stress_set_rawdev_method(const char *name)
+{
+ fprintf(stderr, "option --rawdev-method not supported\n");
+ return -1;
+}
+#endif
+
+#if defined(__linux__)
+
+int stress_rawdev(const args_t *args)
+{
+ int ret;
+ char path[PATH_MAX], *devpath;
+ struct stat stat_buf;
+ int fd;
+ unsigned long blks = 0, blksz = 0;
+ const stress_rawdev_method_info_t *rawdev_method = &rawdev_methods[0];
+ rawdev_func func;
+
+ stress_temp_dir_args(args, path, sizeof(path));
+
+ (void)get_setting("rawdev-method", &rawdev_method);
+ func = rawdev_method->func;
+
+ fd = open(path, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+ if (fd < 0) {
+ ret = exit_status(errno);
+ pr_err("%s: open failed: %d (%s)\n",
+ args->name, errno, strerror(errno));
+ return ret;
+ }
+
+ ret = fstat(fd, &stat_buf);
+ if (ret < 0) {
+ pr_err("%s: cannot stat %s: errno=%d (%s)\n",
+ args->name, path, errno, strerror(errno));
+ (void)unlink(path);
+ (void)close(fd);
+ return EXIT_FAILURE;
+ }
+ (void)unlink(path);
+ (void)close(fd);
+
+ devpath = stress_rawdev_path(stat_buf.st_dev);
+ if (!devpath) {
+ pr_inf("%s: cannot determine raw block device\n",
+ args->name);
+ return EXIT_NO_RESOURCE;
+ }
+
+ fd = open(devpath, O_RDONLY | O_NONBLOCK);
+ if (fd < 0) {
+ pr_inf("%s: cannot open raw block device: errno=%d (%s)\n",
+ args->name, errno, strerror(errno));
+ return EXIT_NO_RESOURCE;
+ }
+ ret = ioctl(fd, BLKGETSIZE, &blks);
+ if (ret < 0) {
+ pr_inf("%s: cannot get block size: errno=%d (%s)\n",
+ args->name, errno, strerror(errno));
+ (void)close(fd);
+ return EXIT_NO_RESOURCE;
+ }
+ ret = ioctl(fd, BLKSSZGET, &blksz);
+ if (ret < 0) {
+ pr_inf("%s: cannot get block size: errno=%d (%s)\n",
+ args->name, errno, strerror(errno));
+ (void)close(fd);
+ return EXIT_NO_RESOURCE;
+ }
+ (void)close(fd);
+ fd = open(devpath, O_RDONLY | O_DIRECT);
+ if (fd < 0) {
+ pr_inf("%s: cannot open raw block device: errno=%d (%s)\n",
+ args->name, errno, strerror(errno));
+ return EXIT_NO_RESOURCE;
+ }
+
+ if (args->instance == 0)
+ pr_dbg("%s: exercising %s (%lu blocks of size %lu bytes)\n",
+ args->name, devpath, blks, blksz);
+
+ do {
+ func(args, fd, blks, blksz);
+ } while (keep_stressing());
+
+ (void)close(fd);
+
+ return EXIT_SUCCESS;
+}
+#else
+int stress_rawdev(const args_t *args)
+{
+ return stress_not_implemented(args);
+}
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-socket-diag.c new/stress-ng-0.09.08/stress-socket-diag.c
--- old/stress-ng-0.09.07/stress-socket-diag.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-socket-diag.c 2017-12-31 18:19:00.000000000 +0100
@@ -94,10 +94,10 @@
static int stress_sockdiag_parse(
const args_t *args,
- const struct unix_diag_msg *diag,
+ struct unix_diag_msg *diag,
unsigned int len)
{
- const struct rtattr *attr;
+ struct rtattr *attr;
unsigned int rta_len;
if (len < NLMSG_LENGTH(sizeof(*diag))) {
@@ -111,7 +111,7 @@
}
rta_len = len - NLMSG_LENGTH(sizeof(*diag));
- for (attr = (const struct rtattr *) (diag + 1);
+ for (attr = (struct rtattr *) (diag + 1);
RTA_OK(attr, rta_len) && keep_stressing();
attr = RTA_NEXT(attr, rta_len)) {
switch (attr->rta_type) {
@@ -151,7 +151,7 @@
.msg_iov = &iov,
.msg_iovlen = 1
};
- const struct nlmsghdr *h = (struct nlmsghdr *)buf;
+ struct nlmsghdr *h = (struct nlmsghdr *)buf;
ret = recvmsg(fd, &msg, flags);
if (ret == 0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-timer.c new/stress-ng-0.09.08/stress-timer.c
--- old/stress-ng-0.09.07/stress-timer.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-timer.c 2017-12-31 18:19:00.000000000 +0100
@@ -79,7 +79,7 @@
* stress_timer_keep_stressing()
* returns true if we can keep on running a stressor
*/
-bool HOT OPTIMIZE3 stress_timer_keep_stressing(void)
+static bool HOT OPTIMIZE3 stress_timer_keep_stressing(void)
{
return (LIKELY(g_keep_stressing_flag) &&
LIKELY(!max_ops || (timer_counter < max_ops)));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-tlb-shootdown.c new/stress-ng-0.09.08/stress-tlb-shootdown.c
--- old/stress-ng-0.09.07/stress-tlb-shootdown.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-tlb-shootdown.c 2017-12-31 18:19:00.000000000 +0100
@@ -39,6 +39,12 @@
const size_t page_size = args->page_size;
const size_t mmap_size = page_size * MMAP_PAGES;
pid_t pids[MAX_TLB_PROCS];
+ cpu_set_t proc_mask_initial;
+
+ if (sched_getaffinity(0, sizeof(proc_mask_initial), &proc_mask_initial) < 0) {
+ pr_fail_err("could not get CPU affinity");
+ return EXIT_FAILURE;
+ }
do {
uint8_t *mem, *ptr;
@@ -47,10 +53,7 @@
int32_t tlb_procs, i;
const int32_t max_cpus = stress_get_processors_configured();
- if (sched_getaffinity(0, sizeof(proc_mask), &proc_mask) < 0) {
- pr_fail_err("could not get CPU affinity");
- return EXIT_FAILURE;
- }
+ CPU_OR(&proc_mask, &proc_mask_initial, &proc_mask);
tlb_procs = max_cpus;
if (tlb_procs > MAX_TLB_PROCS)
@@ -113,13 +116,29 @@
for (i = 0; i < tlb_procs; i++) {
if (pids[i] != -1) {
- int status;
+ int status, ret;
+
+ ret = waitpid(pids[i], &status, 0);
+ if ((ret < 0) && (errno == EINTR)) {
+ int j;
+
+ /*
+ * We got interrupted, so assume
+ * it was the alarm (timedout) or
+ * SIGINT so force terminate
+ */
+ for (j = i; j < tlb_procs; j++)
+ (void)kill(pids[j], SIGKILL);
- (void)kill(pids[i], SIGKILL);
- (void)waitpid(pids[i], &status, 0);
+ /* re-wait on the failed wait */
+ (void)waitpid(pids[i], &status, 0);
+
+ /* and continue waitpid on the pids */
+ }
}
}
(void)munmap(mem, mmap_size);
+ (void)sched_setaffinity(0, sizeof(proc_mask_initial), &proc_mask_initial);
inc_counter(args);
} while (keep_stressing());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-vecmath.c new/stress-ng-0.09.08/stress-vecmath.c
--- old/stress-ng-0.09.07/stress-vecmath.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-vecmath.c 2017-12-31 18:19:00.000000000 +0100
@@ -174,7 +174,7 @@
uint64_put(a64[0] + a64[1]);
#if defined(STRESS_INT128)
- uint64_put((a128[0] >> 64) || (a128[0] & 0xffffffffffffULL));
+ uint128_put(a128[0]);
#endif
return EXIT_SUCCESS;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-vm.c new/stress-ng-0.09.08/stress-vm.c
--- old/stress-ng-0.09.07/stress-vm.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-vm.c 2017-12-31 18:19:00.000000000 +0100
@@ -92,7 +92,7 @@
* keep_stressing()
* returns true if we can keep on running a stressor
*/
-bool HOT OPTIMIZE3 keep_stressing_vm(const args_t *args)
+static bool HOT OPTIMIZE3 keep_stressing_vm(const args_t *args)
{
return (LIKELY(g_keep_stressing_flag) &&
LIKELY(!args->max_ops || ((*args->counter >> VM_BOGO_SHIFT) < args->max_ops)));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/stress-wcstr.c new/stress-ng-0.09.08/stress-wcstr.c
--- old/stress-ng-0.09.07/stress-wcstr.c 2017-12-14 19:17:52.000000000 +0100
+++ new/stress-ng-0.09.08/stress-wcstr.c 2017-12-31 18:19:00.000000000 +0100
@@ -25,8 +25,6 @@
*/
#include "stress-ng.h"
-#include
-
#define STR1LEN 256
#define STR2LEN 128
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/test/test-bsd-wchar.c new/stress-ng-0.09.08/test/test-bsd-wchar.c
--- old/stress-ng-0.09.07/test/test-bsd-wchar.c 1970-01-01 01:00:00.000000000 +0100
+++ new/stress-ng-0.09.08/test/test-bsd-wchar.c 2017-12-31 18:19:00.000000000 +0100
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2016-2017 Canonical, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * This code is a complete clean re-write of the stress tool by
+ * Colin Ian King and attempts to be
+ * backwardly compatible with the stress tool by Amos Waterland
+ * but has more stress tests and more
+ * functionality.
+ *
+ */
+#include
+
+int main(void)
+{
+ return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.07/test/test-wchar.c new/stress-ng-0.09.08/test/test-wchar.c
--- old/stress-ng-0.09.07/test/test-wchar.c 1970-01-01 01:00:00.000000000 +0100
+++ new/stress-ng-0.09.08/test/test-wchar.c 2017-12-31 18:19:00.000000000 +0100
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2016-2017 Canonical, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * This code is a complete clean re-write of the stress tool by
+ * Colin Ian King and attempts to be
+ * backwardly compatible with the stress tool by Amos Waterland
+ * but has more stress tests and more
+ * functionality.
+ *
+ */
+#include
+
+int main(void)
+{
+ return 0;
+}