From 76dd57798890211ad4fbf229d352382ed946d070 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 11 Mar 2025 08:05:38 +0000 Subject: [PATCH] import CS realtime-tests-2.8-4.el9 --- .gitignore | 2 +- .realtime-tests.metadata | 2 +- ...-variables-in-test-feature-in-quotes.patch | 33 +++ ...ackbench-removed-extra-use-of-optind.patch | 39 --- ...andle-lcpupower-flag-outside-LDFLAGS.patch | 45 +++ ...ch-properly-recognize-when-integer-a.patch | 70 ----- SOURCES/Enable-Werror.patch | 30 ++ .../Remove-unused-parameter-annotations.patch | 269 ++++++++++++++++++ SOURCES/Turn-off-Wunused-parameter.patch | 35 +++ SOURCES/pip_stress-Add-option-usleep.patch | 81 ++++++ SPECS/realtime-tests.spec | 36 ++- 11 files changed, 523 insertions(+), 119 deletions(-) create mode 100644 SOURCES/0001-rt-tests-Put-variables-in-test-feature-in-quotes.patch delete mode 100644 SOURCES/0001-rt-tests-hackbench-removed-extra-use-of-optind.patch create mode 100644 SOURCES/0002-rt-tests-Handle-lcpupower-flag-outside-LDFLAGS.patch delete mode 100644 SOURCES/0002-rt-tests-hackbench-properly-recognize-when-integer-a.patch create mode 100644 SOURCES/Enable-Werror.patch create mode 100644 SOURCES/Remove-unused-parameter-annotations.patch create mode 100644 SOURCES/Turn-off-Wunused-parameter.patch create mode 100644 SOURCES/pip_stress-Add-option-usleep.patch diff --git a/.gitignore b/.gitignore index 1804103..342d19b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/rt-tests-2.7.tar.xz +SOURCES/rt-tests-2.8.tar.xz diff --git a/.realtime-tests.metadata b/.realtime-tests.metadata index 79aeb90..e43caed 100644 --- a/.realtime-tests.metadata +++ b/.realtime-tests.metadata @@ -1 +1 @@ -6d64c51123fa798257459213a0b8788f898f1cb1 SOURCES/rt-tests-2.7.tar.xz +5d0eed772fbcd6198f45b2746e0a7477366b1984 SOURCES/rt-tests-2.8.tar.xz diff --git a/SOURCES/0001-rt-tests-Put-variables-in-test-feature-in-quotes.patch b/SOURCES/0001-rt-tests-Put-variables-in-test-feature-in-quotes.patch new file mode 100644 index 0000000..9518c03 --- /dev/null +++ b/SOURCES/0001-rt-tests-Put-variables-in-test-feature-in-quotes.patch @@ -0,0 +1,33 @@ +From cb0d857539d2fedc31533390021b600edb906352 Mon Sep 17 00:00:00 2001 +From: Tomas Glozar +Date: Wed, 4 Dec 2024 16:40:03 +0100 +Subject: [PATCH 1/2] rt-tests: Put variables in test-feature in quotes + +test-feature passes several variables (OBJDIR, CFLAGS, CPPFLAGS, +LDFLAGS) to make via a shell command from inside the Makefile. If there +are spaces in either of these, it gets parsed as a second argument +to make and feature detection fails. + +Add quotes around the values to prevent them being passed as multiple +arguments. + +Signed-off-by: Tomas Glozar +Signed-off-by: John Kacur +--- + feature/test-feature.mak | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/feature/test-feature.mak b/feature/test-feature.mak +index 0b3e51c..aef915a 100644 +--- a/feature/test-feature.mak ++++ b/feature/test-feature.mak +@@ -1,5 +1,5 @@ + # SPDX-License-Identifier: GPL-2.0-or-later + define test-feature +-$(shell $(MAKE) OBJDIR=$(OBJDIR) CFLAGS=$(CFLAGS) CPPFLAGS=$(CPPFLAGS) LDFLAGS=$(LDFLAGS) \ ++$(shell $(MAKE) OBJDIR="$(OBJDIR)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ + -f feature/Makefile feature-$1 clean >/dev/null 2>/dev/null; echo $$?) + endef +-- +2.43.5 + diff --git a/SOURCES/0001-rt-tests-hackbench-removed-extra-use-of-optind.patch b/SOURCES/0001-rt-tests-hackbench-removed-extra-use-of-optind.patch deleted file mode 100644 index d35dee7..0000000 --- a/SOURCES/0001-rt-tests-hackbench-removed-extra-use-of-optind.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 64c7f92979ded63ac5a19ea59e9b791e3da1fae4 Mon Sep 17 00:00:00 2001 -From: Anubhav Shelat -Date: Wed, 22 May 2024 10:43:46 -0400 -Subject: [PATCH 1/2] rt-tests: hackbench: removed extra use of optind - -Currently, using the -s option displays the usage message, even if the -option is properly used. - -This is because Commit 778a02b7c519 ("rt-tests: hackbench: drop incorrect -and unnecessary usage of optind") forgot to drop a use of optind when -processing option 's' which was fixed in this commit. - -Now the -s option works correctly with the proper arguments. - -Note: The next commit in this patchset fixes "ERROR: do not use -assignment in if condition" on line 459. - -Signed-off-by: Anubhav Shelat -Signed-off-by: John Kacur ---- - src/hackbench/hackbench.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c -index d4924b3cc129..fec8357bef81 100644 ---- a/src/hackbench/hackbench.c -+++ b/src/hackbench/hackbench.c -@@ -456,7 +456,7 @@ static void process_options(int argc, char *argv[]) - use_inet = 1; - break; - case 's': -- if (!(argv[optind] && (datasize = atoi(optarg)) > 0)) { -+ if ((datasize = atoi(optarg)) <= 0) { - fprintf(stderr, "%s: --datasize|-s requires an integer > 0\n", argv[0]); - print_usage_exit(1); - } --- -2.45.1 - diff --git a/SOURCES/0002-rt-tests-Handle-lcpupower-flag-outside-LDFLAGS.patch b/SOURCES/0002-rt-tests-Handle-lcpupower-flag-outside-LDFLAGS.patch new file mode 100644 index 0000000..32bf10e --- /dev/null +++ b/SOURCES/0002-rt-tests-Handle-lcpupower-flag-outside-LDFLAGS.patch @@ -0,0 +1,45 @@ +From 623f6908ef3bc8367661a2e1440dd8c5bee91397 Mon Sep 17 00:00:00 2001 +From: Tomas Glozar +Date: Wed, 4 Dec 2024 16:40:04 +0100 +Subject: [PATCH 2/2] rt-tests: Handle -lcpupower flag outside LDFLAGS + +The rt-tests Makefile adds -lcpupower to LDFLAGS if libcpupower support +is detected on the system. However, this does not work when LDFLAGS is +overwritten by an external source. + +Add separate variable LIBCPUPOWER to contain the flag and pass it to the +cyclictest linking phase. This also avoids unnecessarily passing the +flag to the linking of other rt-tests binaries which do not use +libcpupower. + +Signed-off-by: Tomas Glozar +Signed-off-by: John Kacur +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index f656e34..0fa0928 100644 +--- a/Makefile ++++ b/Makefile +@@ -43,7 +43,7 @@ PYLIB ?= $(shell python3 -m get_pylib) + ifneq ($(no_libcpupower), 1) + ifeq ($(call test-feature,libcpupower), 0) + CPPFLAGS += -DHAVE_LIBCPUPOWER_SUPPORT +-LDFLAGS += -lcpupower ++LIBCPUPOWER += -lcpupower + else + $(warning libcpupower is missing, building without --deepest-idle-state support.) + $(warning Please install libcpupower-dev/kernel-tools-libs-devel) +@@ -135,7 +135,7 @@ $(OBJDIR): + -include $(addprefix $(OBJDIR)/,$(sources:.c=.d)) + + cyclictest: $(OBJDIR)/cyclictest.o $(OBJDIR)/librttest.a $(OBJDIR)/librttestnuma.a +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(RTTESTNUMA) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(RTTESTNUMA) $(LIBCPUPOWER) + + cyclicdeadline: $(OBJDIR)/cyclicdeadline.o $(OBJDIR)/librttest.a + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) +-- +2.43.5 + diff --git a/SOURCES/0002-rt-tests-hackbench-properly-recognize-when-integer-a.patch b/SOURCES/0002-rt-tests-hackbench-properly-recognize-when-integer-a.patch deleted file mode 100644 index aef4a0d..0000000 --- a/SOURCES/0002-rt-tests-hackbench-properly-recognize-when-integer-a.patch +++ /dev/null @@ -1,70 +0,0 @@ -From cadd661f984c0e6717e681fdaca1ce589b0ed964 Mon Sep 17 00:00:00 2001 -From: Anubhav Shelat -Date: Wed, 22 May 2024 10:43:47 -0400 -Subject: [PATCH 2/2] rt-tests: hackbench: properly recognize when integer - arguments are negative - -hackbench is supposed to catch when the user passes -negative arguments to options -f, -g, -l, and -s. - -Previously hackbench would allow options to accept -negative arguments, resulting in undefined behavior. - -Now process_options() assigns variables outside of -the if considiton where they are used. hackbench will -output a usage message if the user inputs a negative -argument. - -Signed-off-by: Anubhav Shelat -Signed-off-by: John Kacur ---- - src/hackbench/hackbench.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c -index fec8357bef81..55be325a38df 100644 ---- a/src/hackbench/hackbench.c -+++ b/src/hackbench/hackbench.c -@@ -426,7 +426,8 @@ static void process_options(int argc, char *argv[]) - } - switch (c) { - case 'f': -- if ((num_fds = atoi(optarg)) <= 0) { -+ num_fds = atoi(optarg); -+ if (atoi(optarg) <= 0) { - fprintf(stderr, "%s: --fds|-f requires an integer > 0\n", argv[0]); - print_usage_exit(1); - } -@@ -435,7 +436,8 @@ static void process_options(int argc, char *argv[]) - fifo = 1; - break; - case 'g': -- if ((num_groups = atoi(optarg)) <= 0) { -+ num_groups = atoi(optarg); -+ if (atoi(optarg) <= 0) { - fprintf(stderr, "%s: --groups|-g requires an integer > 0\n", argv[0]); - print_usage_exit(1); - } -@@ -444,7 +446,8 @@ static void process_options(int argc, char *argv[]) - print_usage_exit(0); - break; - case 'l': -- if ((loops = atoi(optarg)) <= 0) { -+ loops = atoi(optarg); -+ if (atoi(optarg) <= 0) { - fprintf(stderr, "%s: --loops|-l requires an integer > 0\n", argv[0]); - print_usage_exit(1); - } -@@ -456,7 +459,8 @@ static void process_options(int argc, char *argv[]) - use_inet = 1; - break; - case 's': -- if ((datasize = atoi(optarg)) <= 0) { -+ datasize = atoi(optarg); -+ if (atoi(optarg) <= 0) { - fprintf(stderr, "%s: --datasize|-s requires an integer > 0\n", argv[0]); - print_usage_exit(1); - } --- -2.45.1 - diff --git a/SOURCES/Enable-Werror.patch b/SOURCES/Enable-Werror.patch new file mode 100644 index 0000000..688eddf --- /dev/null +++ b/SOURCES/Enable-Werror.patch @@ -0,0 +1,30 @@ +From 82120b520cebfef0da5294cbdca3b056f1f110c1 Mon Sep 17 00:00:00 2001 +From: Crystal Wood +Date: Tue, 7 Jan 2025 17:02:28 -0500 +Subject: [PATCH 2/5] rt-tests: Enable -Werror + +Now that the most obvious nuisance warnings have been disabled, don't let +the actual bad stuff slip in. + +Signed-off-by: Crystal Wood +Signed-off-by: John Kacur +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index dda29c3f5b85..26acffed8114 100644 +--- a/Makefile ++++ b/Makefile +@@ -33,7 +33,7 @@ prefix ?= /usr/local + bindir ?= $(prefix)/bin + mandir ?= $(prefix)/share/man + +-CFLAGS ?= -Wall -Wno-nonnull -Wextra -Wno-sign-compare -Wno-unused-parameter ++CFLAGS ?= -Wall -Werror -Wno-nonnull -Wextra -Wno-sign-compare -Wno-unused-parameter + CPPFLAGS += -D_GNU_SOURCE -Isrc/include + LDFLAGS ?= + +-- +2.48.1 + diff --git a/SOURCES/Remove-unused-parameter-annotations.patch b/SOURCES/Remove-unused-parameter-annotations.patch new file mode 100644 index 0000000..d474ad9 --- /dev/null +++ b/SOURCES/Remove-unused-parameter-annotations.patch @@ -0,0 +1,269 @@ +From ccbdda89d4c982daaada0a4e5745d53e93f8df4e Mon Sep 17 00:00:00 2001 +From: Crystal Wood +Date: Tue, 7 Jan 2025 17:02:29 -0500 +Subject: [PATCH 3/5] rt-tests: Remove unused parameter annotations + +These are no longer necessary with -Wno-unused-parameter + +Signed-off-by: Crystal Wood +Signed-off-by: John Kacur +--- + src/cyclictest/cyclictest.c | 11 +++++------ + src/oslat/oslat.c | 4 ++-- + src/pi_tests/pi_stress.c | 4 ++-- + src/pmqtest/pmqtest.c | 7 +++---- + src/ptsematest/ptsematest.c | 7 +++---- + src/queuelat/queuelat.c | 2 +- + src/rt-migrate-test/rt-migrate-test.c | 4 ++-- + src/sched_deadline/cyclicdeadline.c | 2 +- + src/signaltest/signaltest.c | 2 +- + src/sigwaittest/sigwaittest.c | 4 ++-- + src/ssdd/ssdd.c | 2 +- + src/svsematest/svsematest.c | 5 +++-- + 12 files changed, 26 insertions(+), 28 deletions(-) + +diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c +index b1f842096595..890da5d869c9 100644 +--- a/src/cyclictest/cyclictest.c ++++ b/src/cyclictest/cyclictest.c +@@ -436,11 +436,10 @@ static int set_deepest_cpu_idle_state(unsigned int cpu, unsigned int deepest_sta + + static inline int have_libcpupower_support(void) { return 1; } + #else +-static inline int save_cpu_idle_disable_state(__attribute__((unused)) unsigned int cpu) { return -1; } +-static inline int restore_cpu_idle_disable_state(__attribute__((unused)) unsigned int cpu) { return -1; } ++static inline int save_cpu_idle_disable_state(unsigned int cpu) { return -1; } ++static inline int restore_cpu_idle_disable_state(unsigned int cpu) { return -1; } + static inline void free_cpu_idle_disable_states(void) { } +-static inline int set_deepest_cpu_idle_state(__attribute__((unused)) unsigned int cpu, +- __attribute__((unused)) unsigned int state) { return -1; } ++static inline int set_deepest_cpu_idle_state(unsigned int cpu, unsigned int state) { return -1; } + static inline int have_libcpupower_support(void) { return 0; } + #endif /* HAVE_LIBCPUPOWER_SUPPORT */ + +@@ -1687,7 +1686,7 @@ static void rstat_print_stat(struct thread_param *par, int index, int verbose, i + * thread that creates a named fifo and hands out run stats when someone + * reads from the fifo. + */ +-static void *fifothread(void *param __attribute__ ((unused))) ++static void *fifothread(void *param) + { + int ret; + int fd; +@@ -1868,7 +1867,7 @@ rstat_err: + return; + } + +-static void write_stats(FILE *f, void *data __attribute__ ((unused))) ++static void write_stats(FILE *f, void *data) + { + struct thread_param **par = parameters; + int i; +diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c +index 0863297f2cf1..9e5a08a2fbd9 100644 +--- a/src/oslat/oslat.c ++++ b/src/oslat/oslat.c +@@ -220,7 +220,7 @@ struct global { + + static struct global g; + +-static void workload_nop(char *dst __attribute__ ((unused)), char *src __attribute__ ((unused)), size_t size __attribute__ ((unused))) ++static void workload_nop(char *dst, char *src, size_t size) + { + /* Nop */ + } +@@ -596,7 +596,7 @@ static void run_expt(struct thread *threads, int runtime_secs, bool preheat) + pthread_join(threads[i].thread_id, NULL); + } + +-static void handle_alarm(int code __attribute__ ((unused))) ++static void handle_alarm(int code) + { + g.cmd = STOP; + } +diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c +index 1116ee61584d..6f8c5632bdd7 100644 +--- a/src/pi_tests/pi_stress.c ++++ b/src/pi_tests/pi_stress.c +@@ -388,7 +388,7 @@ int pending_interrupt(void) + * 1. report progress + * 2. check for deadlocks + */ +-void *reporter(void *arg __attribute__ ((unused))) ++void *reporter(void *arg) + { + int status; + int end = 0; +@@ -1334,7 +1334,7 @@ void summary(void) + t->tm_yday, t->tm_hour, t->tm_min, t->tm_sec); + } + +-void write_stats(FILE *f, void *data __attribute__ ((unused))) ++void write_stats(FILE *f, void *data) + { + fprintf(f, " \"inversion\": %lu\n", total_inversions()); + } +diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c +index b21dfa0fe0cc..04e36a1ad979 100644 +--- a/src/pmqtest/pmqtest.c ++++ b/src/pmqtest/pmqtest.c +@@ -418,14 +418,13 @@ static void process_options(int argc, char *argv[]) + + static int volatile shutdown; + +-static void sighand(int sig __attribute__ ((unused))) ++static void sighand(int sig) + { + shutdown = 1; + } + +-static void print_stat(FILE *fp __attribute__ ((unused)), +- struct params *receiver, struct params *sender, +- int verbose __attribute__ ((unused)), int quiet) ++static void print_stat(FILE *fp, struct params *receiver, struct params *sender, ++ int verbose, int quiet) + { + int i; + +diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c +index 5a29718d7bfb..d21166946f6a 100644 +--- a/src/ptsematest/ptsematest.c ++++ b/src/ptsematest/ptsematest.c +@@ -321,14 +321,13 @@ static void process_options(int argc, char *argv[]) + + static int volatile shutdown; + +-static void sighand(int sig __attribute__ ((unused))) ++static void sighand(int sig) + { + shutdown = 1; + } + +-static void print_stat(FILE *fp __attribute__ ((unused)), +- struct params *receiver, struct params *sender, +- int verbose __attribute__ ((unused)), int quiet) ++static void print_stat(FILE *fp, struct params *receiver, struct params *sender, ++ int verbose, int quiet) + { + int i; + +diff --git a/src/queuelat/queuelat.c b/src/queuelat/queuelat.c +index c0573897a02b..28cf7abe83ae 100644 +--- a/src/queuelat/queuelat.c ++++ b/src/queuelat/queuelat.c +@@ -520,7 +520,7 @@ void main_loop(void) + free(src); + } + +-void sig_handler(int sig __attribute__ ((unused))) ++void sig_handler(int sig) + { + print_exit_info(); + exit(0); +diff --git a/src/rt-migrate-test/rt-migrate-test.c b/src/rt-migrate-test/rt-migrate-test.c +index 7b1917df12a3..8afe0834905b 100644 +--- a/src/rt-migrate-test/rt-migrate-test.c ++++ b/src/rt-migrate-test/rt-migrate-test.c +@@ -354,7 +354,7 @@ static void print_results(void) + } + } + +-static void write_stats(FILE *f, void *data __attribute__ ((unused))) ++static void write_stats(FILE *f, void *data) + { + int i; + int t; +@@ -489,7 +489,7 @@ static int check_times(int l) + return 0; + } + +-static void stop_log(int sig __attribute__ ((unused))) ++static void stop_log(int sig) + { + stop = 1; + } +diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c +index 631d57ee885e..32fd0d0e280f 100644 +--- a/src/sched_deadline/cyclicdeadline.c ++++ b/src/sched_deadline/cyclicdeadline.c +@@ -1073,7 +1073,7 @@ static int calc_nr_cpus(const char *setcpu, char **buf) + return -1; + } + +-static void sighand(int sig __attribute__ ((unused))) ++static void sighand(int sig) + { + shutdown = 1; + } +diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c +index 5412c50f7e17..d8cda97697cf 100644 +--- a/src/signaltest/signaltest.c ++++ b/src/signaltest/signaltest.c +@@ -353,7 +353,7 @@ static void process_options(int argc, char *argv[], unsigned int max_cpus) + } + } + +-static void sighand(int sig __attribute__ ((unused))) ++static void sighand(int sig) + { + shutdown = 1; + } +diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c +index 8c1c16fb3081..026cc8151015 100644 +--- a/src/sigwaittest/sigwaittest.c ++++ b/src/sigwaittest/sigwaittest.c +@@ -370,13 +370,13 @@ static void process_options(int argc, char *argv[]) + + static int volatile mustshutdown; + +-static void sighand(int sig __attribute__ ((unused))) ++static void sighand(int sig) + { + mustshutdown = 1; + } + + static void print_stat(struct params *receiver, struct params *sender, +- int verbose __attribute__ ((unused)), int quiet) ++ int verbose, int quiet) + { + int i; + +diff --git a/src/ssdd/ssdd.c b/src/ssdd/ssdd.c +index 45f6a23910ca..50f74245fd48 100644 +--- a/src/ssdd/ssdd.c ++++ b/src/ssdd/ssdd.c +@@ -152,7 +152,7 @@ static pid_t parent; + static int nforks = 10; + static int nsteps = 10000; + +-static void sigchld(int sig __attribute__ ((unused)), siginfo_t *info __attribute__ ((unused)), void *arg __attribute__ ((unused))) ++static void sigchld(int sig, siginfo_t *info, void *arg) + { + got_sigchld = 1; + } +diff --git a/src/svsematest/svsematest.c b/src/svsematest/svsematest.c +index 3c857dcb0189..f3cddf854575 100644 +--- a/src/svsematest/svsematest.c ++++ b/src/svsematest/svsematest.c +@@ -416,7 +416,7 @@ static void process_options(int argc, char *argv[]) + + static int volatile mustshutdown; + +-static void sighand(int sig __attribute__ ((unused))) ++static void sighand(int sig) + { + mustshutdown = 1; + } +@@ -456,7 +456,8 @@ static void write_stats(FILE *f, void *data) + fprintf(f, " }\n"); + } + +-static void print_stat(FILE *fp __attribute__ ((unused)), struct params *receiver, struct params *sender, int verbose __attribute__ ((unused)), int quiet) ++static void print_stat(FILE *fp, struct params *receiver, struct params *sender, ++ int verbose, int quiet) + { + int i; + +-- +2.48.1 + diff --git a/SOURCES/Turn-off-Wunused-parameter.patch b/SOURCES/Turn-off-Wunused-parameter.patch new file mode 100644 index 0000000..c826db1 --- /dev/null +++ b/SOURCES/Turn-off-Wunused-parameter.patch @@ -0,0 +1,35 @@ +From 0a5eb38592c13d0e0f641a823df6d4f7debe5644 Mon Sep 17 00:00:00 2001 +From: Crystal Wood +Date: Tue, 7 Jan 2025 17:02:27 -0500 +Subject: [PATCH 1/5] rt-tests: Turn off -Wunused-parameter + +-Wunused-parameter (part of -Wextra) is an obnoxious warning as it flags +perfectly reasonable code that takes unneeded parameters in order to +comply with a function pointer interface, or where the parameter is used +only by code inside an ifdef, etc. This results in numerous annotations +just to shut the compiler up, all for a warning that has relatively +little value even in cases where it's not a false positive (where it's +just an indication that cleanup is warranted). + +Signed-off-by: Crystal Wood +Signed-off-by: John Kacur +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 0fa0928bbca7..dda29c3f5b85 100644 +--- a/Makefile ++++ b/Makefile +@@ -33,7 +33,7 @@ prefix ?= /usr/local + bindir ?= $(prefix)/bin + mandir ?= $(prefix)/share/man + +-CFLAGS ?= -Wall -Wno-nonnull -Wextra -Wno-sign-compare ++CFLAGS ?= -Wall -Wno-nonnull -Wextra -Wno-sign-compare -Wno-unused-parameter + CPPFLAGS += -D_GNU_SOURCE -Isrc/include + LDFLAGS ?= + +-- +2.48.1 + diff --git a/SOURCES/pip_stress-Add-option-usleep.patch b/SOURCES/pip_stress-Add-option-usleep.patch new file mode 100644 index 0000000..c9414f9 --- /dev/null +++ b/SOURCES/pip_stress-Add-option-usleep.patch @@ -0,0 +1,81 @@ +From eea8da1647c3f7d26f3aae607475266112ab79b1 Mon Sep 17 00:00:00 2001 +From: Shizhao Chen +Date: Fri, 24 Jan 2025 15:51:57 +0800 +Subject: [PATCH 4/5] rt-tests: pip_stress: Add option --usleep + +Different hardwares have different threasholds for usleep_val to +reliably trigger an prio inversion, add option --usleep to allow +specifying it at runtime, to facilitate testing of prio inheritance +on different platforms. + +Signed-off-by: Shizhao Chen +Signed-off-by: John Kacur +--- + src/pi_tests/pip_stress.8 | 6 +++++- + src/pi_tests/pip_stress.c | 10 ++++++++-- + 2 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/src/pi_tests/pip_stress.8 b/src/pi_tests/pip_stress.8 +index 0d06dd2215f8..0f65ad1c107b 100644 +--- a/src/pi_tests/pip_stress.8 ++++ b/src/pi_tests/pip_stress.8 +@@ -5,7 +5,8 @@ + .B pip_stress \- Priority Inheritance with processes + .SH SYNOPSIS + .B pip_stress +- ++.RB [ \-u|\-\-usleep ++.IR TIME ] + .SH DESCRIPTION + This program demonstrates the technique of using priority inheritance (PI) + mutexes with processes instead of threads. +@@ -41,6 +42,9 @@ merely increase the time that the low priority process sleeps while + holding the lock. (usleep); + Also note that you have to run as a user with permission to change + scheduling priorities. ++.SH OPTIONS ++.IP "\-u TIME,\-\-usleep=TIME" ++Specify the sleep time in usec of the low priority process. Defaults to 500. + .BR + .SH AUTHOR + pip_stress was written by John Kacur +diff --git a/src/pi_tests/pip_stress.c b/src/pi_tests/pip_stress.c +index fb0391bfec0d..9bd225fb155c 100644 +--- a/src/pi_tests/pip_stress.c ++++ b/src/pi_tests/pip_stress.c +@@ -72,7 +72,9 @@ static void usage(int error) + printf("pip_stress V %1.2f\n", VERSION); + printf("Usage:\n" + "pip_stress \n"\ +- "-h --help Show this help menu.\n" ++ "-h --help Show this help menu.\n"\ ++ "-u TIME --usleep=TIME Specify the sleep time in usec of the low priority process.\n"\ ++ " Defaults to 500.\n" + ); + exit(error); + } +@@ -88,16 +90,20 @@ int main(int argc, char *argv[]) + for (;;) { + struct option long_options[] = { + { "help", no_argument, NULL, 'h' }, ++ { "usleep", required_argument, NULL, 'u' }, + { NULL, 0, NULL, 0 }, + }; + +- int c = getopt_long(argc, argv, "s:h", long_options, NULL); ++ int c = getopt_long(argc, argv, "hu:", long_options, NULL); + if (c == -1) + break; + switch (c) { + case 'h': + usage(0); + break; ++ case 'u': ++ usleep_val = strtoul(optarg, NULL, 10); ++ break; + default: + usage(1); + break; +-- +2.48.1 + diff --git a/SPECS/realtime-tests.spec b/SPECS/realtime-tests.spec index 56f93be..e2d1150 100644 --- a/SPECS/realtime-tests.spec +++ b/SPECS/realtime-tests.spec @@ -5,8 +5,8 @@ Name: realtime-tests # BuildRequires: numactl-devel # Numa argument to make: NUMA=1 # -Version: 2.7 -Release: 2%{?dist} +Version: 2.8 +Release: 4%{?dist} License: GPLv2 URL: https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git Source0: https://www.kernel.org/pub/linux/utils/rt-tests/rt-tests-%{version}.tar.xz @@ -16,12 +16,17 @@ BuildRequires: make BuildRequires: gcc BuildRequires: numactl-devel BuildRequires: python3-devel +BuildRequires: kernel-headers +BuildRequires: kernel-tools-libs-devel Requires: bash Requires: bc -#Patches -Patch1: 0001-rt-tests-hackbench-removed-extra-use-of-optind.patch -Patch2: 0002-rt-tests-hackbench-properly-recognize-when-integer-a.patch +Patch1: 0001-rt-tests-Put-variables-in-test-feature-in-quotes.patch +Patch2: 0002-rt-tests-Handle-lcpupower-flag-outside-LDFLAGS.patch +Patch3: Turn-off-Wunused-parameter.patch +Patch4: Enable-Werror.patch +Patch5: Remove-unused-parameter-annotations.patch +Patch6: pip_stress-Add-option-usleep.patch %description realtime-tests is a set of programs that test and measure various components of @@ -29,9 +34,7 @@ real-time kernel behavior. This package measures timer, signal, and hardware latency. It also tests the functioning of priority-inheritance mutexes. %prep -%setup -q -n rt-tests-%{version} -%patch1 -p1 -%patch2 -p1 +%autosetup -p1 -n rt-tests-%{version} %build %set_build_flags @@ -82,6 +85,23 @@ latency. It also tests the functioning of priority-inheritance mutexes. %{_mandir}/man8/determine_maximum_mpps.8.* %changelog +* Thu Jan 30 2025 John Kacur - 2.8-4 +- Add a usleep option to pip_stress +Resolves: RHEL-77110 + +* Thu Jan 30 2025 John Kacur - 2.8-3 +- Remove unused parameter warning and annotations +- Add -Werror +Resolves: RHEL-77108 + +* Mon Dec 09 2024 Tomas Glozar - 2.8-2 +- Fix building against libcpupower +Resolves: RHEL-65487 + +* Fri Nov 29 2024 John Kacur - 2.8-1 +- Rebase to rt-tests-2.8 upstream +Resolves: RHEL-68658 + * Thu May 23 2024 Anubhav Shelat - 2.7-2 - Added a patch to fix -s option in hackbench. - Added a patch to prevent the user from erroneously passing negative numbers to hackbench.