1 |
commit: e78e6351429ea293f27c43ec6d03fc68b1ea0b24 |
2 |
Author: Kurt Kanzenbach <kurt <AT> kmk-computers <DOT> de> |
3 |
AuthorDate: Mon Dec 27 19:51:57 2021 +0000 |
4 |
Commit: Florian Schmaus <flow <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 5 19:18:06 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e78e6351 |
7 |
|
8 |
dev-util/rt-tests: Drop old |
9 |
|
10 |
Package-Manager: Portage-3.0.28, Repoman-3.0.3 |
11 |
Signed-off-by: Kurt Kanzenbach <kurt <AT> kmk-computers.de> |
12 |
Closes: https://github.com/gentoo/gentoo/pull/23551 |
13 |
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org> |
14 |
|
15 |
dev-util/rt-tests/Manifest | 1 - |
16 |
dev-util/rt-tests/files/rt-tests-2.2-musl.patch | 352 ------------------------ |
17 |
dev-util/rt-tests/rt-tests-2.2.ebuild | 38 --- |
18 |
3 files changed, 391 deletions(-) |
19 |
|
20 |
diff --git a/dev-util/rt-tests/Manifest b/dev-util/rt-tests/Manifest |
21 |
index b157404b489c..6f230e4f00d8 100644 |
22 |
--- a/dev-util/rt-tests/Manifest |
23 |
+++ b/dev-util/rt-tests/Manifest |
24 |
@@ -1,2 +1 @@ |
25 |
-DIST rt-tests-2.2.tar.xz 115120 BLAKE2B 46db78d32b2d5830859757c21e42d4e21cb0da8b2ebcbf8ba738c8e3832a6ea597d686ee6c9cad23f269853ad188219f46a0e5326124f056b4822619076268ac SHA512 826dc8894dd8670e705566b5224f54bdee89e5b48f21ca00e6c4061f28c4fbe2dab14c1e1b1302fec7011dbf28f3eb88c1b8adc137fed7d17958ea972e3c08b1 |
26 |
DIST rt-tests-2.3.tar.xz 115000 BLAKE2B d5f6a31a31340873348b5ffa6c706deb080e9686944a759fa4e4d53f2041d3f27aa1e9512d7413438bce7c61e05e2495c96eeef0b976ee09377f89d847225aef SHA512 3bf6fe95c5ac9911fb51fba1d4a8e6ad3b96a6cdce464372917673862801353cbbb377c76d3a19325f0b5402f65daf5c605e496d7460949615069366a00a978a |
27 |
|
28 |
diff --git a/dev-util/rt-tests/files/rt-tests-2.2-musl.patch b/dev-util/rt-tests/files/rt-tests-2.2-musl.patch |
29 |
deleted file mode 100644 |
30 |
index caa8d415aad5..000000000000 |
31 |
--- a/dev-util/rt-tests/files/rt-tests-2.2-musl.patch |
32 |
+++ /dev/null |
33 |
@@ -1,352 +0,0 @@ |
34 |
-From 0b7a1e0d3463aa8aa4b7dcad0ec154e658d68036 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 | 70 ++++------------------------------ |
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 | 1 |
62 |
- 12 files changed, 50 insertions(+), 67 deletions(-) |
63 |
- create mode 100644 src/include/musl.h |
64 |
- |
65 |
---- a/Makefile |
66 |
-+++ b/Makefile |
67 |
-@@ -7,7 +7,6 @@ OBJDIR = bld |
68 |
- sources = cyclictest.c \ |
69 |
- hackbench.c \ |
70 |
- pip_stress.c \ |
71 |
-- pi_stress.c \ |
72 |
- pmqtest.c \ |
73 |
- ptsematest.c \ |
74 |
- rt-migrate-test.c \ |
75 |
-@@ -42,7 +41,6 @@ ifeq (${PYLIB},) |
76 |
- endif |
77 |
- |
78 |
- MANPAGES = src/cyclictest/cyclictest.8 \ |
79 |
-- src/pi_tests/pi_stress.8 \ |
80 |
- src/ptsematest/ptsematest.8 \ |
81 |
- src/rt-migrate-test/rt-migrate-test.8 \ |
82 |
- src/sigwaittest/sigwaittest.8 \ |
83 |
-@@ -130,9 +128,6 @@ deadline_test: $(OBJDIR)/deadline_test.o |
84 |
- signaltest: $(OBJDIR)/signaltest.o $(OBJDIR)/librttest.a $(OBJDIR)/librttestnuma.a |
85 |
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(RTTESTNUMA) |
86 |
- |
87 |
--pi_stress: $(OBJDIR)/pi_stress.o $(OBJDIR)/librttest.a |
88 |
-- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) |
89 |
-- |
90 |
- hwlatdetect: src/hwlatdetect/hwlatdetect.py |
91 |
- chmod +x src/hwlatdetect/hwlatdetect.py |
92 |
- ln -s src/hwlatdetect/hwlatdetect.py hwlatdetect |
93 |
---- a/src/backfire/sendme.c |
94 |
-+++ b/src/backfire/sendme.c |
95 |
-@@ -29,6 +29,7 @@ |
96 |
- #include <string.h> |
97 |
- #include <time.h> |
98 |
- #include <errno.h> |
99 |
-+#include "musl.h" |
100 |
- #include "rt-utils.h" |
101 |
- #include "rt-get_cpu.h" |
102 |
- |
103 |
---- a/src/cyclictest/cyclictest.c |
104 |
-+++ b/src/cyclictest/cyclictest.c |
105 |
-@@ -33,6 +33,7 @@ |
106 |
- #include <sys/utsname.h> |
107 |
- #include <sys/mman.h> |
108 |
- #include <sys/syscall.h> |
109 |
-+#include "musl.h" |
110 |
- #include "rt_numa.h" |
111 |
- |
112 |
- #include "rt-utils.h" |
113 |
-@@ -502,12 +503,8 @@ static void *timerthread(void *param) |
114 |
- { |
115 |
- struct thread_param *par = param; |
116 |
- struct sched_param schedp; |
117 |
-- struct sigevent sigev; |
118 |
- sigset_t sigset; |
119 |
-- timer_t timer; |
120 |
- struct timespec now, next, interval, stop; |
121 |
-- struct itimerval itimer; |
122 |
-- struct itimerspec tspec; |
123 |
- struct thread_stat *stat = par->stats; |
124 |
- int stopped = 0; |
125 |
- cpu_set_t mask; |
126 |
-@@ -538,14 +535,6 @@ static void *timerthread(void *param) |
127 |
- sigaddset(&sigset, par->signal); |
128 |
- sigprocmask(SIG_BLOCK, &sigset, NULL); |
129 |
- |
130 |
-- if (par->mode == MODE_CYCLIC) { |
131 |
-- sigev.sigev_notify = SIGEV_THREAD_ID | SIGEV_SIGNAL; |
132 |
-- sigev.sigev_signo = par->signal; |
133 |
-- sigev.sigev_notify_thread_id = stat->tid; |
134 |
-- timer_create(par->clock, &sigev, &timer); |
135 |
-- tspec.it_interval = interval; |
136 |
-- } |
137 |
-- |
138 |
- memset(&schedp, 0, sizeof(schedp)); |
139 |
- schedp.sched_priority = par->prio; |
140 |
- if (setscheduler(0, par->policy, &schedp)) |
141 |
-@@ -600,20 +589,6 @@ static void *timerthread(void *param) |
142 |
- stop = now; |
143 |
- stop.tv_sec += duration; |
144 |
- } |
145 |
-- if (par->mode == MODE_CYCLIC) { |
146 |
-- if (par->timermode == TIMER_ABSTIME) |
147 |
-- tspec.it_value = next; |
148 |
-- else |
149 |
-- tspec.it_value = interval; |
150 |
-- timer_settime(timer, par->timermode, &tspec, NULL); |
151 |
-- } |
152 |
-- |
153 |
-- if (par->mode == MODE_SYS_ITIMER) { |
154 |
-- itimer.it_interval.tv_sec = interval.tv_sec; |
155 |
-- itimer.it_interval.tv_usec = interval.tv_nsec / 1000; |
156 |
-- itimer.it_value = itimer.it_interval; |
157 |
-- setitimer(ITIMER_REAL, &itimer, NULL); |
158 |
-- } |
159 |
- |
160 |
- stat->threadstarted++; |
161 |
- |
162 |
-@@ -621,16 +596,10 @@ static void *timerthread(void *param) |
163 |
- |
164 |
- uint64_t diff; |
165 |
- unsigned long diff_smi = 0; |
166 |
-- int sigs, ret; |
167 |
-+ int ret; |
168 |
- |
169 |
- /* Wait for next period */ |
170 |
- switch (par->mode) { |
171 |
-- case MODE_CYCLIC: |
172 |
-- case MODE_SYS_ITIMER: |
173 |
-- if (sigwait(&sigset, &sigs) < 0) |
174 |
-- goto out; |
175 |
-- break; |
176 |
-- |
177 |
- case MODE_CLOCK_NANOSLEEP: |
178 |
- if (par->timermode == TIMER_ABSTIME) { |
179 |
- ret = clock_nanosleep(par->clock, TIMER_ABSTIME, |
180 |
-@@ -751,11 +720,6 @@ static void *timerthread(void *param) |
181 |
- |
182 |
- next.tv_sec += interval.tv_sec; |
183 |
- next.tv_nsec += interval.tv_nsec; |
184 |
-- if (par->mode == MODE_CYCLIC) { |
185 |
-- int overrun_count = timer_getoverrun(timer); |
186 |
-- next.tv_sec += overrun_count * interval.tv_sec; |
187 |
-- next.tv_nsec += overrun_count * interval.tv_nsec; |
188 |
-- } |
189 |
- tsnorm(&next); |
190 |
- |
191 |
- while (tsgreater(&now, &next)) { |
192 |
-@@ -780,17 +744,6 @@ out: |
193 |
- pthread_mutex_unlock(&refresh_on_max_lock); |
194 |
- } |
195 |
- |
196 |
-- if (par->mode == MODE_CYCLIC) |
197 |
-- timer_delete(timer); |
198 |
-- |
199 |
-- if (par->mode == MODE_SYS_ITIMER) { |
200 |
-- itimer.it_value.tv_sec = 0; |
201 |
-- itimer.it_value.tv_usec = 0; |
202 |
-- itimer.it_interval.tv_sec = 0; |
203 |
-- itimer.it_interval.tv_usec = 0; |
204 |
-- setitimer(ITIMER_REAL, &itimer, NULL); |
205 |
-- } |
206 |
-- |
207 |
- /* close msr file */ |
208 |
- if (smi) |
209 |
- close(par->msr_fd); |
210 |
-@@ -1174,7 +1127,8 @@ static void process_options(int argc, ch |
211 |
- case OPT_VERBOSE: verbose = 1; break; |
212 |
- case 'x': |
213 |
- case OPT_POSIX_TIMERS: |
214 |
-- use_nanosleep = MODE_CYCLIC; break; |
215 |
-+ fatal("--posix_timers is not available on your libc\n"); |
216 |
-+ break; |
217 |
- case '?': |
218 |
- case OPT_HELP: |
219 |
- display_help(0); break; |
220 |
-@@ -1207,13 +1161,6 @@ static void process_options(int argc, ch |
221 |
- } |
222 |
- } |
223 |
- |
224 |
-- if ((use_system == MODE_SYS_OFFSET) && (use_nanosleep == MODE_CYCLIC)) { |
225 |
-- warn("The system option requires clock_nanosleep\n"); |
226 |
-- warn("and is not compatible with posix_timers\n"); |
227 |
-- warn("Using clock_nanosleep\n"); |
228 |
-- use_nanosleep = MODE_CLOCK_NANOSLEEP; |
229 |
-- } |
230 |
-- |
231 |
- /* if smp wasn't requested, test for numa automatically */ |
232 |
- if (!smp) { |
233 |
- numa = numa_initialize(); |
234 |
-@@ -1943,7 +1890,6 @@ int main(int argc, char **argv) |
235 |
- |
236 |
- } |
237 |
- |
238 |
-- |
239 |
- mode = use_nanosleep + use_system; |
240 |
- |
241 |
- sigemptyset(&sigset); |
242 |
-@@ -1993,16 +1939,18 @@ int main(int argc, char **argv) |
243 |
- void *stack; |
244 |
- void *currstk; |
245 |
- size_t stksize; |
246 |
-+ int err; |
247 |
- |
248 |
- /* find the memory node associated with the cpu i */ |
249 |
- node = rt_numa_numa_node_of_cpu(cpu); |
250 |
- |
251 |
-- /* get the stack size set for this thread */ |
252 |
-- if (pthread_attr_getstack(&attr, &currstk, &stksize)) |
253 |
-+ /* get the stack size set for for this thread */ |
254 |
-+ err = pthread_attr_getstack(&attr, &currstk, &stksize); |
255 |
-+ if (err != EINVAL) |
256 |
- fatal("failed to get stack size for thread %d\n", i); |
257 |
- |
258 |
- /* if the stack size is zero, set a default */ |
259 |
-- if (stksize == 0) |
260 |
-+ if (err == EINVAL || stksize == 0) |
261 |
- stksize = PTHREAD_STACK_MIN * 2; |
262 |
- |
263 |
- /* allocate memory for a stack on appropriate node */ |
264 |
---- a/src/hackbench/hackbench.c |
265 |
-+++ b/src/hackbench/hackbench.c |
266 |
-@@ -24,13 +24,15 @@ |
267 |
- #include <sys/socket.h> |
268 |
- #include <sys/wait.h> |
269 |
- #include <sys/time.h> |
270 |
--#include <sys/poll.h> |
271 |
-+#include <poll.h> |
272 |
- #include <limits.h> |
273 |
- #include <getopt.h> |
274 |
- #include <signal.h> |
275 |
- #include <setjmp.h> |
276 |
- #include <sched.h> |
277 |
- |
278 |
-+#include "musl.h" |
279 |
-+ |
280 |
- static unsigned int datasize = 100; |
281 |
- static unsigned int loops = 100; |
282 |
- static unsigned int num_groups = 10; |
283 |
---- /dev/null |
284 |
-+++ b/src/include/musl.h |
285 |
-@@ -0,0 +1,28 @@ |
286 |
-+/* |
287 |
-+ * Copyright (C) 2020 Kurt Kanzenbach <kurt@×××××××××××××.de> |
288 |
-+ * Time-stamp: <2020-04-04 10:54:01 kurt> |
289 |
-+ */ |
290 |
-+ |
291 |
-+#ifndef _MUSL_H_ |
292 |
-+#define _MUSL_H_ |
293 |
-+ |
294 |
-+#include <unistd.h> |
295 |
-+#include <sys/syscall.h> |
296 |
-+ |
297 |
-+/* |
298 |
-+ * Musl someshow defines sched_* to ENOSYS which is not correct ... |
299 |
-+ * See commit 1e21e78bf7a5 ("add support for thread scheduling (POSIX TPS option)") |
300 |
-+ * |
301 |
-+ * Workaround: define them to syscall(...) |
302 |
-+ */ |
303 |
-+ |
304 |
-+#define sched_getparam(pid, param) \ |
305 |
-+ syscall(SYS_sched_getparam, pid, param) |
306 |
-+#define sched_setparam(pid, param) \ |
307 |
-+ syscall(SYS_sched_setparam, pid, param) |
308 |
-+#define sched_getscheduler(pid) \ |
309 |
-+ syscall(SYS_sched_getscheduler, pid) |
310 |
-+#define sched_setscheduler(pid, policy, param) \ |
311 |
-+ syscall(SYS_sched_setscheduler, pid, policy, param) |
312 |
-+ |
313 |
-+#endif /* _MUSL_H_ */ |
314 |
---- a/src/lib/rt-utils.c |
315 |
-+++ b/src/lib/rt-utils.c |
316 |
-@@ -24,6 +24,7 @@ |
317 |
- #include <time.h> |
318 |
- #include <sys/time.h> |
319 |
- |
320 |
-+#include "musl.h" |
321 |
- #include "rt-utils.h" |
322 |
- #include "rt-sched.h" |
323 |
- #include "rt-error.h" |
324 |
---- a/src/pi_tests/classic_pi.c |
325 |
-+++ b/src/pi_tests/classic_pi.c |
326 |
-@@ -34,6 +34,8 @@ |
327 |
- #include <signal.h> |
328 |
- #include <getopt.h> |
329 |
- |
330 |
-+#include "musl.h" |
331 |
-+ |
332 |
- /* test timeout */ |
333 |
- #define TIMEOUT 2 |
334 |
- |
335 |
---- a/src/pi_tests/tst-mutexpi10.c |
336 |
-+++ b/src/pi_tests/tst-mutexpi10.c |
337 |
-@@ -35,6 +35,8 @@ |
338 |
- #include <string.h> |
339 |
- #include <signal.h> |
340 |
- |
341 |
-+#include "musl.h" |
342 |
-+ |
343 |
- /* test timeout */ |
344 |
- #define TIMEOUT 2 |
345 |
- |
346 |
---- a/src/pmqtest/pmqtest.c |
347 |
-+++ b/src/pmqtest/pmqtest.c |
348 |
-@@ -24,6 +24,7 @@ |
349 |
- #include <pthread.h> |
350 |
- #include <inttypes.h> |
351 |
- |
352 |
-+#include "musl.h" |
353 |
- #include "rt-utils.h" |
354 |
- #include "rt-get_cpu.h" |
355 |
- #include "rt-error.h" |
356 |
---- a/src/ptsematest/ptsematest.c |
357 |
-+++ b/src/ptsematest/ptsematest.c |
358 |
-@@ -22,6 +22,7 @@ |
359 |
- #include <pthread.h> |
360 |
- #include <inttypes.h> |
361 |
- |
362 |
-+#include "musl.h" |
363 |
- #include "rt-utils.h" |
364 |
- #include "rt-get_cpu.h" |
365 |
- #include "rt-error.h" |
366 |
---- a/src/rt-migrate-test/rt-migrate-test.c |
367 |
-+++ b/src/rt-migrate-test/rt-migrate-test.c |
368 |
-@@ -27,6 +27,7 @@ |
369 |
- |
370 |
- #include <linux/unistd.h> |
371 |
- |
372 |
-+#include "musl.h" |
373 |
- #include "rt-utils.h" |
374 |
- |
375 |
- int nr_tasks; |
376 |
---- a/src/sched_deadline/cyclicdeadline.c |
377 |
-+++ b/src/sched_deadline/cyclicdeadline.c |
378 |
-@@ -30,6 +30,7 @@ |
379 |
- #include <linux/unistd.h> |
380 |
- #include <linux/magic.h> |
381 |
- |
382 |
-+#include "musl.h" |
383 |
- #include "rt-utils.h" |
384 |
- #include "rt-sched.h" |
385 |
- #include "rt-error.h" |
386 |
|
387 |
diff --git a/dev-util/rt-tests/rt-tests-2.2.ebuild b/dev-util/rt-tests/rt-tests-2.2.ebuild |
388 |
deleted file mode 100644 |
389 |
index 247753110450..000000000000 |
390 |
--- a/dev-util/rt-tests/rt-tests-2.2.ebuild |
391 |
+++ /dev/null |
392 |
@@ -1,38 +0,0 @@ |
393 |
-# Copyright 1999-2021 Gentoo Authors |
394 |
-# Distributed under the terms of the GNU General Public License v2 |
395 |
- |
396 |
-EAPI=8 |
397 |
- |
398 |
-PYTHON_COMPAT=( python3_{7..10} ) |
399 |
- |
400 |
-inherit python-single-r1 toolchain-funcs |
401 |
- |
402 |
-DESCRIPTION="A collection of latency testing tools for the linux(-rt) kernel" |
403 |
-HOMEPAGE="https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/about/" |
404 |
-SRC_URI=" |
405 |
- https://kernel.org/pub/linux/utils/rt-tests/${P}.tar.xz |
406 |
- https://kernel.org/pub/linux/utils/rt-tests/older/${P}.tar.xz" |
407 |
- |
408 |
-LICENSE="GPL-2 GPL-2+ LGPL-2.1+" |
409 |
-SLOT="0" |
410 |
-KEYWORDS="~amd64 ~arm64 ~x86" |
411 |
-REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
412 |
- |
413 |
-DEPEND="${PYTHON_DEPS} |
414 |
- sys-process/numactl" |
415 |
-RDEPEND="${DEPEND}" |
416 |
- |
417 |
-src_prepare() { |
418 |
- default |
419 |
- use elibc_musl && eapply "${FILESDIR}/${P}-musl.patch" |
420 |
-} |
421 |
- |
422 |
-src_compile() { |
423 |
- emake CC="$(tc-getCC)" AR="$(tc-getAR)" |
424 |
-} |
425 |
- |
426 |
-src_install() { |
427 |
- emake CC="$(tc-getCC)" prefix=/usr DESTDIR="${ED}" install |
428 |
- python_fix_shebang "${ED}" |
429 |
- python_optimize |
430 |
-} |