Compare commits

..

No commits in common. 'c9-beta' and 'c9' have entirely different histories.
c9-beta ... c9

2
.gitignore vendored

@ -1 +1 @@
SOURCES/rt-tests-2.7.tar.xz SOURCES/rt-tests-2.5.tar.xz

@ -1 +1 @@
6d64c51123fa798257459213a0b8788f898f1cb1 SOURCES/rt-tests-2.7.tar.xz 0b4143fef6905a83f68b2a53a007708a666a02ec SOURCES/rt-tests-2.5.tar.xz

@ -1,39 +0,0 @@
From 64c7f92979ded63ac5a19ea59e9b791e3da1fae4 Mon Sep 17 00:00:00 2001
From: Anubhav Shelat <ashelat@redhat.com>
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 <ashelat@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
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

@ -1,70 +0,0 @@
From cadd661f984c0e6717e681fdaca1ce589b0ed964 Mon Sep 17 00:00:00 2001
From: Anubhav Shelat <ashelat@redhat.com>
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 <ashelat@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
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

@ -5,7 +5,7 @@ Name: realtime-tests
# BuildRequires: numactl-devel # BuildRequires: numactl-devel
# Numa argument to make: NUMA=1 # Numa argument to make: NUMA=1
# #
Version: 2.7 Version: 2.5
Release: 2%{?dist} Release: 2%{?dist}
License: GPLv2 License: GPLv2
URL: https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git URL: https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
@ -20,8 +20,6 @@ Requires: bash
Requires: bc Requires: bc
#Patches #Patches
Patch1: 0001-rt-tests-hackbench-removed-extra-use-of-optind.patch
Patch2: 0002-rt-tests-hackbench-properly-recognize-when-integer-a.patch
%description %description
realtime-tests is a set of programs that test and measure various components of realtime-tests is a set of programs that test and measure various components of
@ -30,8 +28,6 @@ latency. It also tests the functioning of priority-inheritance mutexes.
%prep %prep
%setup -q -n rt-tests-%{version} %setup -q -n rt-tests-%{version}
%patch1 -p1
%patch2 -p1
%build %build
%set_build_flags %set_build_flags
@ -42,7 +38,7 @@ latency. It also tests the functioning of priority-inheritance mutexes.
%files %files
%pycached %{python3_sitelib}/hwlatdetect.py %pycached %{python3_sitelib}/hwlatdetect.py
%caps(cap_sys_rawio+ep) %attr(750,-,-) /usr/bin/cyclictest %caps(cap_sys_rawio+ep) /usr/bin/cyclictest
%{_bindir}/pi_stress %{_bindir}/pi_stress
%{_bindir}/signaltest %{_bindir}/signaltest
%{_bindir}/hwlatdetect %{_bindir}/hwlatdetect
@ -82,41 +78,6 @@ latency. It also tests the functioning of priority-inheritance mutexes.
%{_mandir}/man8/determine_maximum_mpps.8.* %{_mandir}/man8/determine_maximum_mpps.8.*
%changelog %changelog
* Thu May 23 2024 Anubhav Shelat <ashelat@redhat.com> - 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.
Resolves: RHEL-36746
* Tue May 07 2024 John Kacur <jkacur@redhat.com> - 2.7-1
- Rebase to upstream rt-tests-2.7
Resolves: RHEL-30166
* Fri Apr 26 2024 Eder Zulian <ezulian@redhat.com> - 2.6-6
- Strip o+rx permissions from the cyclictest executable
Resolves: RHEL-33785
* Mon Feb 05 2024 John Kacur <jkacur@redhat.com> - 2.6-4
- Fix specfile to apply all patches
Resolves: RHEL-23909
* Mon Feb 05 2024 John Kacur <jkacur@redhat.com> - 2.6-4
- oslat: correct spelling of Mhz to MHz
- oslat: Fix conversion to nanoseconds for 1us bucket
Resolves: RHEL-23909
* Fri Jan 26 2024 Crystal Wood <crwood@redhat.com> - 2.6-3
- Fix issues with with using --json without --histogram (both cyclictest and
cyclicdeadline), and using --histogram without --quiet in cyclicdeadline.
Resolves: RHEL-9910
* Thu Jan 11 2024 Crystal Wood <crwood@redhat.com> - 2.6-2
- cyclicdeadline histogram support
Resolves: RHEL-9910
* Fri Oct 27 2023 John Kacur <jkacur@redhat.com> - 2.6-1
- Update to latest rt-tests upstream v2.6
Resolves: RHEL-7860
* Wed Jul 12 2023 John Kacur <jkacur@redhat.com> - 2.5-2 * Wed Jul 12 2023 John Kacur <jkacur@redhat.com> - 2.5-2
- Remove aarch64 from ExcludeArch to allow internal arm builds - Remove aarch64 from ExcludeArch to allow internal arm builds
Resolves: rhbz#2222437 Resolves: rhbz#2222437

Loading…
Cancel
Save