From b6805cebd6d5a1e248ddeb5547003101fb88c5c0 Mon Sep 17 00:00:00 2001 From: John Kacur Date: Wed, 1 Apr 2026 13:47:34 -0400 Subject: [PATCH] Rebase realtime-tests to the latest upstream Added 3 patches and updated spec file Resolves: RHEL-144701 --- .gitignore | 1 + ...relative-symlinks-for-Python-scripts.patch | 44 ++++++++++++++ cyclictest-fix-growing-shm-stat-file.patch | 35 +++++++++++ realtime-tests.spec | 12 +++- ...ests-hwlatdetect-Add-timestamp-delta.patch | 59 +++++++++++++++++++ sources | 2 +- 6 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 Makefile-Use-relative-symlinks-for-Python-scripts.patch create mode 100644 cyclictest-fix-growing-shm-stat-file.patch create mode 100644 rt-tests-hwlatdetect-Add-timestamp-delta.patch diff --git a/.gitignore b/.gitignore index 6560194..6770650 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /rt-tests-2.7.tar.xz /rt-tests-2.8.tar.xz /rt-tests-2.9.tar.xz +/rt-tests-2.10.tar.xz diff --git a/Makefile-Use-relative-symlinks-for-Python-scripts.patch b/Makefile-Use-relative-symlinks-for-Python-scripts.patch new file mode 100644 index 0000000..c666683 --- /dev/null +++ b/Makefile-Use-relative-symlinks-for-Python-scripts.patch @@ -0,0 +1,44 @@ +From 1d20e72c398e651e9afa7869281d257fdb263ebf Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Fri, 20 Mar 2026 15:02:47 -0400 +Subject: [PATCH 3/3] Makefile: Use relative symlinks for Python scripts + +Use ln -rs to create relative symlinks instead of absolute symlinks +for hwlatdetect and get_cyclictest_snapshot. This fixes RPM build +warnings and makes the package relocatable. + +Absolute symlinks cause issues when: +- Installing to different prefixes +- Building in mock/containers +- Package relocation is needed + +Signed-off-by: John Kacur +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 83d2a33ecf05..80c3f1073560 100644 +--- a/Makefile ++++ b/Makefile +@@ -235,7 +235,7 @@ install_hwlatdetect: hwlatdetect + mkdir -p "$(DESTDIR)$(bindir)" ; \ + install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \ + rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \ +- ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \ ++ ln -rs "$(DESTDIR)$(PYLIB)/hwlatdetect.py" "$(DESTDIR)$(bindir)/hwlatdetect" ; \ + fi + + .PHONY: install_get_cyclictest_snapshot +@@ -244,7 +244,7 @@ install_get_cyclictest_snapshot: get_cyclictest_snapshot + mkdir -p "${DESTDIR}${bindir}" ; \ + install -D -m 755 src/cyclictest/get_cyclictest_snapshot.py ${DESTDIR}${PYLIB}/get_cyclictest_snapshot.py ; \ + rm -f "${DESTDIR}${bindir}/get_cyclictest_snapshot" ; \ +- ln -s ${PYLIB}/get_cyclictest_snapshot.py "${DESTDIR}${bindir}/get_cyclictest_snapshot" ; \ ++ ln -rs "${DESTDIR}${PYLIB}/get_cyclictest_snapshot.py" "${DESTDIR}${bindir}/get_cyclictest_snapshot" ; \ + fi + + .PHONY: install_manpages +-- +2.53.0 + diff --git a/cyclictest-fix-growing-shm-stat-file.patch b/cyclictest-fix-growing-shm-stat-file.patch new file mode 100644 index 0000000..663f431 --- /dev/null +++ b/cyclictest-fix-growing-shm-stat-file.patch @@ -0,0 +1,35 @@ +From f9c82184ce88d8de3ffe588279b0bc41d3887998 Mon Sep 17 00:00:00 2001 +From: Lukas Beckmann +Date: Sun, 1 Mar 2026 22:24:06 +0100 +Subject: [PATCH 2/3] cyclictest: fix growing shm stat file + +On a received USR2 signal, the current statistics are written to a file +in shared memory. Before that happens, it is truncated to zero to clear +it. + +However, currently the shm file keeps growing with each received signal +because the seek pointer is not updated by ftruncate. + +This is fixed by calling fseek after truncating. + +Signed-off-by: Lukas Beckmann +Signed-off-by: John Kacur +--- + src/cyclictest/cyclictest.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c +index 191945e1e0db..960c90560668 100644 +--- a/src/cyclictest/cyclictest.c ++++ b/src/cyclictest/cyclictest.c +@@ -1472,6 +1472,7 @@ static void sighand(int sig) + return; + } + rstat_ftruncate(rstat_fd, 0); ++ lseek(rstat_fd, 0, SEEK_SET); + quiet = 0; + dprintf(rstat_fd, "#---------------------------\n"); + dprintf(rstat_fd, "# cyclictest current status:\n"); +-- +2.53.0 + diff --git a/realtime-tests.spec b/realtime-tests.spec index e474d86..7af3774 100644 --- a/realtime-tests.spec +++ b/realtime-tests.spec @@ -1,6 +1,6 @@ Name: realtime-tests Summary: Programs that test various rt-features -Version: 2.9 +Version: 2.10 Release: 1%{?dist} License: GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.1-or-later URL: https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git @@ -18,6 +18,11 @@ BuildRequires: kernel-tools-libs-devel Requires: bash Requires: bc +# Patches +Patch0: rt-tests-hwlatdetect-Add-timestamp-delta.patch +Patch1: cyclictest-fix-growing-shm-stat-file.patch +Patch2: Makefile-Use-relative-symlinks-for-Python-scripts.patch + %description realtime-tests is a set of programs that test and measure various components of real-time kernel behavior. This package measures timer, signal, and hardware @@ -75,6 +80,11 @@ latency. It also tests the functioning of priority-inheritance mutexes. %{_mandir}/man8/determine_maximum_mpps.8.* %changelog +* Wed Apr 01 2026 John Kacur - 2.10-1 +- Rebase realtime-tests to the latest upstream +- Added 3 patches and updated spec file +Resolves: RHEL-144701 + * Thu Jul 10 2025 Tyonnchie Berry - 2.9-1 - Rebased to latest upstream version - Dropped previously applied patches diff --git a/rt-tests-hwlatdetect-Add-timestamp-delta.patch b/rt-tests-hwlatdetect-Add-timestamp-delta.patch new file mode 100644 index 0000000..34ed907 --- /dev/null +++ b/rt-tests-hwlatdetect-Add-timestamp-delta.patch @@ -0,0 +1,59 @@ +From 5ced2b87b184f773ae331021c1fa1cda85f43c44 Mon Sep 17 00:00:00 2001 +From: Costa Shulyupin +Date: Tue, 10 Mar 2026 01:09:18 +0200 +Subject: [PATCH 1/3] rt-tests: hwlatdetect: Add timestamp delta + +Add delta field that calculates the time interval between consecutive +samples. For the first sample, the previous timestamp is initialized to +'nan' (Not a Number), so the first delta is also 'nan'. + +This helps identify periodic issues during hardware latency testing. + +v2: +Address John Kacur's review comments: +- Use float('nan') instead of string 'nan' for prev initialization +- Compute float(ts) once and reuse for delta calculation and prev update + +Signed-off-by: Costa Shulyupin +Signed-off-by: John Kacur +--- + src/hwlatdetect/hwlatdetect.py | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py +index 42b9f301718a..18ca930487f0 100755 +--- a/src/hwlatdetect/hwlatdetect.py ++++ b/src/hwlatdetect/hwlatdetect.py +@@ -253,7 +253,8 @@ class Tracer(Detector): + + class Sample: + 'private class for tracer sample data' +- __slots__ = 'cpu', 'timestamp', 'inner', 'outer', 'count' ++ __slots__ = 'cpu', 'timestamp', 'delta', 'inner', 'outer', 'count' ++ prev = float('nan') + + def __init__(self, line): + fields = line.split() +@@ -276,14 +277,16 @@ class Tracer(Detector): + i, o = fields[6].split('/') + ts = fields[7][3:] + self.timestamp = str(ts) ++ ts_float = float(ts) ++ self.delta = ts_float - self.__class__.prev ++ self.__class__.prev = ts_float + self.inner = int(i) + self.outer = int(o) + self.count = int(kv["count"]) if "count" in kv else None + + def __str__(self): +- if self.count is not None: +- return f"ts: {self.timestamp}, inner:{self.inner}, outer:{self.outer}, cpu:{self.cpu}, count:{self.count}" +- return f"ts: {self.timestamp}, inner:{self.inner}, outer:{self.outer}, cpu:{self.cpu}" ++ s = f"ts: {self.timestamp}, delta:{self.delta:.6f}, inner:{self.inner}, outer:{self.outer}, cpu:{self.cpu}" ++ return s if self.count is None else s + f", count:{self.count}" + + def display(self): + """ convert object to string and print """ +-- +2.53.0 + diff --git a/sources b/sources index 6f287e0..245eead 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rt-tests-2.9.tar.xz) = 7e7fe2bc8833891900c9c29ad1e0b188003bcdbd40aeb2412153fef3d5f2157a8a3964d46060e9e12ffc200e66dcfb55f78b8df3163ed33116e9b834e4f3113f +SHA512 (rt-tests-2.10.tar.xz) = 11a9ea73c28f01aa70542664e78694eac27ae3c4217969f03f9cc1ddb0720fba44f6378a9d44ea9ecc92025368873b7fe5111bf4f5395e47ae5527ddefdb113b