Added 3 patches and updated spec file
Signed-off-by: Tyonnchie Berry <tyberry@redhat.com>
This commit is contained in:
parent
3d56e160fe
commit
78fc4d1f30
56
Fix-rt-tests-build-with-glibc-2.41.patch
Normal file
56
Fix-rt-tests-build-with-glibc-2.41.patch
Normal file
@ -0,0 +1,56 @@
|
||||
From d3a23a0cc76789c3083df3bad78982cd49bc4c5e Mon Sep 17 00:00:00 2001
|
||||
From: Yaakov Selkowitz <yselkowi@redhat.com>
|
||||
Date: Wed, 29 Jan 2025 16:46:11 -0500
|
||||
Subject: [PATCH] Fix rt-tests build with glibc-2.41
|
||||
|
||||
The sched_*attr APIs were added to glibc
|
||||
https://sourceware.org/git/?p=glibc.git;a=commit;h=21571ca0d70302909cf72707b2a7736cf12190a0
|
||||
|
||||
This fixes the build conflict in rt-tests with glibc-2.4
|
||||
|
||||
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/include/rt-sched.h | 2 ++
|
||||
src/lib/rt-sched.c | 2 ++
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/include/rt-sched.h b/src/include/rt-sched.h
|
||||
index 80171c7..dfd7f45 100644
|
||||
--- a/src/include/rt-sched.h
|
||||
+++ b/src/include/rt-sched.h
|
||||
@@ -42,6 +42,7 @@
|
||||
#define __NR_sched_getattr 275
|
||||
#endif
|
||||
|
||||
+#if ! __GLIBC_PREREQ(2, 41)
|
||||
struct sched_attr {
|
||||
uint32_t size;
|
||||
uint32_t sched_policy;
|
||||
@@ -67,5 +68,6 @@ int sched_getattr(pid_t pid,
|
||||
struct sched_attr *attr,
|
||||
unsigned int size,
|
||||
unsigned int flags);
|
||||
+#endif
|
||||
|
||||
#endif /* __RT_SCHED_H__ */
|
||||
diff --git a/src/lib/rt-sched.c b/src/lib/rt-sched.c
|
||||
index 8023bc7..2500abd 100644
|
||||
--- a/src/lib/rt-sched.c
|
||||
+++ b/src/lib/rt-sched.c
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "rt-sched.h"
|
||||
|
||||
+#if ! __GLIBC_PREREQ(2, 41)
|
||||
int sched_setattr(pid_t pid,
|
||||
const struct sched_attr *attr,
|
||||
unsigned int flags)
|
||||
@@ -28,3 +29,4 @@ int sched_getattr(pid_t pid,
|
||||
{
|
||||
return syscall(__NR_sched_getattr, pid, attr, size, flags);
|
||||
}
|
||||
+#endif
|
||||
--
|
||||
2.49.0
|
||||
|
||||
55
Revert-Fix-rt-tests-build-with-glibc-2.41.patch
Normal file
55
Revert-Fix-rt-tests-build-with-glibc-2.41.patch
Normal file
@ -0,0 +1,55 @@
|
||||
From 325b10a43bab7d1dfd0b061b40b764de649cbd64 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Thu, 10 Apr 2025 12:59:29 -0400
|
||||
Subject: [PATCH] Revert "Fix rt-tests build with glibc-2.41"
|
||||
|
||||
This reverts commit d3a23a0cc76789c3083df3bad78982cd49bc4c5e.
|
||||
|
||||
When people backport the feature into earlier versions of glibc, then
|
||||
the patches fails.
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/include/rt-sched.h | 2 --
|
||||
src/lib/rt-sched.c | 2 --
|
||||
2 files changed, 4 deletions(-)
|
||||
|
||||
diff --git a/src/include/rt-sched.h b/src/include/rt-sched.h
|
||||
index dfd7f45..80171c7 100644
|
||||
--- a/src/include/rt-sched.h
|
||||
+++ b/src/include/rt-sched.h
|
||||
@@ -42,7 +42,6 @@
|
||||
#define __NR_sched_getattr 275
|
||||
#endif
|
||||
|
||||
-#if ! __GLIBC_PREREQ(2, 41)
|
||||
struct sched_attr {
|
||||
uint32_t size;
|
||||
uint32_t sched_policy;
|
||||
@@ -68,6 +67,5 @@ int sched_getattr(pid_t pid,
|
||||
struct sched_attr *attr,
|
||||
unsigned int size,
|
||||
unsigned int flags);
|
||||
-#endif
|
||||
|
||||
#endif /* __RT_SCHED_H__ */
|
||||
diff --git a/src/lib/rt-sched.c b/src/lib/rt-sched.c
|
||||
index 2500abd..8023bc7 100644
|
||||
--- a/src/lib/rt-sched.c
|
||||
+++ b/src/lib/rt-sched.c
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include "rt-sched.h"
|
||||
|
||||
-#if ! __GLIBC_PREREQ(2, 41)
|
||||
int sched_setattr(pid_t pid,
|
||||
const struct sched_attr *attr,
|
||||
unsigned int flags)
|
||||
@@ -29,4 +28,3 @@ int sched_getattr(pid_t pid,
|
||||
{
|
||||
return syscall(__NR_sched_getattr, pid, attr, size, flags);
|
||||
}
|
||||
-#endif
|
||||
--
|
||||
2.49.0
|
||||
|
||||
@ -6,7 +6,7 @@ Name: realtime-tests
|
||||
# Numa argument to make: NUMA=1
|
||||
#
|
||||
Version: 2.8
|
||||
Release: 4%{?dist}
|
||||
Release: 5%{?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
|
||||
@ -27,7 +27,9 @@ Patch3: Turn-off-Wunused-parameter.patch
|
||||
Patch4: Enable-Werror.patch
|
||||
Patch5: Remove-unused-parameter-annotations.patch
|
||||
Patch6: pip_stress-Add-option-usleep.patch
|
||||
|
||||
Patch7: Fix-rt-tests-build-with-glibc-2.41.patch
|
||||
Patch8: Revert-Fix-rt-tests-build-with-glibc-2.41.patch
|
||||
Patch9: sched_attr-Do-not-define-for-glibc-2.41.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
|
||||
@ -85,6 +87,12 @@ latency. It also tests the functioning of priority-inheritance mutexes.
|
||||
%{_mandir}/man8/determine_maximum_mpps.8.*
|
||||
|
||||
%changelog
|
||||
* Thu Jun 26 2025 Tyonnchie Berry <tyberry@redhat.com> - 2.8-5
|
||||
- Added patch Fix-rt-tests-build-with-glibc-2.41.patch
|
||||
- Added patch Revert-Fix-rt-tests-build-with-glibc-2.41.patch
|
||||
- Added patch sched_attr-Do-not-define-for-glibc-2.41.patch
|
||||
Resolves: RHEL-88469
|
||||
|
||||
* Thu Jan 30 2025 John Kacur <jkacur@redhat.com> - 2.8-4
|
||||
- Add a usleep option to pip_stress
|
||||
Resolves: RHEL-77110
|
||||
|
||||
47
sched_attr-Do-not-define-for-glibc-2.41.patch
Normal file
47
sched_attr-Do-not-define-for-glibc-2.41.patch
Normal file
@ -0,0 +1,47 @@
|
||||
From 30644eae4467b5a2de42b760403e2150683aff08 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 28 Jan 2025 15:08:38 -0800
|
||||
Subject: [PATCH] sched_attr: Do not define for glibc >= 2.41
|
||||
|
||||
glibc 2.41+ has added [1] definitions for sched_setattr and sched_getattr functions
|
||||
and struct sched_attr. Therefore, it needs to be checked for here as well before
|
||||
defining sched_attr
|
||||
|
||||
Define sched_attr conditionally on SCHED_ATTR_SIZE_VER0
|
||||
|
||||
Fixes builds with glibc/trunk
|
||||
|
||||
[1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=21571ca0d70302909cf72707b2a7736cf12190a0;hp=298bc488fdc047da37482f4003023cb9adef78f8
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Cc: Clark Williams <williams@redhat.com>
|
||||
Cc: John Kacur <jkacur@redhat.com>
|
||||
Cc: rt-users <linux-rt-users@vger.kernel.org>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/include/rt-sched.h | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/include/rt-sched.h b/src/include/rt-sched.h
|
||||
index 80171c7..9cf0e3a 100644
|
||||
--- a/src/include/rt-sched.h
|
||||
+++ b/src/include/rt-sched.h
|
||||
@@ -42,6 +42,8 @@
|
||||
#define __NR_sched_getattr 275
|
||||
#endif
|
||||
|
||||
+/* sched_attr is not defined in glibc < 2.41 */
|
||||
+#ifndef SCHED_ATTR_SIZE_VER0
|
||||
struct sched_attr {
|
||||
uint32_t size;
|
||||
uint32_t sched_policy;
|
||||
@@ -68,4 +70,6 @@ int sched_getattr(pid_t pid,
|
||||
unsigned int size,
|
||||
unsigned int flags);
|
||||
|
||||
+#endif /* SCHED_ATTR_SIZE_VER0 */
|
||||
+
|
||||
#endif /* __RT_SCHED_H__ */
|
||||
--
|
||||
2.49.0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user