diff --git a/.gitignore b/.gitignore index c5cd9ec..2e62a00 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/rteval-3.2.tar.xz +SOURCES/rteval-3.3.tar.xz diff --git a/.rteval.metadata b/.rteval.metadata index 51e5107..6abb67a 100644 --- a/.rteval.metadata +++ b/.rteval.metadata @@ -1 +1 @@ -91a7a126a2fafd88f03880a21c656fd571a347f5 SOURCES/rteval-3.2.tar.xz +557793c55592bfb3dc0e858274895af4347a2fe9 SOURCES/rteval-3.3.tar.xz diff --git a/SOURCES/rteval-Don-t-restrict-measurement-threads-to-inherit.patch b/SOURCES/rteval-Don-t-restrict-measurement-threads-to-inherit.patch new file mode 100644 index 0000000..b4a8f80 --- /dev/null +++ b/SOURCES/rteval-Don-t-restrict-measurement-threads-to-inherit.patch @@ -0,0 +1,51 @@ +From 75667f4b92e3120bced7ae5464d97941edffd802 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Mon, 7 Feb 2022 16:09:13 -0500 +Subject: [PATCH] rteval: Don't restrict measurement threads to inherited + cpumask + +This patch reverses be811d28a471cfcaf7960289e00960e7f5b18f03 + +This patch syncs rteval to 795433f50f20ef7598db5cfe991b5386e4080d41 in +rt-tests + +If the user does not specify a cpumask, rteval will still run on the +cpus according to the cpumask inherited from the runtime environment. +However, if the user specifies a cpumask, then it will overwrite the +runtime environment where allowed. + +This will allow the user to run measurement threads on isolated cpus. + +Signed-off-by: John Kacur +--- + rteval/modules/measurement/cyclictest.py | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py +index 5330d1466302..4ca310bf7490 100644 +--- a/rteval/modules/measurement/cyclictest.py ++++ b/rteval/modules/measurement/cyclictest.py +@@ -217,19 +217,9 @@ class Cyclictest(rtevalModulePrototype): + else: + self.__cpus = online_cpus() + +- # Sort the list of cpus to align with the order reported by +- # cyclictest ++ # Sort the list of cpus to align with the order reported by cyclictest + self.__cpus.sort(key=int) + +- # Get the cpuset from the environment +- cpuset = os.sched_getaffinity(0) +- +- # Convert the elements to strings +- cpuset = [str(c) for c in cpuset] +- +- # Only include cpus that are in the cpuset +- self.__cpus = [c for c in self.__cpus if c in cpuset] +- + self.__numcores = len(self.__cpus) + + info = cpuinfo() +-- +2.34.1 + diff --git a/SOURCES/rteval-Fix-Popen-for-python3.6-where-text-True-is-no.patch b/SOURCES/rteval-Fix-Popen-for-python3.6-where-text-True-is-no.patch new file mode 100644 index 0000000..cd05472 --- /dev/null +++ b/SOURCES/rteval-Fix-Popen-for-python3.6-where-text-True-is-no.patch @@ -0,0 +1,53 @@ +From 19f9aa600ae331eb2fadf5f821f539bf24f0dea3 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Tue, 18 Jan 2022 15:03:36 -0500 +Subject: [PATCH] rteval: Fix Popen for python3.6 where text=True is not + available + +Fix using text=True in Popen for python-3.6 by using +encoding='utf-8' instead + +Signed-off-by: John Kacur +--- + rteval/sysinfo/services.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/rteval/sysinfo/services.py b/rteval/sysinfo/services.py +index e5de22efc342..c85980e19165 100644 +--- a/rteval/sysinfo/services.py ++++ b/rteval/sysinfo/services.py +@@ -62,11 +62,11 @@ class SystemServices: + if not [1 for p in reject if fnmatch.fnmatch(servicename, p)] \ + and os.access(service, os.X_OK): + cmd = '%s -qs "\(^\|\W\)status)" %s' % (getcmdpath('grep'), service) +- c = subprocess.Popen(cmd, shell=True, text=True) ++ c = subprocess.Popen(cmd, shell=True, encoding='utf-8') + c.wait() + if c.returncode == 0: + cmd = ['env', '-i', 'LANG="%s"' % os.environ['LANG'], 'PATH="%s"' % os.environ['PATH'], 'TERM="%s"' % os.environ['TERM'], service, 'status'] +- c = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) ++ c = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8') + c.wait() + if c.returncode == 0 and (c.stdout.read() or c.stderr.read()): + ret_services[servicename] = 'running' +@@ -81,7 +81,7 @@ class SystemServices: + ret_services = {} + cmd = '%s list-unit-files -t service --no-legend' % getcmdpath('systemctl') + self.__log(Log.DEBUG, "cmd: %s" % cmd) +- c = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) ++ c = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8') + for p in c.stdout: + # p are lines like b'servicename.service status' + v = p.strip().split() +@@ -91,7 +91,7 @@ class SystemServices: + + def services_get(self): + cmd = [getcmdpath('ps'), '-ocomm=', '1'] +- c = subprocess.Popen(cmd, stdout=subprocess.PIPE, text=True) ++ c = subprocess.Popen(cmd, stdout=subprocess.PIPE, encoding='utf-8') + self.__init = c.stdout.read().strip() + if self.__init == 'systemd': + self.__log(Log.DEBUG, "Using systemd to get services status") +-- +2.31.1 + diff --git a/SOURCES/rteval-Fix-test-misses-threshold-assignment.patch b/SOURCES/rteval-Fix-test-misses-threshold-assignment.patch new file mode 100644 index 0000000..cb9fe3b --- /dev/null +++ b/SOURCES/rteval-Fix-test-misses-threshold-assignment.patch @@ -0,0 +1,32 @@ +From aca562064a8d9f5927aa39bc108eac3bf4d0a56b Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Fri, 14 Jan 2022 14:00:54 -0500 +Subject: [PATCH] rteval: Fix test misses threshold assignment + +Fix case where self.__cfg.threshold has a value but +instead of 'threshold' in self.__cfg, +'breaktrace' in self.__cfg. +by just checking whether self.__cfg.threshold has a value +if self._cfg.breaktrace does not have a value + +Signed-off-by: John Kacur +--- + rteval/modules/measurement/cyclictest.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py +index cc74b467913d..af8adeeeb402 100644 +--- a/rteval/modules/measurement/cyclictest.py ++++ b/rteval/modules/measurement/cyclictest.py +@@ -299,7 +299,7 @@ class Cyclictest(rtevalModulePrototype): + if 'breaktrace' in self.__cfg and self.__cfg.breaktrace: + self.__cmd.append("-b%d" % int(self.__cfg.breaktrace)) + self.__cmd.append("--tracemark") +- elif 'threshold' in self.__cfg and self.__cfg.threshold: ++ elif self.__cfg.threshold: + self.__cmd.append("-b%d" % int(self.__cfg.threshold)) + + # Buffer for cyclictest data written to stdout +-- +2.31.1 + diff --git a/SOURCES/rteval-If-the-user-doesn-t-specify-a-cpumask-use-the.patch b/SOURCES/rteval-If-the-user-doesn-t-specify-a-cpumask-use-the.patch new file mode 100644 index 0000000..3745bb1 --- /dev/null +++ b/SOURCES/rteval-If-the-user-doesn-t-specify-a-cpumask-use-the.patch @@ -0,0 +1,34 @@ +From 14b0cff41f13602579fd708748eb8a2ad93db85b Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Mon, 14 Feb 2022 22:09:21 -0500 +Subject: [PATCH] rteval: If the user doesn't specify a cpumask, use the + inherited one + +If the user doesn't specify a cpumask, then we need to use the inherited +one to match what cyclictest currently does + +Signed-off-by: John Kacur +--- + rteval/modules/measurement/cyclictest.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py +index 4ca310bf7490..8fdd5341794a 100644 +--- a/rteval/modules/measurement/cyclictest.py ++++ b/rteval/modules/measurement/cyclictest.py +@@ -216,6 +216,12 @@ class Cyclictest(rtevalModulePrototype): + self.__sparse = True + else: + self.__cpus = online_cpus() ++ # Get the cpuset from the environment ++ cpuset = os.sched_getaffinity(0) ++ # Convert the elements to strings ++ cpuset = [str(c) for c in cpuset] ++ # Only include cpus that are in the cpuset ++ self.__cpus = [c for c in self.__cpus if c in cpuset] + + # Sort the list of cpus to align with the order reported by cyclictest + self.__cpus.sort(key=int) +-- +2.34.1 + diff --git a/SOURCES/rteval-Increase-default-buckets-from-2000-to-3500.patch b/SOURCES/rteval-Increase-default-buckets-from-2000-to-3500.patch new file mode 100644 index 0000000..e000f59 --- /dev/null +++ b/SOURCES/rteval-Increase-default-buckets-from-2000-to-3500.patch @@ -0,0 +1,60 @@ +From 9dff629f186313beebb96594d236dd9268bef1b1 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 26 Jan 2022 10:06:33 -0500 +Subject: [PATCH] rteval: Increase default buckets from 2000 to 3500 + +Increase the default buckets from 2000 to 3500 + +With commit 0292c8963611 we skip statistics reporting if we run out of +buckets. Increase the default number of buckets to make this less likely +to occur. + +Signed-off-by: John Kacur +--- + doc/rteval.8 | 2 +- + rteval/modules/measurement/cyclictest.py | 2 +- + rteval/rteval.conf | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/doc/rteval.8 b/doc/rteval.8 +index fa24509ce7e5..25dcfcc298e7 100644 +--- a/doc/rteval.8 ++++ b/doc/rteval.8 +@@ -122,7 +122,7 @@ Measurement thread interval in microseconds (default: 100) + Interval increment in microseconds (default: 0) + .TP + .B \-\-cyclictest-buckets=NBUCKETS +-Number of 1 microsecond histogram buckets (default: 2000) ++Number of 1 microsecond histogram buckets (default: 3500) + .TP + .B \-\-hackbench-jobspercore=N + Number of jobs per online-core for hackbench load +diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py +index af8adeeeb402..5330d1466302 100644 +--- a/rteval/modules/measurement/cyclictest.py ++++ b/rteval/modules/measurement/cyclictest.py +@@ -450,7 +450,7 @@ def ModuleParameters(): + "default": 100, + "metavar": "INTV_US"}, + "buckets": {"descr": "Histogram width", +- "default": 2000, ++ "default": 3500, + "metavar": "NUM"}, + "priority": {"descr": "Run cyclictest with the given priority", + "default": 95, +diff --git a/rteval/rteval.conf b/rteval/rteval.conf +index 7ce6ef0b5acc..aa0a53bcfc63 100644 +--- a/rteval/rteval.conf ++++ b/rteval/rteval.conf +@@ -6,7 +6,7 @@ duration: 60.0 + report_interval: 600 + + [cyclictest] +-buckets: 2000 ++buckets: 3500 + interval: 100 + distance: 0 + priority: 95 +-- +2.34.1 + diff --git a/SOURCES/rteval-Restrict-measurement-threads-to-the-cpus-in-cpumask.patch b/SOURCES/rteval-Restrict-measurement-threads-to-the-cpus-in-cpumask.patch deleted file mode 100644 index e55a6f1..0000000 --- a/SOURCES/rteval-Restrict-measurement-threads-to-the-cpus-in-cpumask.patch +++ /dev/null @@ -1,35 +0,0 @@ -From be811d28a471cfcaf7960289e00960e7f5b18f03 Mon Sep 17 00:00:00 2001 -From: John Kacur -Date: Thu, 15 Jul 2021 10:09:03 -0400 -Subject: [PATCH] rteval: Restrict measurement threads to the cpus in cpumask - -Only run measurement threads on cpus in the list from sched_getaffinity - -Signed-off-by: John Kacur ---- - rteval/modules/measurement/cyclictest.py | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py -index 232bd6b9acc6..ae91dbb7c043 100644 ---- a/rteval/modules/measurement/cyclictest.py -+++ b/rteval/modules/measurement/cyclictest.py -@@ -209,6 +209,15 @@ class Cyclictest(rtevalModulePrototype): - else: - self.__cpus = online_cpus() - -+ # Get the cpuset from the environment -+ cpuset = os.sched_getaffinity(0) -+ -+ # Convert the elements to strings -+ cpuset = [str(c) for c in cpuset] -+ -+ # Only include cpus that are in the cpuset -+ self.__cpus = [c for c in self.__cpus if c in cpuset] -+ - self.__numcores = len(self.__cpus) - - info = cpuinfo() --- -2.31.1 - diff --git a/SPECS/rteval.spec b/SPECS/rteval.spec index e0f0d07..7e4328e 100644 --- a/SPECS/rteval.spec +++ b/SPECS/rteval.spec @@ -1,6 +1,6 @@ Name: rteval -Version: 3.2 -Release: 2%{?dist} +Version: 3.3 +Release: 6%{?dist} Summary: Utility to evaluate system suitability for RT Linux Group: Development/Tools @@ -15,23 +15,28 @@ Requires: python3-ethtool Requires: python3-lxml Requires: python3-dmidecode >= 3.10 Requires: rt-tests >= 1.5-11 -Requires: rteval-loads >= 1.4-7 +Requires: rteval-loads >= 1.5-1 Requires: sysstat -Requires: xz bzip2 +Requires: xz bzip2 tar gzip m4 make gawk Requires: kernel-headers Requires: sos -Requires: tar BuildArch: noarch Obsoletes: rteval <= 2.14 Requires: numactl -Requires: gcc flex bison bc make +Requires: gcc binutils gcc-c++ flex bison bc make Requires: elfutils elfutils-libelf-devel -Requires: openssl -Requires: openssl-devel +Requires: openssl openssl-devel +Requires: stress-ng +Requires: perl-interpreter perl-devel perl-generators +Requires: libmpc libmpc-devel Obsoletes: rteval-common <= 3.1 #Patches -Patch1: rteval-Restrict-measurement-threads-to-the-cpus-in-cpumask.patch +Patch1: rteval-Fix-test-misses-threshold-assignment.patch +Patch2: rteval-Fix-Popen-for-python3.6-where-text-True-is-no.patch +Patch3: rteval-Increase-default-buckets-from-2000-to-3500.patch +Patch4: rteval-Don-t-restrict-measurement-threads-to-inherit.patch +Patch5: rteval-If-the-user-doesn-t-specify-a-cpumask-use-the.patch %description The rteval script is a utility for measuring various aspects of @@ -45,6 +50,10 @@ to the screen. %prep %setup -q %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build %{__python3} setup.py build @@ -82,6 +91,46 @@ rm -rf $RPM_BUILD_ROOT %{python3_sitelib}/rteval/__pycache__/* %changelog +* Tue Feb 15 2022 John Kacur - 3.3-6 +- Use inherited cpumask if user doesn't specify a cpumask +Resolves: rhbz#2012284 + +* Mon Feb 07 2022 John Kacur - 3.3-5 +- Don't restrict threads to cpumask in environment if user specifies cpumask +Resolves: rhbz#2012284 + +* Thu Jan 27 2022 John Kacur - 3.3-4 +- Increase the default number of buckets from 2000 to 3500 +Resolves: rhbz#2046321 + +* Tue Jan 18 2022 John Kacur - 3.3-3 +- Fix Popen use of text=True not available in python3.6 +Resolves: rhbz#2041584 + +* Fri Jan 14 2022 John Kacur - 3.3-2 +- Fix test missing threshold assignment +Resolves: rhbz#2012285 + +* Thu Jan 13 2022 John Kacur - 3.3-1 +- Rebase to upstream rteval-3.3 +Resolves: rhbz#2012291 + +* Wed Jan 12 2022 John Kacur - 3.2-4 +- Do not pass obsolete notrace option to cyclictest +- Parse maximum latency even if outside configured buckets +- Sort the list of cpus +- Skip statistics generation if max latency outside of configured buckets +- Add --cyclictest-threshold=USEC feature +- Add libmpc and libmpc-devel to the Requires +Resolves: rhbz#2012285 + +* Thu Nov 04 2021 John Kacur - 3.2-3 +- allow hackbench to run with warning on low mem +- clean-ups to hackbench.py +- make donotrun work correctly in load modules +- Add the idea of an exclusive load module and make stress-ng one +Resolves: rhbz#1872776 + * Thu Jul 15 2021 John Kacur - 3.2-2 - Restrict measurement threads to cpus in cpumask Resolves: rhbz#1942261