Compare commits

...

5 Commits

Author SHA1 Message Date
5ed23a6542 Import from AlmaLinux stable repository 2024-05-31 18:07:13 +00:00
CentOS Sources
48c1b36a0c import rt-tests-2.5-1.el8 2023-05-16 08:03:17 +00:00
CentOS Sources
7c8728b6a9 import rt-tests-2.4-1.el8 2022-11-08 15:03:53 +00:00
CentOS Sources
a6c4cab801 import rt-tests-2.3-2.el8 2022-05-10 11:48:00 +00:00
CentOS Sources
f6ef7af664 import rt-tests-2.1-1.el8 2021-11-11 08:22:53 +00:00
12 changed files with 553 additions and 219 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/rt-tests-1.10.tar.xz
SOURCES/rt-tests-2.6.tar.xz

View File

@ -1 +0,0 @@
7befc28537ebfa23b989037da99dd4eb842ee9b6 SOURCES/rt-tests-1.10.tar.xz

View File

@ -1,38 +0,0 @@
From 6d5aa2b00d41ecdb6eb1355309737647e177e5e6 Mon Sep 17 00:00:00 2001
From: Daniel Wagner <dwagner@suse.de>
Date: Wed, 10 Feb 2021 17:54:07 +0100
Subject: [PATCH 2/3] oslat: Use cpuset size as upper bound
To assign the threads to the correct CPU we need to use the cpuset
size as upper bound for the loop and not the number of threads.
Fixes: 85b0763dacd9 ("oslat: Use parse_cpumask() from rt-numa.h")
Reported-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/oslat/oslat.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
index 7826c277f26d..2fe550b3ee12 100644
--- a/src/oslat/oslat.c
+++ b/src/oslat/oslat.c
@@ -747,9 +747,12 @@ int main(int argc, char *argv[])
n_cores = numa_bitmask_weight(cpu_set);
TEST(threads = calloc(1, n_cores * sizeof(threads[0])));
- for (i = 0; i < n_cores; ++i)
- if (numa_bitmask_isbitset(cpu_set, i) && move_to_core(i) == 0)
+ for (i = 0; n_cores && i < cpu_set->size; i++) {
+ if (numa_bitmask_isbitset(cpu_set, i) && move_to_core(i) == 0) {
threads[g.n_threads_total++].core_i = i;
+ n_cores--;
+ }
+ }
if (numa_bitmask_isbitset(cpu_set, 0) && g.rtprio)
printf("WARNING: Running SCHED_FIFO workload on CPU 0 may hang the thread\n");
--
2.26.2

View File

@ -1,73 +0,0 @@
From 29884cff6352856fee9fffecb4a715efd70e08f5 Mon Sep 17 00:00:00 2001
From: Peter Xu <peterx@redhat.com>
Date: Thu, 18 Feb 2021 14:27:29 -0500
Subject: [PATCH] oslat: Fix --cpu-list won't allow to schedule on all possible
cores
parse_cpumask() is too strict for oslat, in that use_current_cpuset() will
filter out all the cores that are not allowed for current process to run. This
seems to be unnecessary at least for oslat. For example, the bash process that
runs the oslat program may have a sched affinity of 0-2, however it's still
legal to have it start a oslat thread running on the cores outside 0-2 as long
as the follow up sched_setaffinity() will succeed.
numa_parse_cpustring_all() suites exactly for this case, which should already
have considered sysconf(_SC_NPROCESSORS_ONLN) limit. Use that instead.
Since at it, also remove initialization of cpu_set variable otherwise it's
leaked in previous parse_cpumask too: numa_parse_cpustring_all() will return a
newly allocated buffer already. Quotting from manual:
numa_parse_nodestring() parses a character string list of nodes into a bit
mask. The bit mask is allocated by numa_allocate_nodemask().
numa_parse_nodestring_all() is similar to numa_parse_nodestring, but can
parse all possible nodes, not only current nodeset.
Cc: John Kacur <jkacur@redhat.com>
Cc: Daniel Wagner <dwagner@suse.de>
Cc: Clark Williams <williams@redhat.com>
Reported-by: Pradipta Kumar Sahoo <psahoo@redhat.com>
Reported-by: Mike Stowell <mstowell@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/oslat/oslat.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
index b2c5373388fb..465a694cdd1d 100644
--- a/src/oslat/oslat.c
+++ b/src/oslat/oslat.c
@@ -785,7 +785,6 @@ int main(int argc, char *argv[])
struct thread *threads;
int i, n_cores;
struct bitmask *cpu_set = NULL;
- int max_cpus = sysconf(_SC_NPROCESSORS_ONLN);
#ifdef FRC_MISSING
printf("This architecture is not yet supported. "
@@ -797,10 +796,6 @@ int main(int argc, char *argv[])
exit(1);
}
- cpu_set = numa_allocate_cpumask();
- if (!cpu_set)
- fatal("oslat: Could not allocate cpumask\n");
-
g.app_name = argv[0];
g.rtprio = 0;
g.bucket_size = BUCKET_SIZE;
@@ -817,7 +812,8 @@ int main(int argc, char *argv[])
if (!g.cpu_list)
g.cpu_list = strdup("all");
- if (parse_cpumask(g.cpu_list, max_cpus, &cpu_set) != 0)
+ cpu_set = numa_parse_cpustring_all(g.cpu_list);
+ if (!cpu_set)
fatal("oslat: parse_cpumask failed.\n");
n_cores = numa_bitmask_weight(cpu_set);
--
2.26.2

View File

@ -0,0 +1,306 @@
From cf75a53807ae85cca05f08efc00c28b44beeff9a Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Fri, 27 Oct 2023 14:57:46 -0400
Subject: [PATCH 2/3] rt-tests: Add missing SPDX licenses
Add missing SPDX licenses
Signed-off-by: John Kacur <jkacur@redhat.com>
---
Makefile | 1 +
src/backfire/backfire.4 | 1 +
src/backfire/sendme.8 | 1 +
src/backfire/sendme.c | 15 +--------------
src/cyclictest/cyclictest.8 | 1 +
src/cyclictest/get_cyclictest_snapshot.8 | 1 +
src/hackbench/hackbench.8 | 1 +
src/hwlatdetect/hwlatdetect.8 | 1 +
src/oslat/oslat.8 | 1 +
src/pi_tests/pi_stress.8 | 1 +
src/pi_tests/pip_stress.8 | 1 +
src/pmqtest/pmqtest.8 | 1 +
src/ptsematest/ptsematest.8 | 1 +
src/queuelat/determine_maximum_mpps.8 | 1 +
src/queuelat/queuelat.8 | 1 +
src/queuelat/targeted-ipi/Kbuild | 1 +
src/queuelat/targeted-ipi/Makefile | 1 +
src/rt-migrate-test/rt-migrate-test.8 | 1 +
src/sched_deadline/cyclicdeadline.8 | 1 +
src/sched_deadline/deadline_test.8 | 1 +
src/signaltest/signaltest.8 | 1 +
src/sigwaittest/sigwaittest.8 | 1 +
src/ssdd/ssdd.8 | 1 +
src/svsematest/svsematest.8 | 1 +
25 files changed, 25 insertions(+), 14 deletions(-)
+# SPDX-License-Identifier: GPL-2.0-or-later
*~
.*
*.o
diff --git a/Makefile b/Makefile
index 8d3268d19901..2808c212058a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
VERSION = 2.6
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
diff --git a/src/backfire/backfire.4 b/src/backfire/backfire.4
index 66dccd1dd1f0..1057a432eefb 100644
--- a/src/backfire/backfire.4
+++ b/src/backfire/backfire.4
@@ -1,4 +1,5 @@
.TH "backfire" "4" "0.1" "" "Driver"
+# SPDX-License-Identifier: GPL-2.0-or-later
.SH "NAME"
.LP
backfire \- send a signal from driver to user
diff --git a/src/backfire/sendme.8 b/src/backfire/sendme.8
index 05f3a1c14d8b..9c973607f859 100644
--- a/src/backfire/sendme.8
+++ b/src/backfire/sendme.8
@@ -1,4 +1,5 @@
.TH "sendme" "8" "0.2" "" ""
+# SPDX-License-Identifier: GPL-2.0-only
.SH "NAME"
.LP
\fBsendme\fR \- Send a signal from driver to user and measure time intervals
diff --git a/src/backfire/sendme.c b/src/backfire/sendme.c
index d963723b1c93..da10397846f7 100644
--- a/src/backfire/sendme.c
+++ b/src/backfire/sendme.c
@@ -1,22 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* sendme.c
*
* Copyright (C) 2009 Carsten Emde <C.Emde@osadl.org>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
- * USA.
*/
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/cyclictest/cyclictest.8 b/src/cyclictest/cyclictest.8
index 1cc72e64effc..2ccdfc1ff5fa 100644
--- a/src/cyclictest/cyclictest.8
+++ b/src/cyclictest/cyclictest.8
@@ -1,5 +1,6 @@
.\" Hey, EMACS: -*- nroff -*-
.TH CYCLICTEST 8 "April 22, 2016"
+# SPDX-License-Identifier: GPL-2.0-only
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
diff --git a/src/cyclictest/get_cyclictest_snapshot.8 b/src/cyclictest/get_cyclictest_snapshot.8
index e9251a8e821f..45eb90da070c 100644
--- a/src/cyclictest/get_cyclictest_snapshot.8
+++ b/src/cyclictest/get_cyclictest_snapshot.8
@@ -1,5 +1,6 @@
.\" Hey, EMACS: -*- nroff -*-
.TH GET_CYCLICTEST_SNAPSHOT 8 "July 6, 2020"
+# SPDX-License-Identifier: GPL-2.0-or-later
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
diff --git a/src/hackbench/hackbench.8 b/src/hackbench/hackbench.8
index 4c2c8ad9cb1a..1f3ecd51cc07 100644
--- a/src/hackbench/hackbench.8
+++ b/src/hackbench/hackbench.8
@@ -1,4 +1,5 @@
.TH "hackbench" "8" "September 19, 2020" "" ""
+# SPDX-License-Identifier: GPL-2.0-or-later
.SH "NAME"
hackbench \- scheduler benchmark/stress test
.SH "SYNOPSIS"
diff --git a/src/hwlatdetect/hwlatdetect.8 b/src/hwlatdetect/hwlatdetect.8
index 21d0fe4aaca2..560ff7cc0cc9 100644
--- a/src/hwlatdetect/hwlatdetect.8
+++ b/src/hwlatdetect/hwlatdetect.8
@@ -1,5 +1,6 @@
.\" Hey, EMACS: -*- nroff -*-
.TH HWLATDETECT 8 "May 12, 2009"
+# SPDX-License-Identifier: GPL-2.0-only
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
diff --git a/src/oslat/oslat.8 b/src/oslat/oslat.8
index eb96448bfff1..fba10ab4944d 100644
--- a/src/oslat/oslat.8
+++ b/src/oslat/oslat.8
@@ -1,4 +1,5 @@
.TH OSLAT 8 "August 17, 2020"
+# SPDX-License-Identifier: GPL-3.0-only
.\" for manpage-specific macros, see man(7)
.SH NAME
oslat \- OS Latency Detector
diff --git a/src/pi_tests/pi_stress.8 b/src/pi_tests/pi_stress.8
index 8c43a1ccf676..6ae28c178d75 100644
--- a/src/pi_tests/pi_stress.8
+++ b/src/pi_tests/pi_stress.8
@@ -4,6 +4,7 @@
.\"{{{}}}
.\"{{{ Title
.TH pi_stress 8 "Nov 27, 2006" "" "Linux System Administrator's Manual"
+# SPDX-License-Identifier: GPL-2.0-or-later
.\"}}}
.\"{{{ Name
.SH NAME
diff --git a/src/pi_tests/pip_stress.8 b/src/pi_tests/pip_stress.8
index 1808330b2e17..0d06dd2215f8 100644
--- a/src/pi_tests/pip_stress.8
+++ b/src/pi_tests/pip_stress.8
@@ -1,5 +1,6 @@
.\"
.TH PIP\ STRESS 8 "September 17, 2018"
+# SPDX-License-Identifier: GPL-2.0-or-later
.SH NAME
.B pip_stress \- Priority Inheritance with processes
.SH SYNOPSIS
diff --git a/src/pmqtest/pmqtest.8 b/src/pmqtest/pmqtest.8
index 4fbcc5c27ce2..cce43d9b5ee5 100644
--- a/src/pmqtest/pmqtest.8
+++ b/src/pmqtest/pmqtest.8
@@ -1,4 +1,5 @@
.TH "pmqtest" "8" "0.1" "" ""
+# SPDX-License-Identifier: GPL-2.0-or-later
.SH "NAME"
.LP
\fBpmqtest\fR \- Start pairs of threads and measure the latency of interprocess communication with POSIX messages queues
diff --git a/src/ptsematest/ptsematest.8 b/src/ptsematest/ptsematest.8
index 57e1658612c0..5e944d353ec0 100644
--- a/src/ptsematest/ptsematest.8
+++ b/src/ptsematest/ptsematest.8
@@ -1,4 +1,5 @@
.TH "ptsematest" "8" "0.1" "" ""
+# SPDX-License-Identifier: GPL-2.0-or-later
.SH "NAME"
.LP
\fBptsematest\fR \- Start two threads and measure the latency of interprocess communication with POSIX mutex.
diff --git a/src/queuelat/determine_maximum_mpps.8 b/src/queuelat/determine_maximum_mpps.8
index c48a651160d3..ba2cc2ad9c2a 100644
--- a/src/queuelat/determine_maximum_mpps.8
+++ b/src/queuelat/determine_maximum_mpps.8
@@ -1,5 +1,6 @@
.\" Hey, EMACS: -*- nroff -*-
.TH DETERMINE_MAXIMUM_MPPS 8 "Dec 4, 2020"
+# SPDX-License-Identifier: GPL-2.0-or-later
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
diff --git a/src/queuelat/queuelat.8 b/src/queuelat/queuelat.8
index 2f99e703c990..aa497e93f738 100644
--- a/src/queuelat/queuelat.8
+++ b/src/queuelat/queuelat.8
@@ -1,5 +1,6 @@
.\" Hey, EMACS: -*- nroff -*-
.TH QUEUELAT 8 "Sept 3, 2018"
+# SPDX-License-Identifier: GPL-2.0-or-later
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
diff --git a/src/queuelat/targeted-ipi/Kbuild b/src/queuelat/targeted-ipi/Kbuild
index 9bdd5c63a00a..6d569c38aab8 100644
--- a/src/queuelat/targeted-ipi/Kbuild
+++ b/src/queuelat/targeted-ipi/Kbuild
@@ -1,2 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
obj-m := targeted-ipi.o
diff --git a/src/queuelat/targeted-ipi/Makefile b/src/queuelat/targeted-ipi/Makefile
index ee5591fe45c0..9dabd7c22fe0 100644
--- a/src/queuelat/targeted-ipi/Makefile
+++ b/src/queuelat/targeted-ipi/Makefile
@@ -1 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
obj-$(CONFIG_TARGETED_IPI) += targeted-ipi.o
diff --git a/src/rt-migrate-test/rt-migrate-test.8 b/src/rt-migrate-test/rt-migrate-test.8
index 53670e3757fa..88daec50138c 100644
--- a/src/rt-migrate-test/rt-migrate-test.8
+++ b/src/rt-migrate-test/rt-migrate-test.8
@@ -1,5 +1,6 @@
.\"
.TH RT-MIGRATE-TEST 8 "September 18, 2020"
+# SPDX-License-Identifier: GPL-2.0-only
.\" Please adjust this date whenever editing this manpage
.SH NAME
rt-migrate-test \- real-time task migration program
diff --git a/src/sched_deadline/cyclicdeadline.8 b/src/sched_deadline/cyclicdeadline.8
index fab301edc86a..bfc6327c51da 100644
--- a/src/sched_deadline/cyclicdeadline.8
+++ b/src/sched_deadline/cyclicdeadline.8
@@ -1,5 +1,6 @@
.\" Hey, EMACS: -*- nroff -*-
.TH CYCLICDEADLINE 8 "January 16, 2020"
+# SPDX-License-Identifier: GPL-2.0-only
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
diff --git a/src/sched_deadline/deadline_test.8 b/src/sched_deadline/deadline_test.8
index 8f32c5b6feb6..0d7932250e23 100644
--- a/src/sched_deadline/deadline_test.8
+++ b/src/sched_deadline/deadline_test.8
@@ -1,5 +1,6 @@
.\" Hey, EMACS: -*- nroff -*-
.TH DEADLINE_TEST 8 "November 1, 2018"
+# SPDX-License-Identifier: GPL-2.0-only
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
diff --git a/src/signaltest/signaltest.8 b/src/signaltest/signaltest.8
index da818ecdef67..a8c9a6e91c68 100644
--- a/src/signaltest/signaltest.8
+++ b/src/signaltest/signaltest.8
@@ -1,5 +1,6 @@
.\"
.TH SIGNALTEST 8 "November 15, 2020"
+# SPDX-License-Identifier: GPL-2.0-only
.\" Please adjust this date whenever updating this manpage
.SH NAME
signaltest \- signal roundtrip test software
diff --git a/src/sigwaittest/sigwaittest.8 b/src/sigwaittest/sigwaittest.8
index 26ad333e2841..f0ecbb6448b1 100644
--- a/src/sigwaittest/sigwaittest.8
+++ b/src/sigwaittest/sigwaittest.8
@@ -1,4 +1,5 @@
.TH "sigwaittest" "8" "0.1" "" ""
+# SPDX-License-Identifier: GPL-2.0-only
.SH "NAME"
.LP
\fBsigwaittest\fR \- Start two threads or fork two processes and measure the latency between sending and receiving a signal
diff --git a/src/ssdd/ssdd.8 b/src/ssdd/ssdd.8
index a3b9d790dec4..e6be5ef6a27d 100644
--- a/src/ssdd/ssdd.8
+++ b/src/ssdd/ssdd.8
@@ -1,4 +1,5 @@
.TH SSDD 8 "September 19, 2020"
+# SPDX-License-Identifier: GPL-2.0-or-later
.SH NAME
ssdd \- have a tracer do a bunch of PTRACE_SINGLESTEPs
.SH SYNOPSIS
diff --git a/src/svsematest/svsematest.8 b/src/svsematest/svsematest.8
index 93abf55f3d4d..7865ed0550e9 100644
--- a/src/svsematest/svsematest.8
+++ b/src/svsematest/svsematest.8
@@ -1,4 +1,5 @@
.TH "svsematest" "8" "0.1" "" ""
+# SPDX-License-Identifier: GPL-2.0-or-later
.SH "NAME"
.LP
\fBsvsematest\fR \- Start two threads or fork two processes and measure the latency of SYSV semaphores
--
2.41.0

View File

@ -0,0 +1,37 @@
From 57f8f11fbab520b5cb239451c841f951a994328a Mon Sep 17 00:00:00 2001
From: Mathias Krause <minipli@grsecurity.net>
Date: Thu, 19 Oct 2023 08:53:28 +0200
Subject: [PATCH 1/3] rt-tests: Makefile: Restore support for Exuberant Ctags
Commit 974241c78a6f ("rt-tests: Makefile: ctags: Change obsolete extra
to extras") is Universal Ctags specific and broke Exuberant Ctags.
Restore support for Exuberant Ctags by automatically detecting which
variant to use.
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 223a839151ec..8d3268d19901 100644
--- a/Makefile
+++ b/Makefile
@@ -251,6 +251,11 @@ help:
@echo " tarball : make a rt-tests tarball suitable for release"
@echo " help : print this message"
+# Universal Ctags warns about the backward compatible option '--extra' and
+# wants it to be called '--extras'.
+CTAGS_BIN = ctags
+CTAGS_EXTRA := $(shell $(CTAGS_BIN) --version 2>&1 | grep -iq universal && echo extras || echo extra)
+
.PHONY: tags
tags:
- ctags -R --extras=+f --c-kinds=+p --exclude=tmp --exclude=BUILD *
+ $(CTAGS_BIN) -R --$(CTAGS_EXTRA)=+f --c-kinds=+p --exclude=tmp --exclude=BUILD *
--
2.41.0

View File

@ -0,0 +1,57 @@
From 3cbd2fc69160f5c21b66445279fcb31c22e29915 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Fri, 27 Oct 2023 15:22:30 -0400
Subject: [PATCH 3/3] rt-tests: Remove remaining unnecessary texts after adding
SPDX licenses
Remove remaining unnecessary texts after adding SPDX licenses
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/signaltest/signaltest.c | 4 ----
src/sigwaittest/sigwaittest.c | 14 --------------
2 files changed, 18 deletions(-)
diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
index 4737c253b1af..5412c50f7e17 100644
--- a/src/signaltest/signaltest.c
+++ b/src/signaltest/signaltest.c
@@ -5,10 +5,6 @@
*
* (C) 2007 Thomas Gleixner <tglx@linutronix.de>
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License Version
- * 2 as published by the Free Software Foundation;
- *
*/
#include <fcntl.h>
diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c
index 818e3a8e680a..55855769c63b 100644
--- a/src/sigwaittest/sigwaittest.c
+++ b/src/sigwaittest/sigwaittest.c
@@ -5,20 +5,6 @@
*
* Copyright (C) 2009 Carsten Emde <C.Emde@osadl.org>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
- * USA.
*/
#include <stdio.h>
--
2.41.0

View File

@ -1,47 +0,0 @@
From 5821269dde6a778b0af06c172bc2f19bbe324bda Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Fri, 12 Feb 2021 12:22:23 -0500
Subject: [PATCH 3/3] rt-tests: oslat: Allocate memory for cpu_set
- cpu_set is a pointer to a bitmask struct
Memory needs to be allocated for the struct, so call
numa_allocate_cpumask()
- use rt-tests fatal to exit on error conditions
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/oslat/oslat.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
index 2fe550b3ee12..2a3be393a268 100644
--- a/src/oslat/oslat.c
+++ b/src/oslat/oslat.c
@@ -727,6 +727,10 @@ int main(int argc, char *argv[])
exit(1);
}
+ cpu_set = numa_allocate_cpumask();
+ if (!cpu_set)
+ fatal("oslat: Could not allocate cpumask\n");
+
g.app_name = argv[0];
g.rtprio = 0;
g.bucket_size = BUCKET_SIZE;
@@ -742,8 +746,9 @@ int main(int argc, char *argv[])
if (!g.cpu_list)
g.cpu_list = strdup("all");
- if (parse_cpumask(g.cpu_list, max_cpus, &cpu_set))
- exit(1);
+
+ if (parse_cpumask(g.cpu_list, max_cpus, &cpu_set) != 0)
+ fatal("oslat: parse_cpumask failed.\n");
n_cores = numa_bitmask_weight(cpu_set);
TEST(threads = calloc(1, n_cores * sizeof(threads[0])));
--
2.26.2

View File

@ -0,0 +1,42 @@
From 4aeacf722cee26a3f88ab7f631c9ab9ba6ecdb49 Mon Sep 17 00:00:00 2001
From: Marcelo Tosatti <mtosatti@redhat.com>
Date: Thu, 1 Feb 2024 14:50:54 -0300
Subject: [PATCH 2/2] rt-tests: oslat: convert to nanoseconds correctly
With buckets of size 1us, accounting for measurements in the
[1ns, 999ns] range are done to the 2us bucket (while they
should be accounted in the 1us bucket):
001 (us): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
002 (us): 41916187 41937649 41938461 42029055 ...
003 (us): 969 985 958 972 964 986 970 961 973 ...
Fix this by doing a plain cycles -> nanoseconds convertion:
001 (us): 43287555 43086678 43087427 43109974 ...
002 (us): 983 987 985 975 982 960 993 961 992 ...
003 (us): 9 6 7 13 9 22 3 21 3 3 8 8 10 11 3 55
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Reported-by: Chuck Newman <chuck.newman@hpe.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/oslat/oslat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
index e398f205b40a..0863297f2cf1 100644
--- a/src/oslat/oslat.c
+++ b/src/oslat/oslat.c
@@ -334,7 +334,7 @@ static void insert_bucket(struct thread *t, stamp_t value)
uint64_t extra;
double us;
- lat = (value * g.unit_per_us + t->counter_mhz - 1) / t->counter_mhz;
+ lat = (value * g.unit_per_us) / t->counter_mhz;
us = (double)lat / g.unit_per_us;
if (!g.preheat && g.trace_threshold && us >= g.trace_threshold) {
char *line = "%s: Trace threshold (%d us) triggered on cpu %d with %.*f us!\n";
--
2.43.0

View File

@ -1,54 +0,0 @@
From 2f4d564fb5557f7a420c183ddd3938647c231a8c Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Wed, 10 Feb 2021 22:18:41 -0500
Subject: [PATCH 1/3] rt-tests: oslat: print version string
During the streamlining of the command line options something went awry
with the version. The author of oslat wishes to always print the version
string. This allows us to just exit in the case of -v
Fixes e411219d27b1
Reported-by: Pradipta Kumar Sahoo <psahoo@redhat.com>
Reported-by: Reported-by: Peter Xu <peterx@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/oslat/oslat.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
index 5b7e0d5b5d5c..7826c277f26d 100644
--- a/src/oslat/oslat.c
+++ b/src/oslat/oslat.c
@@ -512,7 +512,6 @@ static void handle_alarm(int code)
static void usage(int error)
{
- printf("oslat V %1.2f\n", VERSION);
printf("Usage:\n"
"oslat <options>\n\n"
"This is an OS latency detector by running busy loops on specified cores.\n"
@@ -657,8 +656,8 @@ static void parse_options(int argc, char *argv[])
break;
case 'v':
/*
- * Because we always dump the version even before parsing options,
- * what we need to do is to quit..
+ * We always print the version before parsing options
+ * so just exit
*/
exit(0);
break;
@@ -736,7 +735,7 @@ int main(int argc, char *argv[])
g.workload_mem_size = WORKLOAD_MEM_SIZE;
/* Run the main thread on cpu0 by default */
g.cpu_main_thread = 0;
-
+ printf("oslat V %1.2f\n", VERSION);
parse_options(argc, argv);
TEST(mlockall(MCL_CURRENT | MCL_FUTURE) == 0);
--
2.26.2

View File

@ -0,0 +1,34 @@
From 251d082403b371098c8420c01d1b058b12a9cc78 Mon Sep 17 00:00:00 2001
From: Marcelo Tosatti <mtosatti@redhat.com>
Date: Thu, 1 Feb 2024 13:05:38 -0300
Subject: [PATCH 1/2] rt-tests: oslat should use MHz, not Mhz
Usage of Mhz, in oslat, is incorrect:
From https://www.nist.gov/pml/owm/writing-si-metric-system-units#:~:text=NOT%20250%20mms.-,Capitalization,the%20beginning%20of%20the%20sentence:
"When the unit is derived from the name of a person, the symbol or the first letter of the symbol is an uppercase letter (W for the unit "watt" or Pa for the unit "pascal")."
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Reported-by: Chuck Newman <chuck.newman@hpe.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/oslat/oslat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
index 4bdca643da72..e398f205b40a 100644
--- a/src/oslat/oslat.c
+++ b/src/oslat/oslat.c
@@ -501,7 +501,7 @@ static void write_summary(struct thread *t)
calculate(t);
putfield("Core", t[i].core_i, "d", "");
- putfield("Counter Freq", t[i].counter_mhz, "u", " (Mhz)");
+ putfield("Counter Freq", t[i].counter_mhz, "u", " (MHz)");
for (j = 0; j < g.bucket_size; j++) {
if (j < g.bucket_size-1 && g.output_omit_zero_buckets) {
--
2.43.0

View File

@ -5,7 +5,7 @@ Name: rt-tests
# BuildRequires: numactl-devel
# Numa argument to make: NUMA=1
#
Version: 1.10
Version: 2.6
Release: 3%{?dist}
License: GPLv2
Group: Development/Tools
@ -21,10 +21,11 @@ BuildRequires: python3-devel
Requires: bash bc
#Patches
Patch1: rt-tests-oslat-print-version-string.patch
Patch2: oslat-Use-cpuset-size-as-upper-bound.patch
Patch3: rt-tests-oslat-Allocate-memory-for-cpu_set.patch
Patch4: oslat-allow-scheduling-on-all-possible-cores.patch
Patch1: rt-tests-Makefile-Restore-support-for-Exuberant-Ctag.patch
Patch2: rt-tests-Add-missing-SPDX-licenses.patch
Patch3: rt-tests-Remove-remaining-unnecessary-texts.patch
Patch4: rt-tests-oslat-should-use-MHz-not-Mhz.patch
Patch5: rt-tests-oslat-convert-to-nanoseconds-correctly.patch
%description
rt-tests is a set of programs that test and measure various components of
@ -37,6 +38,7 @@ latency. It also tests the functioning of priority-inheritance mutexes.
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
%set_build_flags
@ -91,6 +93,75 @@ rm -rf ${build_root}
%{_mandir}/man8/determine_maximum_mpps.8.*
%changelog
* Mon Feb 05 2024 John Kacur <jkacur@redhat.com> - 2.6-3
- Fix specfile to apply all patches
Resolves: RHEL-23908
* Mon Feb 05 2024 John Kacur <jkacur@redhat.com> - 2.6-2
- oslat: Fix conversion to nanoseconds for 1us bucket
- oslat: correct spelling of Mhz to MHz
Resolves: RHEL-23908
* Fri Oct 27 2023 John Kacur <jkacur@redhat.com> - 2.6-1
- Update to latest upstream rt-tests v2.6
Resolves: RHEL-7861
* Tue Jan 24 2023 John Kacur <jkacur@redhat.com> - 2.5-1
- Update to latest upstream rt-tests v2.5
Resolves: rhbz#2162780
* Wed Dec 14 2022 Crystal Wood <swood@redhat.com> - 2.4-5
- oslat: Add command line option for bucket width
Resolves: rhbz#2122374
* Mon Nov 14 2022 Leah Leshchinsky <lleshchi@redhat.com> - 2.4-4
- hwlatdetect: Convert to fstrings
- hwlatdetect: Update to integer division
- hwlatdetect: Fix incorrect comment about test duration
Resolves: rhbz#2121152
* Wed Nov 02 2022 John Kacur <jkacur@redhat.com> - 2.4-3
- Add error checking in hackbench to connect and getsockname
- Fix compile warnings in hackbench because of comparison of different signs
- Fix compile warnings in hackbench because of warnings about fall through
Resolves: rhbz#bz2115064
* Fri Oct 07 2022 John Kacur <jkacur@redhat.com> - 2.4-2
- Remove arbitrary limits on number of threads
Resolves: rhbz#2132822
* Fri Jul 8 2022 John Kacur <jkacur@redhat.com> - 2.4-1
- Update to latest rt-tests upstream v2.4
Resolves: rhbz#2068114
* Thu Feb 3 2022 John Kacur <jkacur@redhat.com> - 2.3-2
- Fix parsing of affinity
- Ignore the runtime cpumask if a new cpumask is requested
Resolves: rhbz#2050242
* Thu Jan 13 2022 Leah Leshchinsky <lleshchi@redhat.com> - 2.3-1
- Update to latest upstream 2.3
- Correct the comment of numa_initialize()
- oslat.8: Remove the argument of --bias
Resolves: rhbz#2012292
* Fri Nov 19 2021 John Kacur <jkacur@redhat.com> - 2.1-4
- Fix potential double mount of cgroups for deadline_test
- Fix potential double mount of cgroups for cyclicdeadline
Resolves: rhbz#2024957
* Fri Nov 12 2021 John Kacur <jkacur@redhat.com> - 2.1-3
- Null check to prevent floating point exception in deadline test
Resolves: rhbz#1995005
* Tue Oct 12 2021 Leah Leshchinsky <lleshchi@redhat.com> - 2.1-2
- Add missing option F to optstring
Resolves: rhbz#2000974
* Wed Jun 30 2021 John Kacur <jkacur@redhat.com> - 2.1-1
- Update to rt-tests-2.1 upstream
Resolves: rhbz#1954387
* Fri Feb 19 2021 John Kacur <jkacur@redhat.com> - 1.10-3
- parse_cpumask() is too strict for oslat, allow all possible cores
Resolves: rhbz#1926578