summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-test
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linaro.org>2017-10-17 13:22:11 -0500
committerMartin Jansa <Martin.Jansa@gmail.com>2017-10-27 16:39:33 +0000
commit79c5e2c7233c2f92f885deb2a94da37fbb842dff (patch)
tree5b2a88b2630b3b05f8d4d5aeaeb92509735fde69 /meta-oe/recipes-test
parentb50cfa1f1fe0bdaf4891c98de2c869d4fe80e8f7 (diff)
downloadmeta-openembedded-79c5e2c7233c2f92f885deb2a94da37fbb842dff.tar.gz
stress-ng: Add recipe
A tool to generate load and stress a system, currently this recipe is on a couple of layers [1] and is not updated, a good reason to have in meta-oe. [1] https://layers.openembedded.org/layerindex/branch/master/recipes/?q=stress-ng Signed-off-by: Aníbal Limón <anibal.limon@linaro.org> Signed-off-by: Denys Dmytriyenko <denis@denix.org> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-test')
-rw-r--r--meta-oe/recipes-test/stress-ng/stress-ng/0001-Several-changes-to-fix-musl-build.patch170
-rw-r--r--meta-oe/recipes-test/stress-ng/stress-ng_0.08.17.bb20
2 files changed, 190 insertions, 0 deletions
diff --git a/meta-oe/recipes-test/stress-ng/stress-ng/0001-Several-changes-to-fix-musl-build.patch b/meta-oe/recipes-test/stress-ng/stress-ng/0001-Several-changes-to-fix-musl-build.patch
new file mode 100644
index 000000000..3ed7efc7e
--- /dev/null
+++ b/meta-oe/recipes-test/stress-ng/stress-ng/0001-Several-changes-to-fix-musl-build.patch
@@ -0,0 +1,170 @@
1From d50203b233cb8820bf83b6651c2a8487e0db1fcf Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linaro.org>
3Date: Tue, 17 Oct 2017 10:13:20 -0500
4Subject: [PATCH] Several changes to fix musl build
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9stress-{context, stackmmap}.c: Set tests to non-implemented because uses
10swapcontext, musl provide the definition but not the implementation due
11 to that functions are pre-POSIX and set to be deprecated.
12 stress-{resources, pty}.c: Doesn't include termio.h and remove stress
13 operations that uses struct termio, musl doesn't provide that struct.
14stress-pthread.c: Change pthread_yield to sched_yield to be more compatible.
15stress-malloc.c: Check for definition of M_MMAP_THRESHOLD musl doesn't
16 ptovide that constant.
17stress-madvise.c: Add static poision_count integer, definition of
18 MADV_SOFT_OFFLINE doesn't grauntee MADV_HWPOISON to be defined.
19cache.c: Define GLOB_ONLYDIR not available on MUSL.
20
21Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
22Upstream-status: Pending
23---
24 cache.c | 4 ++++
25 stress-context.c | 2 +-
26 stress-madvise.c | 1 +
27 stress-malloc.c | 2 +-
28 stress-pthread.c | 2 +-
29 stress-pty.c | 18 ------------------
30 stress-resources.c | 1 -
31 stress-stackmmap.c | 2 +-
32 8 files changed, 9 insertions(+), 23 deletions(-)
33
34diff --git a/cache.c b/cache.c
35index e01fad0..27870ee 100644
36--- a/cache.c
37+++ b/cache.c
38@@ -27,6 +27,10 @@ typedef struct {
39
40 #include <glob.h>
41
42+#ifndef GLOB_ONLYDIR
43+#define GLOB_ONLYDIR 0x100
44+#endif
45+
46 #if defined(__linux__)
47 #define SYS_CPU_PREFIX "/sys/devices/system/cpu"
48 #define GLOB_PATTERN SYS_CPU_PREFIX "/cpu[0-9]*"
49diff --git a/stress-context.c b/stress-context.c
50index c5f50ed..67209e5 100644
51--- a/stress-context.c
52+++ b/stress-context.c
53@@ -24,7 +24,7 @@
54 */
55 #include "stress-ng.h"
56
57-#if !defined(__OpenBSD__)
58+#if !defined(__OpenBSD__) && False
59
60 #include <ucontext.h>
61
62diff --git a/stress-madvise.c b/stress-madvise.c
63index 43ea454..2e1f8ee 100644
64--- a/stress-madvise.c
65+++ b/stress-madvise.c
66@@ -141,6 +141,7 @@ static int stress_random_advise(const args_t *args)
67 #if defined(MADV_SOFT_OFFLINE)
68 if (advise == MADV_SOFT_OFFLINE) {
69 static int soft_offline_count;
70+ static int poison_count;
71
72 /* ..and minimize number of soft offline pages */
73 if ((soft_offline_count >= NUM_SOFT_OFFLINE_MAX) ||
74diff --git a/stress-malloc.c b/stress-malloc.c
75index 8dbe5cc..f505f32 100644
76--- a/stress-malloc.c
77+++ b/stress-malloc.c
78@@ -99,7 +99,7 @@ int stress_malloc(const args_t *args)
79 malloc_max = MIN_MALLOC_MAX;
80 }
81
82-#if defined(__GNUC__) && defined(__linux__)
83+#if defined(__GNUC__) && defined(__linux__) && defined(M_MMAP_THRESHOLD)
84 if (get_setting("malloc-threshold", &malloc_threshold))
85 (void)mallopt(M_MMAP_THRESHOLD, (int)malloc_threshold);
86 #endif
87diff --git a/stress-pthread.c b/stress-pthread.c
88index 323a1d4..8269f4c 100644
89--- a/stress-pthread.c
90+++ b/stress-pthread.c
91@@ -139,7 +139,7 @@ static void *stress_pthread_func(void *parg)
92 break;
93 }
94 #if !defined(__NetBSD__) && !defined(__sun__)
95- (void)pthread_yield();
96+ (void)sched_yield();
97 #endif
98 }
99 ret = pthread_mutex_unlock(&mutex);
100diff --git a/stress-pty.c b/stress-pty.c
101index 8c3edf8..518f118 100644
102--- a/stress-pty.c
103+++ b/stress-pty.c
104@@ -26,7 +26,6 @@
105
106 #if defined(__linux__)
107
108-#include <termio.h>
109 #include <termios.h>
110
111 typedef struct {
112@@ -108,7 +107,6 @@ int stress_pty(const args_t *args)
113 */
114 for (i = 0; i < n; i++) {
115 struct termios ios;
116- struct termio io;
117 struct winsize ws;
118 int arg;
119
120@@ -130,22 +128,6 @@ int stress_pty(const args_t *args)
121 if (ioctl(ptys[i].slave, TCSETSF, &ios) < 0)
122 pr_fail_err("ioctl TCSETSF on slave pty");
123 #endif
124-#if defined(TCGETA)
125- if (ioctl(ptys[i].slave, TCGETA, &io) < 0)
126- pr_fail_err("ioctl TCGETA on slave pty");
127-#endif
128-#if defined(TCSETA)
129- if (ioctl(ptys[i].slave, TCSETA, &io) < 0)
130- pr_fail_err("ioctl TCSETA on slave pty");
131-#endif
132-#if defined(TCSETAW)
133- if (ioctl(ptys[i].slave, TCSETAW, &io) < 0)
134- pr_fail_err("ioctl TCSETAW on slave pty");
135-#endif
136-#if defined(TCSETAF)
137- if (ioctl(ptys[i].slave, TCSETAF, &io) < 0)
138- pr_fail_err("ioctl TCSETAF on slave pty");
139-#endif
140 #if defined(TIOCGLCKTRMIOS)
141 if (ioctl(ptys[i].slave, TIOCGLCKTRMIOS, &ios) < 0)
142 pr_fail_err("ioctl TIOCGLCKTRMIOS on slave pty");
143diff --git a/stress-resources.c b/stress-resources.c
144index 182e176..880433d 100644
145--- a/stress-resources.c
146+++ b/stress-resources.c
147@@ -31,7 +31,6 @@
148 #include <sys/inotify.h>
149 #endif
150 #if defined(__linux__)
151-#include <termio.h>
152 #include <termios.h>
153 #endif
154 #if defined(HAVE_LIB_PTHREAD) && defined(__linux__)
155diff --git a/stress-stackmmap.c b/stress-stackmmap.c
156index e1378e2..00d1268 100644
157--- a/stress-stackmmap.c
158+++ b/stress-stackmmap.c
159@@ -24,7 +24,7 @@
160 */
161 #include "stress-ng.h"
162
163-#if defined(__linux__)
164+#if defined(__linux__) && False
165
166 #include <ucontext.h>
167
168--
1692.11.0
170
diff --git a/meta-oe/recipes-test/stress-ng/stress-ng_0.08.17.bb b/meta-oe/recipes-test/stress-ng/stress-ng_0.08.17.bb
new file mode 100644
index 000000000..dc5b2e8eb
--- /dev/null
+++ b/meta-oe/recipes-test/stress-ng/stress-ng_0.08.17.bb
@@ -0,0 +1,20 @@
1SUMMARY = "A tool to load and stress a computer system"
2HOMEPAGE = "http://kernel.ubuntu.com/~cking/stress-ng/"
3LICENSE = "GPLv2"
4LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
5
6DEPENDS = "zlib libaio"
7
8SRC_URI = "http://kernel.ubuntu.com/~cking/tarballs/${BPN}/${BP}.tar.gz \
9 "
10SRC_URI_append_libc-musl = "file://0001-Several-changes-to-fix-musl-build.patch"
11
12SRC_URI[md5sum] = "e0f6497a8c06f5d652bc2ad88d449c12"
13SRC_URI[sha256sum] = "37cc73e42f5bdb0e0571ba88f6a69b8f05ee28e51afcafc2231c1058b1a5dd18"
14
15CFLAGS += "-Wall -Wextra -DVERSION='"$(VERSION)"'"
16
17do_install_append() {
18 install -d ${D}${bindir}
19 install -m 755 ${S}/stress-ng ${D}${bindir}/stress-ng
20}