diff options
author | Kurt Kanzenbach <kurt@kmk-computers.de> | 2021-07-04 08:52:18 +0200 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2021-07-14 17:32:41 +0300 |
commit | ab611d79e64413cfc6f6b527ad4f7cce1c4a83e1 (patch) | |
tree | edd20618504207698beed245e189e6fcb9b48746 /dev-util/rt-tests | |
parent | dev-util/rt-tests: Bump to v2.1 (diff) | |
download | gentoo-ab611d79e64413cfc6f6b527ad4f7cce1c4a83e1.tar.gz gentoo-ab611d79e64413cfc6f6b527ad4f7cce1c4a83e1.tar.bz2 gentoo-ab611d79e64413cfc6f6b527ad4f7cce1c4a83e1.zip |
dev-util/rt-tests: Drop old
Package-Manager: Portage-3.0.20, Repoman-3.0.2
Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
Closes: https://github.com/gentoo/gentoo/pull/21460
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'dev-util/rt-tests')
-rw-r--r-- | dev-util/rt-tests/Manifest | 2 | ||||
-rw-r--r-- | dev-util/rt-tests/files/rt-tests-1.10-musl.patch | 381 | ||||
-rw-r--r-- | dev-util/rt-tests/files/rt-tests-2.0-musl.patch | 352 | ||||
-rw-r--r-- | dev-util/rt-tests/rt-tests-1.10.ebuild | 38 | ||||
-rw-r--r-- | dev-util/rt-tests/rt-tests-2.0.ebuild | 38 |
5 files changed, 0 insertions, 811 deletions
diff --git a/dev-util/rt-tests/Manifest b/dev-util/rt-tests/Manifest index aa57879e2540..7b3e4970e1ae 100644 --- a/dev-util/rt-tests/Manifest +++ b/dev-util/rt-tests/Manifest @@ -1,3 +1 @@ -DIST rt-tests-1.10.tar.xz 112300 BLAKE2B b38a7357b1402de94661014e71ed9fc48d9dde6cabbe72ed4031841b57f7fb76a01dda03c7888f11d8e5e9c11cda8281dae1b437f0d1ff971d2941547f659103 SHA512 9512419b364746ad490894c7184a391f0e8d571477ad636abff8ed473151c6f2c263475ca4aa7d498e81c18e17e42ae82260693b90bce4ef9889e0eaf0b77b58 -DIST rt-tests-2.0.tar.xz 114944 BLAKE2B 809224e6d480b098ed398c0646070f18aa25e8947485709ff309c4a2ee289797924e6df39ac2af68b91b2df064642d56bd8f7aa7332764d95d53e7d9a34d4ca7 SHA512 6c582734eb41f7addaac7d0f3dbb313e3af30eb2b662781f6c62dbaf13da2e84f36a6f918f11608406ca2a08636df93375272444a2cdf205e782ec9f4bc45dca DIST rt-tests-2.1.tar.xz 114892 BLAKE2B 25a382c898ffdbbe7b6c3f69f440b87ca6b88cc634aae06a3e02154954b8b50da46e2f2b3291d7473bb0ae533f5a90a7769433650bab3f7c229a5d3022e32b50 SHA512 7abab6c1191247ac44f4e5193752474756d82fdf1d8a3b69c92c8d37bd4fe8458444d2165894fc8483590809ff5b4f1c755d66afb296e72041f9efbedd048d0d diff --git a/dev-util/rt-tests/files/rt-tests-1.10-musl.patch b/dev-util/rt-tests/files/rt-tests-1.10-musl.patch deleted file mode 100644 index 2dc17d504922..000000000000 --- a/dev-util/rt-tests/files/rt-tests-1.10-musl.patch +++ /dev/null @@ -1,381 +0,0 @@ -From 0b7a1e0d3463aa8aa4b7dcad0ec154e658d68036 Mon Sep 17 00:00:00 2001 -From: Kurt Kanzenbach <kurt@kmk-computers.de> -Date: Wed, 1 Apr 2020 20:15:24 +0200 -Subject: [PATCH] all: Fix musl build - -There are a few problems: - - * pi stress: pthread_attr_setaffinity_np() is not supported - * cyclictest: SIGEV_THREAD_ID is not supported - * hackbench: Fix include - * all: Fix sched_* calls - -With these changes applied, the rt-tests seem to run fine. - -Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de> ---- - Makefile | 5 -- - src/backfire/sendme.c | 1 + - src/cyclictest/cyclictest.c | 70 ++++----------------------- - src/hackbench/hackbench.c | 4 +- - src/include/musl.h | 28 +++++++++++ - src/lib/rt-utils.c | 1 + - src/pi_tests/classic_pi.c | 2 + - src/pi_tests/tst-mutexpi10.c | 2 + - src/pmqtest/pmqtest.c | 1 + - src/ptsematest/ptsematest.c | 1 + - src/rt-migrate-test/rt-migrate-test.c | 1 + - src/sched_deadline/cyclicdeadline.c | 2 + - 12 files changed, 51 insertions(+), 67 deletions(-) - create mode 100644 src/include/musl.h - -diff --git a/Makefile b/Makefile -index 636f1914a777..01732ee2647f 100644 ---- a/Makefile -+++ b/Makefile -@@ -7,7 +7,6 @@ OBJDIR = bld - sources = cyclictest.c \ - hackbench.c \ - pip_stress.c \ -- pi_stress.c \ - pmqtest.c \ - ptsematest.c \ - rt-migrate-test.c \ -@@ -42,7 +41,6 @@ ifeq (${PYLIB},) - endif - - MANPAGES = src/cyclictest/cyclictest.8 \ -- src/pi_tests/pi_stress.8 \ - src/ptsematest/ptsematest.8 \ - src/rt-migrate-test/rt-migrate-test.8 \ - src/sigwaittest/sigwaittest.8 \ -@@ -130,9 +128,6 @@ deadline_test: $(OBJDIR)/deadline_test.o $(OBJDIR)/librttest.a - signaltest: $(OBJDIR)/signaltest.o $(OBJDIR)/librttest.a $(OBJDIR)/librttestnuma.a - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(RTTESTNUMA) - --pi_stress: $(OBJDIR)/pi_stress.o $(OBJDIR)/librttest.a -- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) -- - hwlatdetect: src/hwlatdetect/hwlatdetect.py - chmod +x src/hwlatdetect/hwlatdetect.py - ln -s src/hwlatdetect/hwlatdetect.py hwlatdetect -diff --git a/src/backfire/sendme.c b/src/backfire/sendme.c -index d963723b1c93..b355bbbcfece 100644 ---- a/src/backfire/sendme.c -+++ b/src/backfire/sendme.c -@@ -31,6 +31,7 @@ - #include <errno.h> - #include "rt-utils.h" - #include "rt-get_cpu.h" -+#include "musl.h" - - #include <utmpx.h> - #include <sys/types.h> -diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c -index f38c453f1975..b6b91218f756 100644 ---- a/src/cyclictest/cyclictest.c -+++ b/src/cyclictest/cyclictest.c -@@ -37,6 +37,7 @@ - - #include "rt-utils.h" - #include "rt-numa.h" -+#include "musl.h" - - #include <bionic.h> - -@@ -500,12 +501,8 @@ static void *timerthread(void *param) - { - struct thread_param *par = param; - struct sched_param schedp; -- struct sigevent sigev; - sigset_t sigset; -- timer_t timer; - struct timespec now, next, interval, stop; -- struct itimerval itimer; -- struct itimerspec tspec; - struct thread_stat *stat = par->stats; - int stopped = 0; - cpu_set_t mask; -@@ -536,14 +533,6 @@ static void *timerthread(void *param) - sigaddset(&sigset, par->signal); - sigprocmask(SIG_BLOCK, &sigset, NULL); - -- if (par->mode == MODE_CYCLIC) { -- sigev.sigev_notify = SIGEV_THREAD_ID | SIGEV_SIGNAL; -- sigev.sigev_signo = par->signal; -- sigev.sigev_notify_thread_id = stat->tid; -- timer_create(par->clock, &sigev, &timer); -- tspec.it_interval = interval; -- } -- - memset(&schedp, 0, sizeof(schedp)); - schedp.sched_priority = par->prio; - if (setscheduler(0, par->policy, &schedp)) -@@ -598,20 +587,6 @@ static void *timerthread(void *param) - stop = now; - stop.tv_sec += duration; - } -- if (par->mode == MODE_CYCLIC) { -- if (par->timermode == TIMER_ABSTIME) -- tspec.it_value = next; -- else -- tspec.it_value = interval; -- timer_settime(timer, par->timermode, &tspec, NULL); -- } -- -- if (par->mode == MODE_SYS_ITIMER) { -- itimer.it_interval.tv_sec = interval.tv_sec; -- itimer.it_interval.tv_usec = interval.tv_nsec / 1000; -- itimer.it_value = itimer.it_interval; -- setitimer(ITIMER_REAL, &itimer, NULL); -- } - - stat->threadstarted++; - -@@ -619,16 +594,10 @@ static void *timerthread(void *param) - - uint64_t diff; - unsigned long diff_smi = 0; -- int sigs, ret; -+ int ret; - - /* Wait for next period */ - switch (par->mode) { -- case MODE_CYCLIC: -- case MODE_SYS_ITIMER: -- if (sigwait(&sigset, &sigs) < 0) -- goto out; -- break; -- - case MODE_CLOCK_NANOSLEEP: - if (par->timermode == TIMER_ABSTIME) { - ret = clock_nanosleep(par->clock, TIMER_ABSTIME, -@@ -749,11 +718,6 @@ static void *timerthread(void *param) - - next.tv_sec += interval.tv_sec; - next.tv_nsec += interval.tv_nsec; -- if (par->mode == MODE_CYCLIC) { -- int overrun_count = timer_getoverrun(timer); -- next.tv_sec += overrun_count * interval.tv_sec; -- next.tv_nsec += overrun_count * interval.tv_nsec; -- } - tsnorm(&next); - - while (tsgreater(&now, &next)) { -@@ -778,17 +742,6 @@ out: - pthread_mutex_unlock(&refresh_on_max_lock); - } - -- if (par->mode == MODE_CYCLIC) -- timer_delete(timer); -- -- if (par->mode == MODE_SYS_ITIMER) { -- itimer.it_value.tv_sec = 0; -- itimer.it_value.tv_usec = 0; -- itimer.it_interval.tv_sec = 0; -- itimer.it_interval.tv_usec = 0; -- setitimer(ITIMER_REAL, &itimer, NULL); -- } -- - /* close msr file */ - if (smi) - close(par->msr_fd); -@@ -1159,7 +1112,8 @@ static void process_options(int argc, char *argv[], int max_cpus) - case OPT_VERBOSE: verbose = 1; break; - case 'x': - case OPT_POSIX_TIMERS: -- use_nanosleep = MODE_CYCLIC; break; -+ fatal("--posix_timers is not available on your libc\n"); -+ break; - case '?': - case OPT_HELP: - display_help(0); break; -@@ -1192,13 +1146,6 @@ static void process_options(int argc, char *argv[], int max_cpus) - } - } - -- if ((use_system == MODE_SYS_OFFSET) && (use_nanosleep == MODE_CYCLIC)) { -- warn("The system option requires clock_nanosleep\n"); -- warn("and is not compatible with posix_timers\n"); -- warn("Using clock_nanosleep\n"); -- use_nanosleep = MODE_CLOCK_NANOSLEEP; -- } -- - /* if smp wasn't requested, test for numa automatically */ - if (!smp) { - if (numa_initialize()) -@@ -1881,7 +1828,6 @@ int main(int argc, char **argv) - - } - -- - mode = use_nanosleep + use_system; - - sigemptyset(&sigset); -@@ -1931,16 +1877,18 @@ int main(int argc, char **argv) - void *stack; - void *currstk; - size_t stksize; -+ int err; - - /* find the memory node associated with the cpu i */ - node = rt_numa_numa_node_of_cpu(cpu); - -- /* get the stack size set for this thread */ -- if (pthread_attr_getstack(&attr, &currstk, &stksize)) -+ /* get the stack size set for for this thread */ -+ err = pthread_attr_getstack(&attr, &currstk, &stksize); -+ if (err != EINVAL) - fatal("failed to get stack size for thread %d\n", i); - - /* if the stack size is zero, set a default */ -- if (stksize == 0) -+ if (err == EINVAL || stksize == 0) - stksize = PTHREAD_STACK_MIN * 2; - - /* allocate memory for a stack on appropriate node */ -diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c -index 268c23233004..bbbb29a3a430 100644 ---- a/src/hackbench/hackbench.c -+++ b/src/hackbench/hackbench.c -@@ -24,13 +24,15 @@ - #include <sys/socket.h> - #include <sys/wait.h> - #include <sys/time.h> --#include <sys/poll.h> -+#include <poll.h> - #include <limits.h> - #include <getopt.h> - #include <signal.h> - #include <setjmp.h> - #include <sched.h> - -+#include "musl.h" -+ - static unsigned int datasize = 100; - static unsigned int loops = 100; - static unsigned int num_groups = 10; -diff --git a/src/include/musl.h b/src/include/musl.h -new file mode 100644 -index 000000000000..ea5075e768c8 ---- /dev/null -+++ b/src/include/musl.h -@@ -0,0 +1,28 @@ -+/* -+ * Copyright (C) 2020 Kurt Kanzenbach <kurt@kmk-computers.de> -+ * Time-stamp: <2020-04-04 10:54:01 kurt> -+ */ -+ -+#ifndef _MUSL_H_ -+#define _MUSL_H_ -+ -+#include <unistd.h> -+#include <sys/syscall.h> -+ -+/* -+ * Musl someshow defines sched_* to ENOSYS which is not correct ... -+ * See commit 1e21e78bf7a5 ("add support for thread scheduling (POSIX TPS option)") -+ * -+ * Workaround: define them to syscall(...) -+ */ -+ -+#define sched_getparam(pid, param) \ -+ syscall(SYS_sched_getparam, pid, param) -+#define sched_setparam(pid, param) \ -+ syscall(SYS_sched_setparam, pid, param) -+#define sched_getscheduler(pid) \ -+ syscall(SYS_sched_getscheduler, pid) -+#define sched_setscheduler(pid, policy, param) \ -+ syscall(SYS_sched_setscheduler, pid, policy, param) -+ -+#endif /* _MUSL_H_ */ -diff --git a/src/lib/rt-utils.c b/src/lib/rt-utils.c -index 2d68d62cd875..529d427c8084 100644 ---- a/src/lib/rt-utils.c -+++ b/src/lib/rt-utils.c -@@ -23,6 +23,7 @@ - #include "rt-utils.h" - #include "rt-sched.h" - #include "error.h" -+#include "musl.h" - - #define TRACEBUFSIZ 1024 - -diff --git a/src/pi_tests/classic_pi.c b/src/pi_tests/classic_pi.c -index 64af8890276f..bb088d3973b2 100644 ---- a/src/pi_tests/classic_pi.c -+++ b/src/pi_tests/classic_pi.c -@@ -34,6 +34,8 @@ - #include <signal.h> - #include <getopt.h> - -+#include "musl.h" -+ - /* test timeout */ - #define TIMEOUT 2 - -diff --git a/src/pi_tests/tst-mutexpi10.c b/src/pi_tests/tst-mutexpi10.c -index 97a345edd26e..1028d344edff 100644 ---- a/src/pi_tests/tst-mutexpi10.c -+++ b/src/pi_tests/tst-mutexpi10.c -@@ -35,6 +35,8 @@ - #include <string.h> - #include <signal.h> - -+#include "musl.h" -+ - /* test timeout */ - #define TIMEOUT 2 - -diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c -index 5f7a24d55db6..555679cf36ef 100644 ---- a/src/pmqtest/pmqtest.c -+++ b/src/pmqtest/pmqtest.c -@@ -24,6 +24,7 @@ - #include "rt-utils.h" - #include "rt-get_cpu.h" - #include "error.h" -+#include "musl.h" - - #include <pthread.h> - -diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c -index 2e392299fdc4..b45d35755865 100644 ---- a/src/ptsematest/ptsematest.c -+++ b/src/ptsematest/ptsematest.c -@@ -22,6 +22,7 @@ - #include "rt-utils.h" - #include "rt-get_cpu.h" - #include "error.h" -+#include "musl.h" - - #include <pthread.h> - -diff --git a/src/rt-migrate-test/rt-migrate-test.c b/src/rt-migrate-test/rt-migrate-test.c -index 9bf716c9178c..f51d388d9150 100644 ---- a/src/rt-migrate-test/rt-migrate-test.c -+++ b/src/rt-migrate-test/rt-migrate-test.c -@@ -25,6 +25,7 @@ - #include <sched.h> - #include <pthread.h> - #include "rt-utils.h" -+#include "musl.h" - - int nr_tasks; - int lfd; -diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c -index 98eb367248ac..45b27f72a5a7 100644 ---- a/src/sched_deadline/cyclicdeadline.c -+++ b/src/sched_deadline/cyclicdeadline.c -@@ -34,6 +34,8 @@ - #include <rt-sched.h> - #include <error.h> - -+#include "musl.h" -+ - #define _STR(x) #x - #define STR(x) _STR(x) - #ifndef MAXPATH --- -2.26.2 - diff --git a/dev-util/rt-tests/files/rt-tests-2.0-musl.patch b/dev-util/rt-tests/files/rt-tests-2.0-musl.patch deleted file mode 100644 index 4c97c640a5cd..000000000000 --- a/dev-util/rt-tests/files/rt-tests-2.0-musl.patch +++ /dev/null @@ -1,352 +0,0 @@ -From 0b7a1e0d3463aa8aa4b7dcad0ec154e658d68036 Mon Sep 17 00:00:00 2001 -From: Kurt Kanzenbach <kurt@kmk-computers.de> -Date: Wed, 1 Apr 2020 20:15:24 +0200 -Subject: [PATCH] all: Fix musl build - -There are a few problems: - - * pi stress: pthread_attr_setaffinity_np() is not supported - * cyclictest: SIGEV_THREAD_ID is not supported - * hackbench: Fix include - * all: Fix sched_* calls - -With these changes applied, the rt-tests seem to run fine. - -Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de> ---- - Makefile | 5 -- - src/backfire/sendme.c | 1 - src/cyclictest/cyclictest.c | 70 ++++------------------------------ - src/hackbench/hackbench.c | 4 + - src/include/musl.h | 28 +++++++++++++ - src/lib/rt-utils.c | 1 - src/pi_tests/classic_pi.c | 2 - src/pi_tests/tst-mutexpi10.c | 2 - src/pmqtest/pmqtest.c | 1 - src/ptsematest/ptsematest.c | 1 - src/rt-migrate-test/rt-migrate-test.c | 1 - src/sched_deadline/cyclicdeadline.c | 1 - 12 files changed, 50 insertions(+), 67 deletions(-) - create mode 100644 src/include/musl.h - ---- a/Makefile -+++ b/Makefile -@@ -7,7 +7,6 @@ OBJDIR = bld - sources = cyclictest.c \ - hackbench.c \ - pip_stress.c \ -- pi_stress.c \ - pmqtest.c \ - ptsematest.c \ - rt-migrate-test.c \ -@@ -42,7 +41,6 @@ ifeq (${PYLIB},) - endif - - MANPAGES = src/cyclictest/cyclictest.8 \ -- src/pi_tests/pi_stress.8 \ - src/ptsematest/ptsematest.8 \ - src/rt-migrate-test/rt-migrate-test.8 \ - src/sigwaittest/sigwaittest.8 \ -@@ -130,9 +128,6 @@ deadline_test: $(OBJDIR)/deadline_test.o - signaltest: $(OBJDIR)/signaltest.o $(OBJDIR)/librttest.a $(OBJDIR)/librttestnuma.a - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(RTTESTNUMA) - --pi_stress: $(OBJDIR)/pi_stress.o $(OBJDIR)/librttest.a -- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) -- - hwlatdetect: src/hwlatdetect/hwlatdetect.py - chmod +x src/hwlatdetect/hwlatdetect.py - ln -s src/hwlatdetect/hwlatdetect.py hwlatdetect ---- a/src/backfire/sendme.c -+++ b/src/backfire/sendme.c -@@ -29,6 +29,7 @@ - #include <string.h> - #include <time.h> - #include <errno.h> -+#include "musl.h" - #include "rt-utils.h" - #include "rt-get_cpu.h" - ---- a/src/cyclictest/cyclictest.c -+++ b/src/cyclictest/cyclictest.c -@@ -33,6 +33,7 @@ - #include <sys/utsname.h> - #include <sys/mman.h> - #include <sys/syscall.h> -+#include "musl.h" - #include "rt_numa.h" - - #include "rt-utils.h" -@@ -502,12 +503,8 @@ static void *timerthread(void *param) - { - struct thread_param *par = param; - struct sched_param schedp; -- struct sigevent sigev; - sigset_t sigset; -- timer_t timer; - struct timespec now, next, interval, stop; -- struct itimerval itimer; -- struct itimerspec tspec; - struct thread_stat *stat = par->stats; - int stopped = 0; - cpu_set_t mask; -@@ -538,14 +535,6 @@ static void *timerthread(void *param) - sigaddset(&sigset, par->signal); - sigprocmask(SIG_BLOCK, &sigset, NULL); - -- if (par->mode == MODE_CYCLIC) { -- sigev.sigev_notify = SIGEV_THREAD_ID | SIGEV_SIGNAL; -- sigev.sigev_signo = par->signal; -- sigev.sigev_notify_thread_id = stat->tid; -- timer_create(par->clock, &sigev, &timer); -- tspec.it_interval = interval; -- } -- - memset(&schedp, 0, sizeof(schedp)); - schedp.sched_priority = par->prio; - if (setscheduler(0, par->policy, &schedp)) -@@ -600,20 +589,6 @@ static void *timerthread(void *param) - stop = now; - stop.tv_sec += duration; - } -- if (par->mode == MODE_CYCLIC) { -- if (par->timermode == TIMER_ABSTIME) -- tspec.it_value = next; -- else -- tspec.it_value = interval; -- timer_settime(timer, par->timermode, &tspec, NULL); -- } -- -- if (par->mode == MODE_SYS_ITIMER) { -- itimer.it_interval.tv_sec = interval.tv_sec; -- itimer.it_interval.tv_usec = interval.tv_nsec / 1000; -- itimer.it_value = itimer.it_interval; -- setitimer(ITIMER_REAL, &itimer, NULL); -- } - - rt_test_start(); - stat->threadstarted++; -@@ -622,16 +597,10 @@ static void *timerthread(void *param) - - uint64_t diff; - unsigned long diff_smi = 0; -- int sigs, ret; -+ int ret; - - /* Wait for next period */ - switch (par->mode) { -- case MODE_CYCLIC: -- case MODE_SYS_ITIMER: -- if (sigwait(&sigset, &sigs) < 0) -- goto out; -- break; -- - case MODE_CLOCK_NANOSLEEP: - if (par->timermode == TIMER_ABSTIME) { - ret = clock_nanosleep(par->clock, TIMER_ABSTIME, -@@ -752,11 +721,6 @@ static void *timerthread(void *param) - - next.tv_sec += interval.tv_sec; - next.tv_nsec += interval.tv_nsec; -- if (par->mode == MODE_CYCLIC) { -- int overrun_count = timer_getoverrun(timer); -- next.tv_sec += overrun_count * interval.tv_sec; -- next.tv_nsec += overrun_count * interval.tv_nsec; -- } - tsnorm(&next); - - while (tsgreater(&now, &next)) { -@@ -781,17 +745,6 @@ out: - pthread_mutex_unlock(&refresh_on_max_lock); - } - -- if (par->mode == MODE_CYCLIC) -- timer_delete(timer); -- -- if (par->mode == MODE_SYS_ITIMER) { -- itimer.it_value.tv_sec = 0; -- itimer.it_value.tv_usec = 0; -- itimer.it_interval.tv_sec = 0; -- itimer.it_interval.tv_usec = 0; -- setitimer(ITIMER_REAL, &itimer, NULL); -- } -- - /* close msr file */ - if (smi) - close(par->msr_fd); -@@ -1175,7 +1128,8 @@ static void process_options(int argc, ch - case OPT_VERBOSE: verbose = 1; break; - case 'x': - case OPT_POSIX_TIMERS: -- use_nanosleep = MODE_CYCLIC; break; -+ fatal("--posix_timers is not available on your libc\n"); -+ break; - case '?': - case OPT_HELP: - display_help(0); break; -@@ -1208,13 +1162,6 @@ static void process_options(int argc, ch - } - } - -- if ((use_system == MODE_SYS_OFFSET) && (use_nanosleep == MODE_CYCLIC)) { -- warn("The system option requires clock_nanosleep\n"); -- warn("and is not compatible with posix_timers\n"); -- warn("Using clock_nanosleep\n"); -- use_nanosleep = MODE_CLOCK_NANOSLEEP; -- } -- - /* if smp wasn't requested, test for numa automatically */ - if (!smp) { - numa = numa_initialize(); -@@ -1944,7 +1891,6 @@ int main(int argc, char **argv) - - } - -- - mode = use_nanosleep + use_system; - - sigemptyset(&sigset); -@@ -1994,16 +1940,18 @@ int main(int argc, char **argv) - void *stack; - void *currstk; - size_t stksize; -+ int err; - - /* find the memory node associated with the cpu i */ - node = rt_numa_numa_node_of_cpu(cpu); - -- /* get the stack size set for this thread */ -- if (pthread_attr_getstack(&attr, &currstk, &stksize)) -+ /* get the stack size set for for this thread */ -+ err = pthread_attr_getstack(&attr, &currstk, &stksize); -+ if (err != EINVAL) - fatal("failed to get stack size for thread %d\n", i); - - /* if the stack size is zero, set a default */ -- if (stksize == 0) -+ if (err == EINVAL || stksize == 0) - stksize = PTHREAD_STACK_MIN * 2; - - /* allocate memory for a stack on appropriate node */ ---- a/src/hackbench/hackbench.c -+++ b/src/hackbench/hackbench.c -@@ -24,13 +24,15 @@ - #include <sys/socket.h> - #include <sys/wait.h> - #include <sys/time.h> --#include <sys/poll.h> -+#include <poll.h> - #include <limits.h> - #include <getopt.h> - #include <signal.h> - #include <setjmp.h> - #include <sched.h> - -+#include "musl.h" -+ - static unsigned int datasize = 100; - static unsigned int loops = 100; - static unsigned int num_groups = 10; ---- /dev/null -+++ b/src/include/musl.h -@@ -0,0 +1,28 @@ -+/* -+ * Copyright (C) 2020 Kurt Kanzenbach <kurt@kmk-computers.de> -+ * Time-stamp: <2020-04-04 10:54:01 kurt> -+ */ -+ -+#ifndef _MUSL_H_ -+#define _MUSL_H_ -+ -+#include <unistd.h> -+#include <sys/syscall.h> -+ -+/* -+ * Musl someshow defines sched_* to ENOSYS which is not correct ... -+ * See commit 1e21e78bf7a5 ("add support for thread scheduling (POSIX TPS option)") -+ * -+ * Workaround: define them to syscall(...) -+ */ -+ -+#define sched_getparam(pid, param) \ -+ syscall(SYS_sched_getparam, pid, param) -+#define sched_setparam(pid, param) \ -+ syscall(SYS_sched_setparam, pid, param) -+#define sched_getscheduler(pid) \ -+ syscall(SYS_sched_getscheduler, pid) -+#define sched_setscheduler(pid, policy, param) \ -+ syscall(SYS_sched_setscheduler, pid, policy, param) -+ -+#endif /* _MUSL_H_ */ ---- a/src/lib/rt-utils.c -+++ b/src/lib/rt-utils.c -@@ -24,6 +24,7 @@ - #include <time.h> - #include <sys/time.h> - -+#include "musl.h" - #include "rt-utils.h" - #include "rt-sched.h" - #include "rt-error.h" ---- a/src/pi_tests/classic_pi.c -+++ b/src/pi_tests/classic_pi.c -@@ -34,6 +34,8 @@ - #include <signal.h> - #include <getopt.h> - -+#include "musl.h" -+ - /* test timeout */ - #define TIMEOUT 2 - ---- a/src/pi_tests/tst-mutexpi10.c -+++ b/src/pi_tests/tst-mutexpi10.c -@@ -35,6 +35,8 @@ - #include <string.h> - #include <signal.h> - -+#include "musl.h" -+ - /* test timeout */ - #define TIMEOUT 2 - ---- a/src/pmqtest/pmqtest.c -+++ b/src/pmqtest/pmqtest.c -@@ -24,6 +24,7 @@ - #include <pthread.h> - #include <inttypes.h> - -+#include "musl.h" - #include "rt-utils.h" - #include "rt-get_cpu.h" - #include "rt-error.h" ---- a/src/ptsematest/ptsematest.c -+++ b/src/ptsematest/ptsematest.c -@@ -22,6 +22,7 @@ - #include <pthread.h> - #include <inttypes.h> - -+#include "musl.h" - #include "rt-utils.h" - #include "rt-get_cpu.h" - #include "rt-error.h" ---- a/src/rt-migrate-test/rt-migrate-test.c -+++ b/src/rt-migrate-test/rt-migrate-test.c -@@ -27,6 +27,7 @@ - - #include <linux/unistd.h> - -+#include "musl.h" - #include "rt-utils.h" - - int nr_tasks; ---- a/src/sched_deadline/cyclicdeadline.c -+++ b/src/sched_deadline/cyclicdeadline.c -@@ -30,6 +30,7 @@ - #include <linux/unistd.h> - #include <linux/magic.h> - -+#include "musl.h" - #include "rt-utils.h" - #include "rt-sched.h" - #include "rt-error.h" diff --git a/dev-util/rt-tests/rt-tests-1.10.ebuild b/dev-util/rt-tests/rt-tests-1.10.ebuild deleted file mode 100644 index 22e1c39323e2..000000000000 --- a/dev-util/rt-tests/rt-tests-1.10.ebuild +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7..9} ) - -inherit python-single-r1 toolchain-funcs - -DESCRIPTION="A collection of latency testing tools for the linux(-rt) kernel" -HOMEPAGE="https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/about/" -SRC_URI=" - https://kernel.org/pub/linux/utils/rt-tests/${P}.tar.xz - https://kernel.org/pub/linux/utils/rt-tests/older/${P}.tar.xz" - -LICENSE="GPL-2 GPL-2+ LGPL-2.1+" -SLOT="0" -KEYWORDS="~amd64 ~arm64 ~x86" -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -DEPEND="${PYTHON_DEPS} - sys-process/numactl" -RDEPEND="${DEPEND}" - -src_prepare() { - default - use elibc_musl && eapply "${FILESDIR}/${P}-musl.patch" -} - -src_compile() { - emake CC="$(tc-getCC)" AR="$(tc-getAR)" -} - -src_install() { - emake prefix=/usr DESTDIR="${ED}" install - python_fix_shebang "${ED}" - python_optimize -} diff --git a/dev-util/rt-tests/rt-tests-2.0.ebuild b/dev-util/rt-tests/rt-tests-2.0.ebuild deleted file mode 100644 index 8f2df0599b23..000000000000 --- a/dev-util/rt-tests/rt-tests-2.0.ebuild +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7..10} ) - -inherit python-single-r1 toolchain-funcs - -DESCRIPTION="A collection of latency testing tools for the linux(-rt) kernel" -HOMEPAGE="https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/about/" -SRC_URI=" - https://kernel.org/pub/linux/utils/rt-tests/${P}.tar.xz - https://kernel.org/pub/linux/utils/rt-tests/older/${P}.tar.xz" - -LICENSE="GPL-2 GPL-2+ LGPL-2.1+" -SLOT="0" -KEYWORDS="~amd64 ~arm64 ~x86" -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -DEPEND="${PYTHON_DEPS} - sys-process/numactl" -RDEPEND="${DEPEND}" - -src_prepare() { - default - use elibc_musl && eapply "${FILESDIR}/${P}-musl.patch" -} - -src_compile() { - emake CC="$(tc-getCC)" AR="$(tc-getAR)" -} - -src_install() { - emake prefix=/usr DESTDIR="${ED}" install - python_fix_shebang "${ED}" - python_optimize -} |