Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/rt-tests/files/, dev-util/rt-tests/
Date: Wed, 07 Oct 2020 03:44:28
Message-Id: 1602042181.a89b4a4f5031fa964113a6663db48b4e18bf1217.sam@gentoo
1 commit: a89b4a4f5031fa964113a6663db48b4e18bf1217
2 Author: Kurt Kanzenbach <kurt <AT> kmk-computers <DOT> de>
3 AuthorDate: Sat Sep 26 11:54:15 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 7 03:43:01 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a89b4a4f
7
8 dev-util/rt-tests: Drop old
9
10 Package-Manager: Portage-3.0.4, Repoman-3.0.1
11 Signed-off-by: Kurt Kanzenbach <kurt <AT> kmk-computers.de>
12 Closes: https://github.com/gentoo/gentoo/pull/17676
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 dev-util/rt-tests/Manifest | 1 -
16 dev-util/rt-tests/files/rt-tests-1.8-musl.patch | 380 ------------------------
17 dev-util/rt-tests/rt-tests-1.8.ebuild | 38 ---
18 3 files changed, 419 deletions(-)
19
20 diff --git a/dev-util/rt-tests/Manifest b/dev-util/rt-tests/Manifest
21 index 3a6f1eccd32..8ef3346de3c 100644
22 --- a/dev-util/rt-tests/Manifest
23 +++ b/dev-util/rt-tests/Manifest
24 @@ -1,2 +1 @@
25 -DIST rt-tests-1.8.tar.xz 105820 BLAKE2B 478ac14732393f718e6be818b82b24b1e53d2f293140012bc17fd1c9242bd885b4d70dca3c7f3187e9ba22334e5f83d9ad1993ab9f70079e1765b918deab4411 SHA512 41c0b18e84d1f76de22a4ab239d43ac678b8c8419b508c96204bef346734122b9a42df51fcea97b1e0675bd25ed1e262730236ec0cb189732d5810122e96aa39
26 DIST rt-tests-1.9.tar.xz 112180 BLAKE2B fa9b7b70bd9ae5d5f5e1077ddbd916bc4556d079d4067f16289ab34fec16ed0c8074607a7a8e50ea7bad4df318a063074f1c0ec5c2e895851d3045d51a8ecd74 SHA512 66f086dbda31567e6dc5297424ec66b2c6bd7cb0e065c32e02c326f33967f3a301b1b34f9eb0dd0acd853279c64fb1c2bc271ac26648f4abc3f6090ba6484cfa
27
28 diff --git a/dev-util/rt-tests/files/rt-tests-1.8-musl.patch b/dev-util/rt-tests/files/rt-tests-1.8-musl.patch
29 deleted file mode 100644
30 index 48a7a297afc..00000000000
31 --- a/dev-util/rt-tests/files/rt-tests-1.8-musl.patch
32 +++ /dev/null
33 @@ -1,380 +0,0 @@
34 -From 4daa685588ee3848fc98fd9c6328b76f136ee876 Mon Sep 17 00:00:00 2001
35 -From: Kurt Kanzenbach <kurt@×××××××××××××.de>
36 -Date: Wed, 1 Apr 2020 20:15:24 +0200
37 -Subject: [PATCH] all: Fix musl build
38 -
39 -There are a few problems:
40 -
41 - * pi stress: pthread_attr_setaffinity_np() is not supported
42 - * cyclictest: SIGEV_THREAD_ID is not supported
43 - * hackbench: Fix include
44 - * all: Fix sched_* calls
45 -
46 -With these changes applied, the rt-tests seem to run fine.
47 -
48 -Signed-off-by: Kurt Kanzenbach <kurt@×××××××××××××.de>
49 ----
50 - Makefile | 5 --
51 - src/backfire/sendme.c | 1 +
52 - src/cyclictest/cyclictest.c | 68 ++++-----------------------
53 - src/hackbench/hackbench.c | 4 +-
54 - src/include/musl.h | 28 +++++++++++
55 - src/lib/rt-utils.c | 1 +
56 - src/pi_tests/classic_pi.c | 2 +
57 - src/pi_tests/tst-mutexpi10.c | 2 +
58 - src/pmqtest/pmqtest.c | 1 +
59 - src/ptsematest/ptsematest.c | 1 +
60 - src/rt-migrate-test/rt-migrate-test.c | 1 +
61 - src/sched_deadline/cyclicdeadline.c | 2 +
62 - 12 files changed, 50 insertions(+), 66 deletions(-)
63 - create mode 100644 src/include/musl.h
64 -
65 -diff --git a/Makefile b/Makefile
66 -index 05fc5eda71fa..9340f28f2c32 100644
67 ---- a/Makefile
68 -+++ b/Makefile
69 -@@ -7,7 +7,6 @@ OBJDIR = bld
70 - sources = cyclictest.c \
71 - hackbench.c \
72 - pip_stress.c \
73 -- pi_stress.c \
74 - pmqtest.c \
75 - ptsematest.c \
76 - rt-migrate-test.c \
77 -@@ -35,7 +34,6 @@ LDFLAGS ?=
78 - PYLIB ?= $(shell python3 -c 'import distutils.sysconfig; print (distutils.sysconfig.get_python_lib())')
79 -
80 - MANPAGES = src/cyclictest/cyclictest.8 \
81 -- src/pi_tests/pi_stress.8 \
82 - src/ptsematest/ptsematest.8 \
83 - src/rt-migrate-test/rt-migrate-test.8 \
84 - src/sigwaittest/sigwaittest.8 \
85 -@@ -125,9 +123,6 @@ deadline_test: $(OBJDIR)/deadline_test.o $(OBJDIR)/librttest.a
86 - signaltest: $(OBJDIR)/signaltest.o $(OBJDIR)/librttest.a
87 - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
88 -
89 --pi_stress: $(OBJDIR)/pi_stress.o $(OBJDIR)/librttest.a
90 -- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
91 --
92 - hwlatdetect: src/hwlatdetect/hwlatdetect.py
93 - chmod +x src/hwlatdetect/hwlatdetect.py
94 - ln -s src/hwlatdetect/hwlatdetect.py hwlatdetect
95 -diff --git a/src/backfire/sendme.c b/src/backfire/sendme.c
96 -index c1854d9660cb..ecec5c201bef 100644
97 ---- a/src/backfire/sendme.c
98 -+++ b/src/backfire/sendme.c
99 -@@ -31,6 +31,7 @@
100 - #include <errno.h>
101 - #include "rt-utils.h"
102 - #include "rt-get_cpu.h"
103 -+#include "musl.h"
104 -
105 - #include <utmpx.h>
106 - #include <sys/types.h>
107 -diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
108 -index c5f1fd46567a..8204e57cbbac 100644
109 ---- a/src/cyclictest/cyclictest.c
110 -+++ b/src/cyclictest/cyclictest.c
111 -@@ -36,6 +36,7 @@
112 - #include "rt_numa.h"
113 -
114 - #include "rt-utils.h"
115 -+#include "musl.h"
116 -
117 - #include <bionic.h>
118 -
119 -@@ -628,12 +629,8 @@ static void *timerthread(void *param)
120 - {
121 - struct thread_param *par = param;
122 - struct sched_param schedp;
123 -- struct sigevent sigev;
124 - sigset_t sigset;
125 -- timer_t timer;
126 - struct timespec now, next, interval, stop;
127 -- struct itimerval itimer;
128 -- struct itimerspec tspec;
129 - struct thread_stat *stat = par->stats;
130 - int stopped = 0;
131 - cpu_set_t mask;
132 -@@ -664,14 +661,6 @@ static void *timerthread(void *param)
133 - sigaddset(&sigset, par->signal);
134 - sigprocmask(SIG_BLOCK, &sigset, NULL);
135 -
136 -- if (par->mode == MODE_CYCLIC) {
137 -- sigev.sigev_notify = SIGEV_THREAD_ID | SIGEV_SIGNAL;
138 -- sigev.sigev_signo = par->signal;
139 -- sigev.sigev_notify_thread_id = stat->tid;
140 -- timer_create(par->clock, &sigev, &timer);
141 -- tspec.it_interval = interval;
142 -- }
143 --
144 - memset(&schedp, 0, sizeof(schedp));
145 - schedp.sched_priority = par->prio;
146 - if (setscheduler(0, par->policy, &schedp))
147 -@@ -726,20 +715,6 @@ static void *timerthread(void *param)
148 - stop = now;
149 - stop.tv_sec += duration;
150 - }
151 -- if (par->mode == MODE_CYCLIC) {
152 -- if (par->timermode == TIMER_ABSTIME)
153 -- tspec.it_value = next;
154 -- else
155 -- tspec.it_value = interval;
156 -- timer_settime(timer, par->timermode, &tspec, NULL);
157 -- }
158 --
159 -- if (par->mode == MODE_SYS_ITIMER) {
160 -- itimer.it_interval.tv_sec = interval.tv_sec;
161 -- itimer.it_interval.tv_usec = interval.tv_nsec / 1000;
162 -- itimer.it_value = itimer.it_interval;
163 -- setitimer(ITIMER_REAL, &itimer, NULL);
164 -- }
165 -
166 - stat->threadstarted++;
167 -
168 -@@ -747,16 +722,10 @@ static void *timerthread(void *param)
169 -
170 - uint64_t diff;
171 - unsigned long diff_smi = 0;
172 -- int sigs, ret;
173 -+ int ret;
174 -
175 - /* Wait for next period */
176 - switch (par->mode) {
177 -- case MODE_CYCLIC:
178 -- case MODE_SYS_ITIMER:
179 -- if (sigwait(&sigset, &sigs) < 0)
180 -- goto out;
181 -- break;
182 --
183 - case MODE_CLOCK_NANOSLEEP:
184 - if (par->timermode == TIMER_ABSTIME) {
185 - ret = clock_nanosleep(par->clock, TIMER_ABSTIME,
186 -@@ -878,11 +847,6 @@ static void *timerthread(void *param)
187 -
188 - next.tv_sec += interval.tv_sec;
189 - next.tv_nsec += interval.tv_nsec;
190 -- if (par->mode == MODE_CYCLIC) {
191 -- int overrun_count = timer_getoverrun(timer);
192 -- next.tv_sec += overrun_count * interval.tv_sec;
193 -- next.tv_nsec += overrun_count * interval.tv_nsec;
194 -- }
195 - tsnorm(&next);
196 -
197 - while (tsgreater(&now, &next)) {
198 -@@ -907,17 +871,6 @@ out:
199 - pthread_mutex_unlock(&refresh_on_max_lock);
200 - }
201 -
202 -- if (par->mode == MODE_CYCLIC)
203 -- timer_delete(timer);
204 --
205 -- if (par->mode == MODE_SYS_ITIMER) {
206 -- itimer.it_value.tv_sec = 0;
207 -- itimer.it_value.tv_usec = 0;
208 -- itimer.it_interval.tv_sec = 0;
209 -- itimer.it_interval.tv_usec = 0;
210 -- setitimer(ITIMER_REAL, &itimer, NULL);
211 -- }
212 --
213 - /* close msr file */
214 - if (smi)
215 - close(par->msr_fd);
216 -@@ -1417,7 +1370,8 @@ static void process_options (int argc, char *argv[], int max_cpus)
217 - case OPT_VERBOSE: verbose = 1; break;
218 - case 'x':
219 - case OPT_POSIX_TIMERS:
220 -- use_nanosleep = MODE_CYCLIC; break;
221 -+ fatal("--posix_timers is not available on your libc\n");
222 -+ break;
223 - case '?':
224 - case OPT_HELP:
225 - display_help(0); break;
226 -@@ -1450,13 +1404,6 @@ static void process_options (int argc, char *argv[], int max_cpus)
227 - }
228 - }
229 -
230 -- if ((use_system == MODE_SYS_OFFSET) && (use_nanosleep == MODE_CYCLIC)) {
231 -- warn("The system option requires clock_nanosleep\n");
232 -- warn("and is not compatible with posix_timers\n");
233 -- warn("Using clock_nanosleep\n");
234 -- use_nanosleep = MODE_CLOCK_NANOSLEEP;
235 -- }
236 --
237 - /* if smp wasn't requested, test for numa automatically */
238 - if (!smp) {
239 - #ifdef NUMA
240 -@@ -2157,7 +2104,6 @@ int main(int argc, char **argv)
241 -
242 - }
243 -
244 --
245 - mode = use_nanosleep + use_system;
246 -
247 - sigemptyset(&sigset);
248 -@@ -2207,16 +2153,18 @@ int main(int argc, char **argv)
249 - void *stack;
250 - void *currstk;
251 - size_t stksize;
252 -+ int err;
253 -
254 - /* find the memory node associated with the cpu i */
255 - node = rt_numa_numa_node_of_cpu(cpu);
256 -
257 - /* get the stack size set for for this thread */
258 -- if (pthread_attr_getstack(&attr, &currstk, &stksize))
259 -+ err = pthread_attr_getstack(&attr, &currstk, &stksize);
260 -+ if (err != EINVAL)
261 - fatal("failed to get stack size for thread %d\n", i);
262 -
263 - /* if the stack size is zero, set a default */
264 -- if (stksize == 0)
265 -+ if (err == EINVAL || stksize == 0)
266 - stksize = PTHREAD_STACK_MIN * 2;
267 -
268 - /* allocate memory for a stack on appropriate node */
269 -diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c
270 -index 5a883d341f2e..9f1e4db736a7 100644
271 ---- a/src/hackbench/hackbench.c
272 -+++ b/src/hackbench/hackbench.c
273 -@@ -24,13 +24,15 @@
274 - #include <sys/socket.h>
275 - #include <sys/wait.h>
276 - #include <sys/time.h>
277 --#include <sys/poll.h>
278 -+#include <poll.h>
279 - #include <limits.h>
280 - #include <getopt.h>
281 - #include <signal.h>
282 - #include <setjmp.h>
283 - #include <sched.h>
284 -
285 -+#include "musl.h"
286 -+
287 - static unsigned int datasize = 100;
288 - static unsigned int loops = 100;
289 - static unsigned int num_groups = 10;
290 -diff --git a/src/include/musl.h b/src/include/musl.h
291 -new file mode 100644
292 -index 000000000000..ea5075e768c8
293 ---- /dev/null
294 -+++ b/src/include/musl.h
295 -@@ -0,0 +1,28 @@
296 -+/*
297 -+ * Copyright (C) 2020 Kurt Kanzenbach <kurt@×××××××××××××.de>
298 -+ * Time-stamp: <2020-04-04 10:54:01 kurt>
299 -+ */
300 -+
301 -+#ifndef _MUSL_H_
302 -+#define _MUSL_H_
303 -+
304 -+#include <unistd.h>
305 -+#include <sys/syscall.h>
306 -+
307 -+/*
308 -+ * Musl someshow defines sched_* to ENOSYS which is not correct ...
309 -+ * See commit 1e21e78bf7a5 ("add support for thread scheduling (POSIX TPS option)")
310 -+ *
311 -+ * Workaround: define them to syscall(...)
312 -+ */
313 -+
314 -+#define sched_getparam(pid, param) \
315 -+ syscall(SYS_sched_getparam, pid, param)
316 -+#define sched_setparam(pid, param) \
317 -+ syscall(SYS_sched_setparam, pid, param)
318 -+#define sched_getscheduler(pid) \
319 -+ syscall(SYS_sched_getscheduler, pid)
320 -+#define sched_setscheduler(pid, policy, param) \
321 -+ syscall(SYS_sched_setscheduler, pid, policy, param)
322 -+
323 -+#endif /* _MUSL_H_ */
324 -diff --git a/src/lib/rt-utils.c b/src/lib/rt-utils.c
325 -index 1998a327d036..f7adda9c5987 100644
326 ---- a/src/lib/rt-utils.c
327 -+++ b/src/lib/rt-utils.c
328 -@@ -23,6 +23,7 @@
329 - #include "rt-utils.h"
330 - #include "rt-sched.h"
331 - #include "error.h"
332 -+#include "musl.h"
333 -
334 - static char debugfileprefix[MAX_PATH];
335 -
336 -diff --git a/src/pi_tests/classic_pi.c b/src/pi_tests/classic_pi.c
337 -index 64af8890276f..bb088d3973b2 100644
338 ---- a/src/pi_tests/classic_pi.c
339 -+++ b/src/pi_tests/classic_pi.c
340 -@@ -34,6 +34,8 @@
341 - #include <signal.h>
342 - #include <getopt.h>
343 -
344 -+#include "musl.h"
345 -+
346 - /* test timeout */
347 - #define TIMEOUT 2
348 -
349 -diff --git a/src/pi_tests/tst-mutexpi10.c b/src/pi_tests/tst-mutexpi10.c
350 -index 97a345edd26e..1028d344edff 100644
351 ---- a/src/pi_tests/tst-mutexpi10.c
352 -+++ b/src/pi_tests/tst-mutexpi10.c
353 -@@ -35,6 +35,8 @@
354 - #include <string.h>
355 - #include <signal.h>
356 -
357 -+#include "musl.h"
358 -+
359 - /* test timeout */
360 - #define TIMEOUT 2
361 -
362 -diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c
363 -index 3ce29252b9a2..1a57841cb7e8 100644
364 ---- a/src/pmqtest/pmqtest.c
365 -+++ b/src/pmqtest/pmqtest.c
366 -@@ -24,6 +24,7 @@
367 - #include "rt-utils.h"
368 - #include "rt-get_cpu.h"
369 - #include "error.h"
370 -+#include "musl.h"
371 -
372 - #include <pthread.h>
373 -
374 -diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c
375 -index 485c991ec173..c000e083615f 100644
376 ---- a/src/ptsematest/ptsematest.c
377 -+++ b/src/ptsematest/ptsematest.c
378 -@@ -22,6 +22,7 @@
379 - #include "rt-utils.h"
380 - #include "rt-get_cpu.h"
381 - #include "error.h"
382 -+#include "musl.h"
383 -
384 - #include <pthread.h>
385 -
386 -diff --git a/src/rt-migrate-test/rt-migrate-test.c b/src/rt-migrate-test/rt-migrate-test.c
387 -index 4863238edeb4..9f1aba159dc7 100644
388 ---- a/src/rt-migrate-test/rt-migrate-test.c
389 -+++ b/src/rt-migrate-test/rt-migrate-test.c
390 -@@ -25,6 +25,7 @@
391 - #include <sched.h>
392 - #include <pthread.h>
393 - #include "rt-utils.h"
394 -+#include "musl.h"
395 -
396 - int nr_tasks;
397 - int lfd;
398 -diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c
399 -index a08e28e73c42..675a0ea1a162 100644
400 ---- a/src/sched_deadline/cyclicdeadline.c
401 -+++ b/src/sched_deadline/cyclicdeadline.c
402 -@@ -32,6 +32,8 @@
403 - #include <rt-utils.h>
404 - #include <rt-sched.h>
405 -
406 -+#include "musl.h"
407 -+
408 - #define _STR(x) #x
409 - #define STR(x) _STR(x)
410 - #ifndef MAXPATH
411 ---
412 -2.24.1
413 -
414
415 diff --git a/dev-util/rt-tests/rt-tests-1.8.ebuild b/dev-util/rt-tests/rt-tests-1.8.ebuild
416 deleted file mode 100644
417 index f94e433d66c..00000000000
418 --- a/dev-util/rt-tests/rt-tests-1.8.ebuild
419 +++ /dev/null
420 @@ -1,38 +0,0 @@
421 -# Copyright 1999-2020 Gentoo Authors
422 -# Distributed under the terms of the GNU General Public License v2
423 -
424 -EAPI=7
425 -
426 -PYTHON_COMPAT=( python3_{6..8} )
427 -
428 -inherit python-single-r1 toolchain-funcs
429 -
430 -DESCRIPTION="A collection of latency testing tools for the linux(-rt) kernel"
431 -HOMEPAGE="https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/about/"
432 -SRC_URI="
433 - https://kernel.org/pub/linux/utils/rt-tests/${P}.tar.xz
434 - https://kernel.org/pub/linux/utils/rt-tests/older/${P}.tar.xz"
435 -
436 -LICENSE="GPL-2 GPL-2+ LGPL-2.1+"
437 -SLOT="0"
438 -KEYWORDS="~amd64 ~arm64 ~x86"
439 -REQUIRED_USE="${PYTHON_REQUIRED_USE}"
440 -
441 -DEPEND="${PYTHON_DEPS}
442 - sys-process/numactl"
443 -RDEPEND="${DEPEND}"
444 -
445 -src_prepare() {
446 - default
447 - use elibc_musl && eapply "${FILESDIR}/${P}-musl.patch"
448 -}
449 -
450 -src_compile() {
451 - emake CC="$(tc-getCC)" AR="$(tc-getAR)"
452 -}
453 -
454 -src_install() {
455 - emake prefix=/usr DESTDIR="${D}" MAN_COMPRESSION=none install
456 - python_fix_shebang "${ED}"
457 - python_optimize
458 -}