From 99995c94c01b6d74165c7ee31be36275846b14b8 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 27 Dec 2023 13:40:07 +0000 Subject: gentoo auto-resync : 27:12:2023 - 13:40:07 --- dev-util/Manifest.gz | Bin 70553 -> 70556 bytes dev-util/rt-tests/Manifest | 6 +- dev-util/rt-tests/files/rt-tests-2.5-musl.patch | 342 ------------------------ dev-util/rt-tests/files/rt-tests-2.6-musl.patch | 342 ++++++++++++++++++++++++ dev-util/rt-tests/rt-tests-2.5.ebuild | 38 --- dev-util/rt-tests/rt-tests-2.6.ebuild | 38 +++ 6 files changed, 383 insertions(+), 383 deletions(-) delete mode 100644 dev-util/rt-tests/files/rt-tests-2.5-musl.patch create mode 100644 dev-util/rt-tests/files/rt-tests-2.6-musl.patch delete mode 100644 dev-util/rt-tests/rt-tests-2.5.ebuild create mode 100644 dev-util/rt-tests/rt-tests-2.6.ebuild (limited to 'dev-util') diff --git a/dev-util/Manifest.gz b/dev-util/Manifest.gz index b5d937c57693..fc0850ec0a8f 100644 Binary files a/dev-util/Manifest.gz and b/dev-util/Manifest.gz differ diff --git a/dev-util/rt-tests/Manifest b/dev-util/rt-tests/Manifest index b21c4ba9429d..d09b0363c9b4 100644 --- a/dev-util/rt-tests/Manifest +++ b/dev-util/rt-tests/Manifest @@ -1,4 +1,4 @@ -AUX rt-tests-2.5-musl.patch 9421 BLAKE2B 5794f6643d3144a3f8e92cff1baf44acc5a41033e50026ef44bbbb2508558d8b39c8a1db03d7dcdef2cfcbd5ad02b935cc339f0a2a12ebc6704a27b49069f0ba SHA512 1f0572642ce8116b024b8b663e9208ebadce5a0ac004888d2bf2592de749d2877246fca39227576663336a4ec583432ad0fc5bbf6bc4f589e1d4273b655b5f8a -DIST rt-tests-2.5.tar.xz 104596 BLAKE2B 3c03be9fb58ede744b6521cd74cef923f667c94ad8a3abb3d88efa7733f7672c8151b22e122499d1811f16ccd5a9335110eeb6c7c722c9899c369c912112f3b2 SHA512 a9966b6da89a9778f668faee5c347024a43bf978826bf16f0f8034acbf383eb688c6962e1de80e7efd34a5a0c67cb7c37ed5822979676b76a1e725d620bfd391 -EBUILD rt-tests-2.5.ebuild 915 BLAKE2B 8cc1000c58ff0a3b17bb5f2e99eae5f06773ebaa288d8944754740ddd0eb5ad3f27f5cce7431fddb235797e7244761ed77682fe812212c015541d207f79d82cd SHA512 8d3970b6b63fdf21bb2188d25a0eda95ccf1d819276f0759f5d3bb0496c248bb1606e5383214734b726a6a8b499cd851691d54db9a8988cc55d50557b9115be4 +AUX rt-tests-2.6-musl.patch 9421 BLAKE2B 22f514733f35878c9c62d154cf73d9552701e502bb282813eea533dfc7afa601fbfde108f754dd5b679c05e3dd19638995ff46f4d8172eefabc15941005ed2ee SHA512 5dacb334f3c3d26de59fcadfb90ed674f48813d986cbdf28ae93c9f85ac43c2c4d50ca0e9e40ebc68df4a829a1bae500c9a9f3c5c6f51715d6162aa1ccf31e1d +DIST rt-tests-2.6.tar.xz 104996 BLAKE2B 40b898a0ecf512eafafa277857566cea358277f4fd6aca2595077409dbbb1c2eb4c7ed5ea1b61a378506eca4f989527d7c5fb94d9c3a16d7b0286cc940496cc8 SHA512 0cfb93ef8718b8e291a23963ef8e5bf1092b5f1c377f220d35005c0fdc7982ac074da824cb26ad5b2c71a2ebadd8bf753259c6f3ca9e00f42d9198e2dbc5999a +EBUILD rt-tests-2.6.ebuild 916 BLAKE2B 3efa9208ac022f4f5b4cffc28108db7208d9427699eec5772aa90141f5d3498217786c14dc66e144ee1c197a6387a6f3d849170ef3fee46cb99e52db38865668 SHA512 c2efab311a237d2e61ea6a80d6750abe56a039cbfbbc0bdcdaedaf6b256e217f6f12a04e7941ec0358d2f434420ccdb61b24e55b61574562b1ffc0ffa4ae3516 MISC metadata.xml 837 BLAKE2B b0d50d18a087e0e3adde1eeeeec4f9e3cf69d921d893c5f26f9205979d53cb3fb67c66da49a19646f00463456337edfa6482a129ba6f53bdefcc083b6420a4c8 SHA512 943f07d2ac45ada4c0e961f43543c7f8f5a1e96ae6a69e8e4f99ca47f7e43a8ca2525a299f9451b0877349542955e6428e6029dfae8e30e67ca970b883eb04d7 diff --git a/dev-util/rt-tests/files/rt-tests-2.5-musl.patch b/dev-util/rt-tests/files/rt-tests-2.5-musl.patch deleted file mode 100644 index a7aca4392ebb..000000000000 --- a/dev-util/rt-tests/files/rt-tests-2.5-musl.patch +++ /dev/null @@ -1,342 +0,0 @@ -From 0b7a1e0d3463aa8aa4b7dcad0ec154e658d68036 Mon Sep 17 00:00:00 2001 -From: Kurt Kanzenbach -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 ---- - Makefile | 5 -- - src/backfire/sendme.c | 1 - src/cyclictest/cyclictest.c | 68 ++++------------------------------ - src/hackbench/hackbench.c | 4 +- - src/include/musl.h | 28 ++++++++++++++ - src/lib/rt-utils.c | 1 - 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 - 11 files changed, 47 insertions(+), 66 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 - #include - #include -+#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 - #include - #include -+#include "musl.h" - #include "rt_numa.h" - - #include "rt-utils.h" -@@ -546,12 +547,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 = { 0 }; -- struct itimerval itimer; -- struct itimerspec tspec; - struct thread_stat *stat = par->stats; - int stopped = 0; - cpu_set_t mask; -@@ -580,14 +577,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)) -@@ -641,20 +630,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++; - -@@ -662,16 +637,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, -@@ -792,11 +761,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)) { -@@ -821,17 +785,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); -@@ -1227,7 +1180,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; -@@ -1260,13 +1214,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(); -@@ -1991,7 +1938,6 @@ int main(int argc, char **argv) - - } - -- - mode = use_nanosleep + use_system; - - sigemptyset(&sigset); -@@ -2042,6 +1988,7 @@ int main(int argc, char **argv) - void *currstk; - size_t stksize; - int node_cpu = cpu; -+ int err; - - if (node_cpu == -1) - node_cpu = cpu_for_thread_ua(i, max_cpus); -@@ -2050,11 +1997,12 @@ int main(int argc, char **argv) - node = rt_numa_numa_node_of_cpu(node_cpu); - - /* get the stack size set for this thread */ -- if (pthread_attr_getstack(&attr, &currstk, &stksize)) -+ 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 -@@ -25,7 +25,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -@@ -34,6 +34,8 @@ - #include - #include - -+#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 -+ * Time-stamp: <2020-04-04 10:54:01 kurt> -+ */ -+ -+#ifndef _MUSL_H_ -+#define _MUSL_H_ -+ -+#include -+#include -+ -+/* -+ * 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 - #include - -+#include "musl.h" - #include "rt-utils.h" - #include "rt-sched.h" - #include "rt-error.h" ---- a/src/pi_tests/tst-mutexpi10.c -+++ b/src/pi_tests/tst-mutexpi10.c -@@ -35,6 +35,8 @@ - #include - #include - -+#include "musl.h" -+ - /* test timeout */ - #define TIMEOUT 2 - ---- a/src/pmqtest/pmqtest.c -+++ b/src/pmqtest/pmqtest.c -@@ -24,6 +24,7 @@ - #include - #include - -+#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 - #include - -+#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 - -+#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 - #include - -+#include "musl.h" - #include "rt-utils.h" - #include "rt-sched.h" - #include "rt-error.h" diff --git a/dev-util/rt-tests/files/rt-tests-2.6-musl.patch b/dev-util/rt-tests/files/rt-tests-2.6-musl.patch new file mode 100644 index 000000000000..830f31184fe4 --- /dev/null +++ b/dev-util/rt-tests/files/rt-tests-2.6-musl.patch @@ -0,0 +1,342 @@ +From 0b7a1e0d3463aa8aa4b7dcad0ec154e658d68036 Mon Sep 17 00:00:00 2001 +From: Kurt Kanzenbach +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 +--- + Makefile | 5 -- + src/backfire/sendme.c | 1 + src/cyclictest/cyclictest.c | 68 ++++------------------------------ + src/hackbench/hackbench.c | 4 +- + src/include/musl.h | 28 ++++++++++++++ + src/lib/rt-utils.c | 1 + 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 + 11 files changed, 47 insertions(+), 66 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 + #include + #include ++#include "musl.h" + #include "rt-utils.h" + #include "rt-get_cpu.h" + +--- a/src/cyclictest/cyclictest.c ++++ b/src/cyclictest/cyclictest.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include "musl.h" + #include "rt_numa.h" + + #include "rt-utils.h" +@@ -545,12 +546,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 = { 0 }; +- struct itimerval itimer; +- struct itimerspec tspec; + struct thread_stat *stat = par->stats; + int stopped = 0; + cpu_set_t mask; +@@ -579,14 +576,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)) +@@ -640,20 +629,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++; + +@@ -661,16 +636,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, +@@ -791,11 +760,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)) { +@@ -820,17 +784,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); +@@ -1226,7 +1179,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; +@@ -1259,13 +1213,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(); +@@ -1988,7 +1935,6 @@ int main(int argc, char **argv) + + } + +- + mode = use_nanosleep + use_system; + + sigemptyset(&sigset); +@@ -2039,6 +1985,7 @@ int main(int argc, char **argv) + void *currstk; + size_t stksize; + int node_cpu = cpu; ++ int err; + + if (node_cpu == -1) + node_cpu = cpu_for_thread_ua(i, max_cpus); +@@ -2047,11 +1994,12 @@ int main(int argc, char **argv) + node = rt_numa_numa_node_of_cpu(node_cpu); + + /* get the stack size set for this thread */ +- if (pthread_attr_getstack(&attr, &currstk, &stksize)) ++ 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 +@@ -25,7 +25,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +@@ -34,6 +34,8 @@ + #include + #include + ++#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 ++ * Time-stamp: <2020-04-04 10:54:01 kurt> ++ */ ++ ++#ifndef _MUSL_H_ ++#define _MUSL_H_ ++ ++#include ++#include ++ ++/* ++ * 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 + #include + ++#include "musl.h" + #include "rt-utils.h" + #include "rt-sched.h" + #include "rt-error.h" +--- a/src/pi_tests/tst-mutexpi10.c ++++ b/src/pi_tests/tst-mutexpi10.c +@@ -35,6 +35,8 @@ + #include + #include + ++#include "musl.h" ++ + /* test timeout */ + #define TIMEOUT 2 + +--- a/src/pmqtest/pmqtest.c ++++ b/src/pmqtest/pmqtest.c +@@ -24,6 +24,7 @@ + #include + #include + ++#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 + #include + ++#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 + ++#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 + #include + ++#include "musl.h" + #include "rt-utils.h" + #include "rt-sched.h" + #include "rt-error.h" diff --git a/dev-util/rt-tests/rt-tests-2.5.ebuild b/dev-util/rt-tests/rt-tests-2.5.ebuild deleted file mode 100644 index 503b4965a276..000000000000 --- a/dev-util/rt-tests/rt-tests-2.5.ebuild +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{9..11} ) - -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/" -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 CC="$(tc-getCC)" prefix=/usr DESTDIR="${ED}" install - python_fix_shebang "${ED}" - python_optimize -} diff --git a/dev-util/rt-tests/rt-tests-2.6.ebuild b/dev-util/rt-tests/rt-tests-2.6.ebuild new file mode 100644 index 000000000000..91afebe3ca79 --- /dev/null +++ b/dev-util/rt-tests/rt-tests-2.6.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) + +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/" +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 CC="$(tc-getCC)" prefix=/usr DESTDIR="${ED}" install + python_fix_shebang "${ED}" + python_optimize +} -- cgit v1.2.3