diff --git a/rteval-kcompile-Fix-regular-expression-to-match-kern.patch b/rteval-kcompile-Fix-regular-expression-to-match-kern.patch new file mode 100644 index 0000000..29df90f --- /dev/null +++ b/rteval-kcompile-Fix-regular-expression-to-match-kern.patch @@ -0,0 +1,43 @@ +From ddbff5f40845c64dbf40f8cbed018242d20abfcb Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Fri, 3 Jun 2022 11:16:59 -0400 +Subject: [PATCH 15/17] rteval: kcompile: Fix regular expression to match + kernel prefix + +If the user specifies a kernel to compile as a load other than the +default kernel, the kernel prefix is obtained with a regular expression. + +Currently the regular expression does not accomodate two digit numbers +in the kernel version. +Fix that regular expression to accomodate different kernel versions, +with room to grow for the future. + +Signed-off-by: John Kacur +--- + rteval/modules/loads/kcompile.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py +index 2701a0dcba91..3d9b882d8810 100644 +--- a/rteval/modules/loads/kcompile.py ++++ b/rteval/modules/loads/kcompile.py +@@ -169,7 +169,7 @@ class Kcompile(CommandLineLoad): + if not os.path.exists(tarfile): + raise rtevalRuntimeError(self, " tarfile %s does not exist!" % tarfile) + self.source = tarfile +- kernel_prefix = re.search(r"linux-\d\.\d", self.source).group(0) ++ kernel_prefix = re.search(r"linux-\d{1,2}\.\d{1,3}", self.source).group(0) + else: + tarfiles = glob.glob(os.path.join(self.srcdir, "%s*" % DEFAULT_KERNEL_PREFIX)) + if tarfiles: +@@ -177,6 +177,7 @@ class Kcompile(CommandLineLoad): + else: + raise rtevalRuntimeError(self, " no kernel tarballs found in %s" % self.srcdir) + kernel_prefix = DEFAULT_KERNEL_PREFIX ++ self._log(Log.DEBUG, f"kernel_prefix = {kernel_prefix}") + + # check for existing directory + kdir = None +-- +2.36.1 + diff --git a/rteval-kcompile-Fix-source-tarball-argument-handling.patch b/rteval-kcompile-Fix-source-tarball-argument-handling.patch new file mode 100644 index 0000000..07d2a49 --- /dev/null +++ b/rteval-kcompile-Fix-source-tarball-argument-handling.patch @@ -0,0 +1,65 @@ +From bc36f2007d614748397c0ccec518ecb2876daca9 Mon Sep 17 00:00:00 2001 +From: Valentin Schneider +Date: Tue, 3 May 2022 12:01:06 +0100 +Subject: [PATCH 09/17] rteval: kcompile: Fix source tarball argument handling + +Kcompile._WorkloadSetup() looks for a "tarball" and "tarfile" entry in +the CfgSection, but I couldn't find a single setter for thoses. The +only way for a user to specify a file is via --kcompile-source, which +doesn't seem to be actually used by the module. + +Make Kcompile actually use --kcompile-source. + +Signed-off-by: Valentin Schneider +Signed-off-by: John Kacur +--- + rteval/modules/loads/kcompile.py | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py +index add0cd86cde4..2701a0dcba91 100644 +--- a/rteval/modules/loads/kcompile.py ++++ b/rteval/modules/loads/kcompile.py +@@ -28,6 +28,7 @@ import sys + import os + import os.path + import glob ++import re + import subprocess + from rteval.modules import rtevalRuntimeError + from rteval.modules.loads import CommandLineLoad +@@ -35,7 +36,7 @@ from rteval.Log import Log + from rteval.misc import expand_cpulist, compress_cpulist + from rteval.systopology import SysTopology + +-kernel_prefix = "linux-5.13" ++DEFAULT_KERNEL_PREFIX = "linux-5.13" + + class KBuildJob: + '''Class to manage a build job bound to a particular node''' +@@ -163,17 +164,19 @@ class Kcompile(CommandLineLoad): + return + + # find our source tarball +- if 'tarball' in self._cfg: +- tarfile = os.path.join(self.srcdir, self._cfg.tarfile) ++ if self._cfg.source: ++ tarfile = os.path.join(self.srcdir, self._cfg.source) + if not os.path.exists(tarfile): + raise rtevalRuntimeError(self, " tarfile %s does not exist!" % tarfile) + self.source = tarfile ++ kernel_prefix = re.search(r"linux-\d\.\d", self.source).group(0) + else: +- tarfiles = glob.glob(os.path.join(self.srcdir, "%s*" % kernel_prefix)) ++ tarfiles = glob.glob(os.path.join(self.srcdir, "%s*" % DEFAULT_KERNEL_PREFIX)) + if tarfiles: + self.source = tarfiles[0] + else: + raise rtevalRuntimeError(self, " no kernel tarballs found in %s" % self.srcdir) ++ kernel_prefix = DEFAULT_KERNEL_PREFIX + + # check for existing directory + kdir = None +-- +2.36.1 + diff --git a/rteval-kcompile-Use-systopology-to-get-a-list-of-cpu.patch b/rteval-kcompile-Use-systopology-to-get-a-list-of-cpu.patch new file mode 100644 index 0000000..3c05cf6 --- /dev/null +++ b/rteval-kcompile-Use-systopology-to-get-a-list-of-cpu.patch @@ -0,0 +1,35 @@ +From da95d97bafc9b0740a83da93ba304345ab3c157f Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Fri, 29 Apr 2022 16:06:01 -0400 +Subject: [PATCH 08/17] rteval: kcompile: Use systopology to get a list of cpus + on a node + +kcompile gets a lists of cpus on a node but doesn't take into account +whether the cpus are online or not. + +Instead of using the method in kcompile, use the method in systopology, +since that will consider whether the cpus are online or not. + +Reported-by: Valentin Schneider +Tested-by: Valentin Schneider +Signed-off-by: John Kacur +--- + rteval/modules/loads/kcompile.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py +index 367f8dc1ca86..add0cd86cde4 100644 +--- a/rteval/modules/loads/kcompile.py ++++ b/rteval/modules/loads/kcompile.py +@@ -202,7 +202,7 @@ class Kcompile(CommandLineLoad): + self.cpus = {} + self.nodes = self.topology.getnodes() + for n in self.nodes: +- self.cpus[n] = [int(c.split('/')[-1][3:]) for c in glob.glob('/sys/devices/system/node/node%s/cpu[0-9]*' % n)] ++ self.cpus[n] = self.topology.getcpus(n) + self.cpus[n].sort() + + # if a cpulist was specified, only allow cpus in that list on the node +-- +2.36.1 + diff --git a/rteval.spec b/rteval.spec index 53fa5fc..1c086fb 100644 --- a/rteval.spec +++ b/rteval.spec @@ -1,6 +1,6 @@ Name: rteval Version: 3.3 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Utility to evaluate system suitability for RT Linux Group: Development/Tools @@ -35,7 +35,10 @@ Patch3: rteval-Don-t-restrict-measurement-threads-to-inherit.patch Patch4: rteval-If-the-user-doesn-t-specify-a-cpumask-use-the.patch Patch5: rteval-Fix-Popen-for-python3.6-where-text-True-is-no.patch Patch6: rteval-Fix-allmodconfig-build-on-machines-that-don-t.patch -Patch7: rteval-Change-the-default-kernel-to-compile.patch +Patch7: rteval-kcompile-Use-systopology-to-get-a-list-of-cpu.patch +Patch8: rteval-kcompile-Fix-source-tarball-argument-handling.patch +Patch9: rteval-kcompile-Fix-regular-expression-to-match-kern.patch +Patch10: rteval-Change-the-default-kernel-to-compile.patch %description The rteval script is a utility for measuring various aspects of @@ -54,6 +57,10 @@ to the screen. %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 %build %{__python3} setup.py build @@ -80,6 +87,10 @@ rm -rf $RPM_BUILD_ROOT %{python3_sitelib}/rteval/__pycache__/* %changelog +* Wed Jun 22 2022 John Kacur - 3.3-7 +- Add upstream kcompile patches +Resolves: rhbz#2093480 + * Tue Jun 07 2022 John Kacur - 3.3-6 - Updates the Requires for rteval-loads with the correct kernel version Resolves: rhbz#2093480