From c57314baf832ae6fb0141af06b9b83a94f9008c9 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 3 Nov 2020 06:55:40 -0500 Subject: [PATCH] import rteval-3.0-13.el8 --- ...emove-non-distutil-install-leftovers.patch | 51 +++++ ...le-Use-parentheses-around-print-args.patch | 29 +++ ...-t-abort-if-a-workload-isn-t-running.patch | 34 +++ .../rteval-Add-the-stressng-load-module.patch | 199 ++++++++++++++++++ ...orrectly-when-model-name-has-a-colon.patch | 37 ++++ ...elf.cmd-to-self.args-for-inheritance.patch | 83 ++++++++ ...e-changes-to-rteval-modules-measurem.patch | 57 +++++ .../rteval-Use-linux-5.7-in-kcompile.patch | 80 +++++++ ...t.py-Some-style-changes-suggested-by.patch | 100 +++++++++ ....py-Some-Style-changes-suggested-by-.patch | 70 ++++++ ...py-Some-style-changes-suggested-by-p.patch | 133 ++++++++++++ ..._init__.py-Some-style-changes-sugges.patch | 117 ++++++++++ ...g.py-Some-style-changes-suggested-fr.patch | 45 ++++ ...init__.py-A-few-style-changes-sugges.patch | 38 ++++ ...d-Some-style-changes-suggested-by-py.patch | 87 ++++++++ ...fig.py-Some-style-changes-suggested-.patch | 117 ++++++++++ ...lReport.py-Fix-non-existant-variable.patch | 28 +++ ...ort.py-Some-style-changes-suggested-.patch | 51 +++++ ...ome-style-changes-suggested-by-pylin.patch | 55 +++++ ...gy.py-Some-style-changes-suggested-b.patch | 103 +++++++++ SPECS/rteval.spec | 77 ++++++- 21 files changed, 1587 insertions(+), 4 deletions(-) create mode 100644 SOURCES/Makefile-Remove-non-distutil-install-leftovers.patch create mode 100644 SOURCES/Makefile-Use-parentheses-around-print-args.patch create mode 100644 SOURCES/modules-Don-t-abort-if-a-workload-isn-t-running.patch create mode 100644 SOURCES/rteval-Add-the-stressng-load-module.patch create mode 100644 SOURCES/rteval-Parse-cpuinfo-correctly-when-model-name-has-a-colon.patch create mode 100644 SOURCES/rteval-Rename-self.cmd-to-self.args-for-inheritance.patch create mode 100644 SOURCES/rteval-Some-style-changes-to-rteval-modules-measurem.patch create mode 100644 SOURCES/rteval-Use-linux-5.7-in-kcompile.patch create mode 100644 SOURCES/rteval-cyclictest.py-Some-style-changes-suggested-by.patch create mode 100644 SOURCES/rteval-hackbench.py-Some-Style-changes-suggested-by-.patch create mode 100644 SOURCES/rteval-kcompile.py-Some-style-changes-suggested-by-p.patch create mode 100644 SOURCES/rteval-modules-__init__.py-Some-style-changes-sugges.patch create mode 100644 SOURCES/rteval-rteval-Log.py-Some-style-changes-suggested-fr.patch create mode 100644 SOURCES/rteval-rteval-__init__.py-A-few-style-changes-sugges.patch create mode 100644 SOURCES/rteval-rteval-cmd-Some-style-changes-suggested-by-py.patch create mode 100644 SOURCES/rteval-rtevalConfig.py-Some-style-changes-suggested-.patch create mode 100644 SOURCES/rteval-rtevalReport.py-Fix-non-existant-variable.patch create mode 100644 SOURCES/rteval-rtevalReport.py-Some-style-changes-suggested-.patch create mode 100644 SOURCES/rteval-sysstat-Some-style-changes-suggested-by-pylin.patch create mode 100644 SOURCES/rteval-systopology.py-Some-style-changes-suggested-b.patch diff --git a/SOURCES/Makefile-Remove-non-distutil-install-leftovers.patch b/SOURCES/Makefile-Remove-non-distutil-install-leftovers.patch new file mode 100644 index 0000000..9f39443 --- /dev/null +++ b/SOURCES/Makefile-Remove-non-distutil-install-leftovers.patch @@ -0,0 +1,51 @@ +From 3a432a4217e1d91bb1dbc2e0503942997c40f370 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Mon, 6 Apr 2020 17:14:03 -0500 +Subject: [PATCH 01/17] Makefile: Remove non-distutil install leftovers + +setup.py installs into /usr/local by default, but the makefile +is still creating directories in /usr that it doesn't install +anything into. Worse, the uninstall target removes things +from /usr rather than what was installed by "make install". + +Signed-off-by: Scott Wood +Signed-off-by: John Kacur +--- + Makefile | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/Makefile b/Makefile +index f784ba778bc3..f91e6e06a9a4 100644 +--- a/Makefile ++++ b/Makefile +@@ -15,9 +15,6 @@ XMLRPCDIR := server + DESTDIR := + PREFIX := /usr + DATADIR := $(DESTDIR)/$(PREFIX)/share +-CONFDIR := $(DESTDIR)/etc +-MANDIR := $(DESTDIR)/$(PREFIX)/share/man +-PYLIB := $(DESTDIR)$(shell $(PYTHON) -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()') + LOADDIR := loadsource + + KLOAD := $(LOADDIR)/linux-5.1.tar.xz +@@ -60,17 +57,6 @@ install_loads: $(LOADS) + + installdirs: + [ -d $(DATADIR)/rteval ] || mkdir -p $(DATADIR)/rteval +- [ -d $(CONFDIR) ] || mkdir -p $(CONFDIR) +- [ -d $(MANDIR)/man8 ] || mkdir -p $(MANDIR)/man8 +- [ -d $(PYLIB) ] || mkdir -p $(PYLIB) +- [ -d $(DESTDIR)/usr/bin ] || mkdir -p $(DESTDIR)/usr/bin +- +-uninstall: +- rm -f /usr/bin/rteval +- rm -f $(CONFDIR)/rteval.conf +- rm -f $(MANDIR)/man8/rteval.8.gz +- rm -rf $(PYLIB)/rteval +- rm -rf $(DATADIR)/rteval + + tarfile: rteval-$(VERSION).tar.bz2 + +-- +2.21.3 + diff --git a/SOURCES/Makefile-Use-parentheses-around-print-args.patch b/SOURCES/Makefile-Use-parentheses-around-print-args.patch new file mode 100644 index 0000000..270f64d --- /dev/null +++ b/SOURCES/Makefile-Use-parentheses-around-print-args.patch @@ -0,0 +1,29 @@ +From 91f72680851a7ab863d3733bc90e915404e68bc8 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Mon, 6 Apr 2020 17:14:04 -0500 +Subject: [PATCH 02/17] Makefile: Use parentheses around print args + +Otherwise, this fails on python3. + +Signed-off-by: Scott Wood +Signed-off-by: John Kacur +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index f91e6e06a9a4..479bda8d8674 100644 +--- a/Makefile ++++ b/Makefile +@@ -5,7 +5,7 @@ else + PYTHON = python2 + endif + PACKAGE := rteval +-VERSION := $(shell $(PYTHON) -c "from rteval import RTEVAL_VERSION; print RTEVAL_VERSION") ++VERSION := $(shell $(PYTHON) -c "from rteval import RTEVAL_VERSION; print(RTEVAL_VERSION)") + D := 10 + + # XML-RPC related files +-- +2.21.3 + diff --git a/SOURCES/modules-Don-t-abort-if-a-workload-isn-t-running.patch b/SOURCES/modules-Don-t-abort-if-a-workload-isn-t-running.patch new file mode 100644 index 0000000..8380aad --- /dev/null +++ b/SOURCES/modules-Don-t-abort-if-a-workload-isn-t-running.patch @@ -0,0 +1,34 @@ +From 7aba0df2cc6072da955ee0ad8bf907dc10cec468 Mon Sep 17 00:00:00 2001 +From: Scott Wood +Date: Mon, 6 Apr 2020 17:14:05 -0500 +Subject: [PATCH 03/17] modules: Don't abort if a workload isn't running + +Each module is responsible for respawning the load when it finishes. The +only thing that the additional check at the rtevalModulePrototype level +accomplishes is introducing a race condition that will kill rteval if a +load ends after _WorkloadTask() checks, but before the check in the +caller. + +Signed-off-by: Scott Wood +Signed-off-by: John Kacur +--- + rteval/modules/__init__.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/rteval/modules/__init__.py b/rteval/modules/__init__.py +index 0feb8a916179..5ae7cd488406 100644 +--- a/rteval/modules/__init__.py ++++ b/rteval/modules/__init__.py +@@ -189,9 +189,6 @@ class rtevalModulePrototype(threading.Thread): + + if self.shouldStop(): + break +- if not self.WorkloadAlive(): +- self._log(Log.DEBUG, "%s workload stopped running." % self._module_type) +- break + time.sleep(self.__sleeptime) + + self.__timestamps["runloop_stop"] = datetime.now() +-- +2.21.3 + diff --git a/SOURCES/rteval-Add-the-stressng-load-module.patch b/SOURCES/rteval-Add-the-stressng-load-module.patch new file mode 100644 index 0000000..2a6432a --- /dev/null +++ b/SOURCES/rteval-Add-the-stressng-load-module.patch @@ -0,0 +1,199 @@ +From d136b8b29b0ec90f07d89dfd834e02f8f8e525b6 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Mon, 15 Jun 2020 18:06:45 -0400 +Subject: [PATCH 17/17] rteval: Add the stressng load module + +Add the stressng load module to run stress-ng as a load to rteval + +Signed-off-by: John Kacur +--- + rteval-cmd | 3 +- + rteval.conf | 1 + + rteval/modules/loads/stressng.py | 135 +++++++++++++++++++++++++++++++ + rteval/rteval.conf | 3 +- + 4 files changed, 140 insertions(+), 2 deletions(-) + create mode 100644 rteval/modules/loads/stressng.py + +diff --git a/rteval-cmd b/rteval-cmd +index 7d0d00516bd3..bc6948699788 100755 +--- a/rteval-cmd ++++ b/rteval-cmd +@@ -221,7 +221,8 @@ if __name__ == '__main__': + if not config.HasSection('loads'): + config.AppendConfig('loads', { + 'kcompile' : 'module', +- 'hackbench' : 'module'}) ++ 'hackbench' : 'module', ++ 'stressng' : 'module'}) + + if not config.HasSection('measurement'): + config.AppendConfig('measurement', { +diff --git a/rteval.conf b/rteval.conf +index 6b22b29943ee..4c32fcf4d842 100644 +--- a/rteval.conf ++++ b/rteval.conf +@@ -11,3 +11,4 @@ cyclictest: module + [loads] + kcompile: module + hackbench: module ++stressng: module +diff --git a/rteval/modules/loads/stressng.py b/rteval/modules/loads/stressng.py +new file mode 100644 +index 000000000000..e5edb51c4c44 +--- /dev/null ++++ b/rteval/modules/loads/stressng.py +@@ -0,0 +1,135 @@ ++""" Module containing class Stressng to manage stress-ng as an rteval load """ ++import os ++import os.path ++import time ++import subprocess ++import signal ++from rteval.modules.loads import CommandLineLoad ++from rteval.Log import Log ++from rteval.misc import expand_cpulist ++from rteval.systopology import SysTopology ++ ++class Stressng(CommandLineLoad): ++ " This class creates a load module that runs stress-ng " ++ def __init__(self, config, logger): ++ CommandLineLoad.__init__(self, "stressng", config, logger) ++ self.logger = logger ++ self.started = False ++ self.process = None ++ self.cfg = config ++ self.__in = None ++ self.__out = None ++ self.__err = None ++ self.__nullfp = None ++ self.cmd = None ++ " Only run this module if the user specifies an option " ++ if self.cfg.option is not None: ++ self._donotrun = False ++ else: ++ self._donotrun = True ++ ++ def _WorkloadSetup(self): ++ " Since there is nothing to build, we don't need to do anything here " ++ return ++ ++ def _WorkloadBuild(self): ++ " Nothing to build, so we are ready " ++ self._setReady() ++ ++ def _WorkloadPrepare(self): ++ " Set-up logging " ++ self.__nullfp = os.open("/dev/null", os.O_RDWR) ++ self.__in = self.__nullfp ++ if self._logging: ++ self.__out = self.open_logfile("stressng.stdout") ++ self.__err = self.open_logfile("stressng.stderr") ++ else: ++ self.__out = self.__err = self.__nullfp ++ ++ # stress-ng is only run if the user specifies an option ++ self.cmd = ['stress-ng'] ++ self.cmd.append('--%s' % str(self.cfg.option)) ++ if self.cfg.arg is not None: ++ self.cmd.append(self.cfg.arg) ++ if self.cfg.timeout is not None: ++ self.cmd.append('--timeout %s' % str(self.cfg.timeout)) ++ ++ systop = SysTopology() ++ # get the number of nodes ++ nodes = systop.getnodes() ++ ++ # get the cpus for each node ++ cpus = {} ++ for n in nodes: ++ cpus[n] = systop.getcpus(int(n)) ++ # if a cpulist was specified, only allow cpus in that list on the node ++ if self.cpulist: ++ cpus[n] = [c for c in cpus[n] if str(c) in expand_cpulist(self.cpulist)] ++ ++ # remove nodes with no cpus available for running ++ for node, cpu in list(cpus.items()): ++ if not cpu: ++ nodes.remove(node) ++ self._log(Log.DEBUG, "node %s has no available cpus, removing" % node) ++ if self.cpulist: ++ for node in nodes: ++ cpulist = ",".join([str(n) for n in cpus[node]]) ++ self.cmd.append('--taskset %s' % cpulist) ++ ++ def _WorkloadTask(self): ++ """ Kick of the workload here """ ++ if self.started: ++ # Only start the task once ++ return ++ ++ self._log(Log.DEBUG, "starting with %s" % " ".join(self.cmd)) ++ try: ++ self.process = subprocess.Popen(self.cmd, ++ stdout=self.__out, ++ stderr=self.__err, ++ stdin=self.__in) ++ self.started = True ++ self._log(Log.DEBUG, "running") ++ except OSError: ++ self._log(Log.DEBUG, "Failed to run") ++ self.started = False ++ return ++ ++ def WorkloadAlive(self): ++ " Return true if stress-ng workload is alive " ++ if self.started: ++ return self.process.poll() is None ++ return False ++ ++ def _WorkloadCleanup(self): ++ " Makesure to kill stress-ng before rteval ends " ++ if not self.started: ++ return ++ # poll() returns None if the process is still running ++ while self.process.poll() is None: ++ self._log(Log.DEBUG, "Sending SIGINT") ++ self.process.send_signal(signal.SIGINT) ++ time.sleep(2) ++ return ++ ++ ++def create(config, logger): ++ """ Create an instance of the Stressng class in stressng module """ ++ return Stressng(config, logger) ++ ++def ModuleParameters(): ++ """ Commandline options for Stress-ng """ ++ return { ++ "option": { ++ "descr": "stressor specific option", ++ "metavar": "OPTION" ++ }, ++ "arg": { ++ "descr": "stressor specific arg", ++ "metavar" : "ARG" ++ }, ++ "timeout": { ++ "descr": "timeout after T seconds", ++ "metavar" : "T" ++ }, ++ } +diff --git a/rteval/rteval.conf b/rteval/rteval.conf +index 0d1afb30b754..db0b8ef005b6 100644 +--- a/rteval/rteval.conf ++++ b/rteval/rteval.conf +@@ -15,9 +15,10 @@ priority: 95 + kcompile: module + hackbench: module + dbench: external ++stressng: module + + [kcompile] +-source: linux-2.6.39.tar.bz2 ++source: linux-5.1.xz + jobspercore: 2 + + [hackbench] +-- +2.21.3 + diff --git a/SOURCES/rteval-Parse-cpuinfo-correctly-when-model-name-has-a-colon.patch b/SOURCES/rteval-Parse-cpuinfo-correctly-when-model-name-has-a-colon.patch new file mode 100644 index 0000000..d778e43 --- /dev/null +++ b/SOURCES/rteval-Parse-cpuinfo-correctly-when-model-name-has-a-colon.patch @@ -0,0 +1,37 @@ +From 08c37d8d5b5476a9ecf128eebe9aed1c033b1b08 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Thu, 27 Aug 2020 15:41:07 -0400 +Subject: [PATCH] rteval: Parse cpuinfo correctly when model name has a colon + +The function cpuinfo() splits fields in /proc/cpuinfo with a colon ':' + +This can cause a +ValueError: too many values to unpack (expected 2) + +This is easily fixed by setting the maximum number of splits to 1 + +Signed-off-by: John Kacur +--- + rteval/misc.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/rteval/misc.py b/rteval/misc.py +index a43a8964e061..6184c9286f11 100644 +--- a/rteval/misc.py ++++ b/rteval/misc.py +@@ -69,8 +69,10 @@ def cpuinfo(): + info = {} + for l in open('/proc/cpuinfo'): + l = l.strip() +- if not l: continue +- key,val = [ i.strip() for i in l.split(':')] ++ if not l: ++ continue ++ # Split a maximum of one time. In case a model name has ':' in it ++ key, val = [i.strip() for i in l.split(':', 1)] + if key == 'processor': + core = val + info[core] = {} +-- +2.26.2 + diff --git a/SOURCES/rteval-Rename-self.cmd-to-self.args-for-inheritance.patch b/SOURCES/rteval-Rename-self.cmd-to-self.args-for-inheritance.patch new file mode 100644 index 0000000..cdcacce --- /dev/null +++ b/SOURCES/rteval-Rename-self.cmd-to-self.args-for-inheritance.patch @@ -0,0 +1,83 @@ +From 0b45cccbe759c9f32bdf9903ed5a5f2a687692ee Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 24 Jun 2020 09:06:01 -0400 +Subject: [PATCH] rteval: Rename self.cmd to self.args for inheritance in + stressng + +Load modules inherits from CommandLineLoad +CommandLineLoad has a method MakeReport which relies on the variable +"args". Class Stressng needs to use this variable name instead of it's +own for this mechanism to work. + +This commit changes the name in Stressng, but perhaps a better fix in +the future would be to use accessor methods, instead of relying on a +variable name + +This commit also sets jobs to 1, which is required in MakeReport. The +actual number of jobs is handled by the external stress-ng program, +depending upon the arg that Class Stressng invokes it with. + +Signed-off-by: John Kacur +--- + rteval/modules/loads/stressng.py | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/rteval/modules/loads/stressng.py b/rteval/modules/loads/stressng.py +index e5edb51c4c44..926de38e3116 100644 +--- a/rteval/modules/loads/stressng.py ++++ b/rteval/modules/loads/stressng.py +@@ -21,7 +21,7 @@ class Stressng(CommandLineLoad): + self.__out = None + self.__err = None + self.__nullfp = None +- self.cmd = None ++ self.args = None + " Only run this module if the user specifies an option " + if self.cfg.option is not None: + self._donotrun = False +@@ -47,12 +47,12 @@ class Stressng(CommandLineLoad): + self.__out = self.__err = self.__nullfp + + # stress-ng is only run if the user specifies an option +- self.cmd = ['stress-ng'] +- self.cmd.append('--%s' % str(self.cfg.option)) ++ self.args = ['stress-ng'] ++ self.args.append('--%s' % str(self.cfg.option)) + if self.cfg.arg is not None: +- self.cmd.append(self.cfg.arg) ++ self.args.append(self.cfg.arg) + if self.cfg.timeout is not None: +- self.cmd.append('--timeout %s' % str(self.cfg.timeout)) ++ self.args.append('--timeout %s' % str(self.cfg.timeout)) + + systop = SysTopology() + # get the number of nodes +@@ -74,7 +74,7 @@ class Stressng(CommandLineLoad): + if self.cpulist: + for node in nodes: + cpulist = ",".join([str(n) for n in cpus[node]]) +- self.cmd.append('--taskset %s' % cpulist) ++ self.args.append('--taskset %s' % cpulist) + + def _WorkloadTask(self): + """ Kick of the workload here """ +@@ -82,13 +82,14 @@ class Stressng(CommandLineLoad): + # Only start the task once + return + +- self._log(Log.DEBUG, "starting with %s" % " ".join(self.cmd)) ++ self._log(Log.DEBUG, "starting with %s" % " ".join(self.args)) + try: +- self.process = subprocess.Popen(self.cmd, ++ self.process = subprocess.Popen(self.args, + stdout=self.__out, + stderr=self.__err, + stdin=self.__in) + self.started = True ++ self.jobs = 1 + self._log(Log.DEBUG, "running") + except OSError: + self._log(Log.DEBUG, "Failed to run") +-- +2.21.3 + diff --git a/SOURCES/rteval-Some-style-changes-to-rteval-modules-measurem.patch b/SOURCES/rteval-Some-style-changes-to-rteval-modules-measurem.patch new file mode 100644 index 0000000..f5c2b55 --- /dev/null +++ b/SOURCES/rteval-Some-style-changes-to-rteval-modules-measurem.patch @@ -0,0 +1,57 @@ +From c6aac7eac1625c537f2517af3d3baf0ad5b8a2c4 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 6 May 2020 03:56:10 -0400 +Subject: [PATCH 12/17] rteval: Some style changes to + rteval/modules/measurement/__init__.py + +rteval: Some style changes to rteval/modules/measurement/__init__.py + +Signed-off-by: John Kacur +--- + rteval/modules/measurement/__init__.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/rteval/modules/measurement/__init__.py b/rteval/modules/measurement/__init__.py +index 5a179949ad36..318248bd7e35 100644 +--- a/rteval/modules/measurement/__init__.py ++++ b/rteval/modules/measurement/__init__.py +@@ -89,7 +89,7 @@ class MeasurementProfile(RtEvalModules): + if self.__run_parallel: + return self._isAlive() + +- if len(self.__serialised_mods) > 0: ++ if self.__serialised_mods: + # If running serialised, first check if measurement is still running, + # if so - return True. + mod = self.GetNamedModuleObject(self.__serialised_mods[0]) +@@ -98,7 +98,7 @@ class MeasurementProfile(RtEvalModules): + + # If not, go to next on the list and kick it off + self.__serialised_mods.remove(self.__serialised_mods[0]) +- if len(self.__serialised_mods) > 0: ++ if self.__serialised_mods: + mod = self.GetNamedModuleObject(self.__serialised_mods[0]) + mod.setStart() + return True +@@ -107,7 +107,7 @@ class MeasurementProfile(RtEvalModules): + return False + + +-class MeasurementModules(object): ++class MeasurementModules: + """Class which takes care of all measurement modules and groups them into + measurement profiles, based on their characteristics""" + +@@ -211,6 +211,6 @@ MeasurementProfile object to be processed""" + if self.__iter_item == 0: + self.__iter_item = None + raise StopIteration +- else: +- self.__iter_item -= 1 +- return self.__measureprofiles[self.__iter_item] ++ ++ self.__iter_item -= 1 ++ return self.__measureprofiles[self.__iter_item] +-- +2.21.3 + diff --git a/SOURCES/rteval-Use-linux-5.7-in-kcompile.patch b/SOURCES/rteval-Use-linux-5.7-in-kcompile.patch new file mode 100644 index 0000000..528bf0c --- /dev/null +++ b/SOURCES/rteval-Use-linux-5.7-in-kcompile.patch @@ -0,0 +1,80 @@ +From a377b5ae936ecf355da348883c4e143860d781ab Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Thu, 23 Jul 2020 15:00:01 -0400 +Subject: [PATCH] rteval: Use linux-5.7 in kcompile + +Use linux-5.7 in kcompile since it has some fixes for code that breaks +newer tools. + +Signed-off-by: John Kacur +--- + Makefile | 2 +- + rteval-loads.spec | 2 +- + rteval/modules/loads/kcompile.py | 4 ++-- + rteval/rteval.conf | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/Makefile b/Makefile +index 479bda8d8674..b11ecec75e42 100644 +--- a/Makefile ++++ b/Makefile +@@ -17,7 +17,7 @@ PREFIX := /usr + DATADIR := $(DESTDIR)/$(PREFIX)/share + LOADDIR := loadsource + +-KLOAD := $(LOADDIR)/linux-5.1.tar.xz ++KLOAD := $(LOADDIR)/linux-5.7.tar.xz + BLOAD := $(LOADDIR)/dbench-4.0.tar.gz + LOADS := $(KLOAD) $(BLOAD) + +diff --git a/rteval-loads.spec b/rteval-loads.spec +index 6b21dc9e6b36..710729914465 100644 +--- a/rteval-loads.spec ++++ b/rteval-loads.spec +@@ -5,7 +5,7 @@ Summary: Source files for rteval loads + Group: Development/Tools + License: GPLv2 + URL: http://git.kernel.org/?p=linux/kernel/git/clrkwllms/rteval.git +-Source0: https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.1.tar.xz ++Source0: https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.7.tar.xz + + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + Requires: gcc binutils make kernel-headers +diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py +index 3973c2af6bce..597f40238cf1 100644 +--- a/rteval/modules/loads/kcompile.py ++++ b/rteval/modules/loads/kcompile.py +@@ -32,7 +32,7 @@ from rteval.Log import Log + from rteval.misc import expand_cpulist, compress_cpulist + from rteval.systopology import SysTopology + +-kernel_prefix = "linux-5.1" ++kernel_prefix = "linux-5.7" + + class KBuildJob: + '''Class to manage a build job bound to a particular node''' +@@ -294,7 +294,7 @@ class Kcompile(CommandLineLoad): + + def ModuleParameters(): + return {"source": {"descr": "Source tar ball", +- "default": "linux-5.1.tar.xz", ++ "default": "linux-5.7.tar.xz", + "metavar": "TARBALL"}, + "jobspercore": {"descr": "Number of working threads per core", + "default": 2, +diff --git a/rteval/rteval.conf b/rteval/rteval.conf +index db0b8ef005b6..6065d2e909f6 100644 +--- a/rteval/rteval.conf ++++ b/rteval/rteval.conf +@@ -18,7 +18,7 @@ dbench: external + stressng: module + + [kcompile] +-source: linux-5.1.xz ++source: linux-5.7.xz + jobspercore: 2 + + [hackbench] +-- +2.26.2 + diff --git a/SOURCES/rteval-cyclictest.py-Some-style-changes-suggested-by.patch b/SOURCES/rteval-cyclictest.py-Some-style-changes-suggested-by.patch new file mode 100644 index 0000000..a4787d9 --- /dev/null +++ b/SOURCES/rteval-cyclictest.py-Some-style-changes-suggested-by.patch @@ -0,0 +1,100 @@ +From 421870656f299a63734855286a4c6ea703dac960 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 6 May 2020 04:12:25 -0400 +Subject: [PATCH 13/17] rteval: cyclictest.py: Some style changes suggested by + pylint-3 + +Some style changes suggested by pylint-3 + +Signed-off-by: John Kacur +--- + rteval/modules/measurement/cyclictest.py | 27 ++++++++++++++---------- + 1 file changed, 16 insertions(+), 11 deletions(-) + +diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py +index 6584ea2bb5b8..dad144633cf5 100644 +--- a/rteval/modules/measurement/cyclictest.py ++++ b/rteval/modules/measurement/cyclictest.py +@@ -25,12 +25,17 @@ + # are deemed to be part of the source code. + # + +-import os, sys, subprocess, signal, libxml2, shutil, tempfile, time ++import os ++import subprocess ++import signal ++import time ++import tempfile ++import libxml2 + from rteval.Log import Log + from rteval.modules import rtevalModulePrototype + from rteval.misc import expand_cpulist, online_cpus, cpuinfo + +-class RunData(object): ++class RunData: + '''class to keep instance data from a cyclictest run''' + def __init__(self, coreid, datatype, priority, logfnc): + self.__id = coreid +@@ -51,7 +56,7 @@ class RunData(object): + self._log = logfnc + + def __str__(self): +- retval = "id: %s\n" % self.__id ++ retval = "id: %s\n" % self.__id + retval += "type: %s\n" % self.__type + retval += "numsamples: %d\n" % self.__numsamples + retval += "min: %d\n" % self.__min +@@ -207,7 +212,7 @@ class Cyclictest(rtevalModulePrototype): + + # create a RunData object for each core we'll measure + for core in self.__cpus: +- self.__cyclicdata[core] = RunData(core, 'core',self.__priority, ++ self.__cyclicdata[core] = RunData(core, 'core', self.__priority, + logfnc=self._log) + self.__cyclicdata[core].description = info[core]['model name'] + +@@ -294,9 +299,9 @@ class Cyclictest(rtevalModulePrototype): + self.__cyclicoutput.seek(0) + try: + self.__cyclicprocess = subprocess.Popen(self.__cmd, +- stdout=self.__cyclicoutput, +- stderr=self.__nullfp, +- stdin=self.__nullfp) ++ stdout=self.__cyclicoutput, ++ stderr=self.__nullfp, ++ stdin=self.__nullfp) + self.__started = True + except OSError: + self.__started = False +@@ -328,11 +333,11 @@ class Cyclictest(rtevalModulePrototype): + continue + + # Skipping blank lines +- if len(line) == 0: ++ if not line: + continue + + vals = line.split() +- if len(vals) == 0: ++ if not vals: + # If we don't have any values, don't try parsing + continue + +@@ -342,7 +347,7 @@ class Cyclictest(rtevalModulePrototype): + self._log(Log.DEBUG, "cyclictest: unexpected output: %s" % line) + continue + +- for i,core in enumerate(self.__cpus): ++ for i, core in enumerate(self.__cpus): + self.__cyclicdata[core].bucket(index, int(vals[i+1])) + self.__cyclicdata['system'].bucket(index, int(vals[i+1])) + +@@ -444,4 +449,4 @@ if __name__ == '__main__': + + xml = libxml2.newDoc('1.0') + xml.setRootElement(rep_n) +- xml.saveFormatFileEnc('-','UTF-8',1) ++ xml.saveFormatFileEnc('-', 'UTF-8', 1) +-- +2.21.3 + diff --git a/SOURCES/rteval-hackbench.py-Some-Style-changes-suggested-by-.patch b/SOURCES/rteval-hackbench.py-Some-Style-changes-suggested-by-.patch new file mode 100644 index 0000000..ce94984 --- /dev/null +++ b/SOURCES/rteval-hackbench.py-Some-Style-changes-suggested-by-.patch @@ -0,0 +1,70 @@ +From e3bbc253a8b07b777ace70bd7f605188f43e1d88 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 6 May 2020 03:25:56 -0400 +Subject: [PATCH 09/17] rteval: hackbench.py: Some Style changes suggested by + pylint-3 + +Some Style changes suggested by pylint-3 + +Signed-off-by: John Kacur +--- + rteval/modules/loads/hackbench.py | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py +index d951d1a0b930..0ea231e4d36b 100644 +--- a/rteval/modules/loads/hackbench.py ++++ b/rteval/modules/loads/hackbench.py +@@ -65,7 +65,7 @@ class Hackbench(CommandLineLoad): + self.cpus[n] = sysTop.getcpus(int(n)) + # if a cpulist was specified, only allow cpus in that list on the node + if self.cpulist: +- self.cpus[n] = [ c for c in self.cpus[n] if str(c) in expand_cpulist(self.cpulist) ] ++ self.cpus[n] = [c for c in self.cpus[n] if str(c) in expand_cpulist(self.cpulist)] + + # track largest number of cpus used on a node + node_biggest = len(sysTop.getcpus(int(n))) +@@ -73,7 +73,7 @@ class Hackbench(CommandLineLoad): + biggest = node_biggest + + # remove nodes with no cpus available for running +- for node,cpus in list(self.cpus.items()): ++ for node, cpus in list(self.cpus.items()): + if not cpus: + self.nodes.remove(node) + self._log(Log.DEBUG, "node %s has no available cpus, removing" % node) +@@ -91,7 +91,7 @@ class Hackbench(CommandLineLoad): + self.__usenumactl = True + self._log(Log.INFO, "using numactl for thread affinity") + +- self.args = ['hackbench', '-P', ++ self.args = ['hackbench', '-P', + '-g', str(self.jobs), + '-l', str(self._cfg.setdefault('loops', '1000')), + '-s', str(self._cfg.setdefault('datasize', '1000')) +@@ -120,10 +120,10 @@ class Hackbench(CommandLineLoad): + def __starton(self, node): + if self.__multinodes or self.cpulist: + if self.__usenumactl: +- args = [ 'numactl', '--cpunodebind', str(node) ] + self.args ++ args = ['numactl', '--cpunodebind', str(node)] + self.args + else: +- cpulist = ",".join([ str(n) for n in self.cpus[node] ]) +- args = ['taskset', '-c', cpulist ] + self.args ++ cpulist = ",".join([str(n) for n in self.cpus[node]]) ++ args = ['taskset', '-c', cpulist] + self.args + else: + args = self.args + +@@ -175,7 +175,7 @@ class Hackbench(CommandLineLoad): + if node in self.tasks and self.tasks[node].poll() is None: + self._log(Log.INFO, "cleaning up hackbench on node %s" % node) + self.tasks[node].send_signal(SIGKILL) +- if self.tasks[node].poll() == None: ++ if self.tasks[node].poll() is None: + time.sleep(2) + self.tasks[node].wait() + del self.tasks[node] +-- +2.21.3 + diff --git a/SOURCES/rteval-kcompile.py-Some-style-changes-suggested-by-p.patch b/SOURCES/rteval-kcompile.py-Some-style-changes-suggested-by-p.patch new file mode 100644 index 0000000..462b383 --- /dev/null +++ b/SOURCES/rteval-kcompile.py-Some-style-changes-suggested-by-p.patch @@ -0,0 +1,133 @@ +From 42d772847f47068b0ad5b4cea0b8a90b7627ae79 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 6 May 2020 03:40:03 -0400 +Subject: [PATCH 10/17] rteval: kcompile.py: Some style changes suggested by + pylint-3 + +Some style changes suggested by pylint-3 + +Signed-off-by: John Kacur +--- + rteval/modules/loads/kcompile.py | 38 ++++++++++++++++---------------- + 1 file changed, 19 insertions(+), 19 deletions(-) + +diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py +index bba6d7be75e9..3973c2af6bce 100644 +--- a/rteval/modules/loads/kcompile.py ++++ b/rteval/modules/loads/kcompile.py +@@ -29,12 +29,12 @@ from signal import SIGTERM + from rteval.modules import rtevalRuntimeError + from rteval.modules.loads import CommandLineLoad + from rteval.Log import Log +-from rteval.misc import expand_cpulist,compress_cpulist ++from rteval.misc import expand_cpulist, compress_cpulist + from rteval.systopology import SysTopology + +-kernel_prefix="linux-5.1" ++kernel_prefix = "linux-5.1" + +-class KBuildJob(object): ++class KBuildJob: + '''Class to manage a build job bound to a particular node''' + + def __init__(self, node, kdir, logger=None, cpulist=None): +@@ -93,9 +93,9 @@ class KBuildJob(object): + stdin=sin, stdout=sout, stderr=serr) + + def isrunning(self): +- if self.jobid == None: ++ if self.jobid is None: + return False +- return (self.jobid.poll() == None) ++ return self.jobid.poll() is None + + def stop(self): + if not self.jobid: +@@ -113,7 +113,7 @@ class Kcompile(CommandLineLoad): + self.logger = logger + + def _extract_tarball(self): +- if self.source == None: ++ if self.source is None: + raise rtevalRuntimeError(self, " no source tarball specified!") + self._log(Log.DEBUG, "unpacking kernel tarball") + tarargs = ['tar', '-C', self.builddir, '-x'] +@@ -134,8 +134,8 @@ class Kcompile(CommandLineLoad): + return + self._log(Log.DEBUG, "removing kcompile directories in %s" % self.builddir) + null = os.open("/dev/null", os.O_RDWR) +- cmd=["rm", "-rf", os.path.join(self.builddir, "kernel*"), os.path.join(self.builddir, "node*")] +- ret = subprocess.call(cmd,stdin=null, stdout=null, stderr=null) ++ cmd = ["rm", "-rf", os.path.join(self.builddir, "kernel*"), os.path.join(self.builddir, "node*")] ++ ret = subprocess.call(cmd, stdin=null, stdout=null, stderr=null) + if ret: + raise rtevalRuntimeError(self, "error removing builddir (%s) (ret=%d)" % (self.builddir, ret)) + +@@ -154,21 +154,21 @@ class Kcompile(CommandLineLoad): + raise rtevalRuntimeError(self, " no kernel tarballs found in %s" % self.srcdir) + + # check for existing directory +- kdir=None +- names=os.listdir(self.builddir) ++ kdir = None ++ names = os.listdir(self.builddir) + for d in names: + if d.startswith(kernel_prefix): +- kdir=d ++ kdir = d + break +- if kdir == None: ++ if kdir is None: + self._extract_tarball() + names = os.listdir(self.builddir) + for d in names: + self._log(Log.DEBUG, "checking %s" % d) + if d.startswith(kernel_prefix): +- kdir=d ++ kdir = d + break +- if kdir == None: ++ if kdir is None: + raise rtevalRuntimeError(self, "Can't find kernel directory!") + self.mydir = os.path.join(self.builddir, kdir) + self._log(Log.DEBUG, "mydir = %s" % self.mydir) +@@ -180,15 +180,15 @@ 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] = [int(c.split('/')[-1][3:]) for c in glob.glob('/sys/devices/system/node/node%s/cpu[0-9]*' % n)] + self.cpus[n].sort() + + # if a cpulist was specified, only allow cpus in that list on the node + if self.cpulist: +- self.cpus[n] = [ c for c in self.cpus[n] if str(c) in expand_cpulist(self.cpulist) ] ++ self.cpus[n] = [c for c in self.cpus[n] if str(c) in expand_cpulist(self.cpulist)] + + # remove nodes with no cpus available for running +- for node,cpus in self.cpus.items(): ++ for node, cpus in self.cpus.items(): + if not cpus: + self.nodes.remove(node) + self._log(Log.DEBUG, "node %s has no available cpus, removing" % node) +@@ -229,7 +229,7 @@ class Kcompile(CommandLineLoad): + os.close(err) + # clean up object dirs and make sure each has a config file + for n in self.nodes: +- self.buildjobs[n].clean(sin=null,sout=null,serr=null) ++ self.buildjobs[n].clean(sin=null, sout=null, serr=null) + os.close(null) + self._setReady() + +@@ -277,7 +277,7 @@ class Kcompile(CommandLineLoad): + def _WorkloadCleanup(self): + self._log(Log.DEBUG, "out of stopevent loop") + for n in self.buildjobs: +- if self.buildjobs[n].jobid.poll() == None: ++ if self.buildjobs[n].jobid.poll() is None: + self._log(Log.DEBUG, "stopping job on node %d" % int(n)) + self.buildjobs[n].jobid.terminate() + self.buildjobs[n].jobid.wait() +-- +2.21.3 + diff --git a/SOURCES/rteval-modules-__init__.py-Some-style-changes-sugges.patch b/SOURCES/rteval-modules-__init__.py-Some-style-changes-sugges.patch new file mode 100644 index 0000000..1da4263 --- /dev/null +++ b/SOURCES/rteval-modules-__init__.py-Some-style-changes-sugges.patch @@ -0,0 +1,117 @@ +From 6292c4793a60280b959ec0a51df994728d653e0a Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 6 May 2020 03:11:10 -0400 +Subject: [PATCH 08/17] rteval: modules/__init__.py: Some style changes + suggested by pylint-3 + +Some style changes suggested by pylint-3 + +Signed-off-by: John Kacur +--- + rteval/modules/__init__.py | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) + +diff --git a/rteval/modules/__init__.py b/rteval/modules/__init__.py +index 5ae7cd488406..eff74da5a885 100644 +--- a/rteval/modules/__init__.py ++++ b/rteval/modules/__init__.py +@@ -22,10 +22,13 @@ + # are deemed to be part of the source code. + # + ++import time ++from datetime import datetime ++import threading ++import optparse ++import libxml2 + from rteval.Log import Log + from rteval.rtevalConfig import rtevalCfgSection +-from datetime import datetime +-import time, libxml2, threading, optparse + + __all__ = ["rtevalRuntimeError", "rtevalModulePrototype", "ModuleContainer", "RtEvalModules"] + +@@ -115,7 +118,7 @@ class rtevalModulePrototype(threading.Thread): + self.__timestamps["finished_set"] = datetime.now() + + +- def WaitForCompletion(self, wtime = None): ++ def WaitForCompletion(self, wtime=None): + "Blocks until the module has completed its workload" + if not self.shouldStart(): + # If it hasn't been started yet, nothing to wait for +@@ -215,7 +218,7 @@ class rtevalModulePrototype(threading.Thread): + + + +-class ModuleContainer(object): ++class ModuleContainer: + """The ModuleContainer keeps an overview over loaded modules and the objects it + will instantiate. These objects are accessed by iterating the ModuleContainer object.""" + +@@ -256,7 +259,7 @@ reference from the first import""" + return mod + + +- def ModuleInfo(self, modname, modroot = None): ++ def ModuleInfo(self, modname, modroot=None): + """Imports a module and calls the modules' ModuleInfo() function and returns + the information provided by the module""" + +@@ -288,7 +291,7 @@ the information provided by the module""" + + grparser = optparse.OptionGroup(parser, "Options for the %s module" % shortmod) + for (o, s) in list(opts.items()): +- descr = 'descr' in s and s['descr'] or "" ++ descr = 'descr' in s and s['descr'] or "" + metavar = 'metavar' in s and s['metavar'] or None + + try: +@@ -311,7 +314,7 @@ the information provided by the module""" + parser.add_option_group(grparser) + + +- def InstantiateModule(self, modname, modcfg, modroot = None): ++ def InstantiateModule(self, modname, modcfg, modroot=None): + """Imports a module and instantiates an object from the modules create() function. + The instantiated object is returned in this call""" + +@@ -328,7 +331,7 @@ returned when a ModuleContainer object is iterated over""" + self.__modobjects[modname] = modobj + + +- def ExportModule(self, modname, modroot = None): ++ def ExportModule(self, modname, modroot=None): + "Export module info, used to transfer an imported module to another ModuleContainer" + if modroot is None: + modroot = self.__modules_root +@@ -378,7 +381,7 @@ module name and object to be processed""" + + + +-class RtEvalModules(object): ++class RtEvalModules: + """RtEvalModules should normally be inherrited by a more specific module class. + This class takes care of managing imported modules and have methods for starting + and stopping the workload these modules contains.""" +@@ -402,7 +405,7 @@ and will also be given to the instantiated objects during module import.""" + "Imports a module exported by ModuleContainer::ExportModule()" + return self.__modules.ImportModule(module) + +- def _InstantiateModule(self, modname, modcfg, modroot = None): ++ def _InstantiateModule(self, modname, modcfg, modroot=None): + "Imports a module and returns an instantiated object from the module" + return self.__modules.InstantiateModule(modname, modcfg, modroot) + +@@ -513,7 +516,7 @@ start their workloads yet""" + self.__timestamps['stop'] = datetime.now() + + +- def WaitForCompletion(self, wtime = None): ++ def WaitForCompletion(self, wtime=None): + """Waits for the running modules to complete their running""" + + self._logger.log(Log.INFO, "Waiting for %s modules to complete" % self._module_type) +-- +2.21.3 + diff --git a/SOURCES/rteval-rteval-Log.py-Some-style-changes-suggested-fr.patch b/SOURCES/rteval-rteval-Log.py-Some-style-changes-suggested-fr.patch new file mode 100644 index 0000000..4b17d1e --- /dev/null +++ b/SOURCES/rteval-rteval-Log.py-Some-style-changes-suggested-fr.patch @@ -0,0 +1,45 @@ +From 3059c4a512d3a3f4fb9f1dc29a9210cc018f88d2 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 6 May 2020 01:37:09 -0400 +Subject: [PATCH 05/17] rteval: rteval/Log.py: Some style changes suggested + from pylint-3 + +Some style changes suggested from pylint-3 + +Signed-off-by: John Kacur +--- + rteval/Log.py | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/rteval/Log.py b/rteval/Log.py +index 66aa77a59431..63ca3b8681f8 100644 +--- a/rteval/Log.py ++++ b/rteval/Log.py +@@ -24,13 +24,13 @@ + + import sys + +-class Log(object): +- NONE = 0 ++class Log: ++ NONE = 0 + ALWAYS = 0 +- INFO = 1<<0 +- WARN = 1<<1 +- ERR = 1<<2 +- DEBUG = 1<<3 ++ INFO = 1<<0 ++ WARN = 1<<1 ++ ERR = 1<<2 ++ DEBUG = 1<<3 + + + def __init__(self, logfile=None): +@@ -106,4 +106,3 @@ def unit_test(rootdir): + + if __name__ == '__main__': + unit_test(None) +- +-- +2.21.3 + diff --git a/SOURCES/rteval-rteval-__init__.py-A-few-style-changes-sugges.patch b/SOURCES/rteval-rteval-__init__.py-A-few-style-changes-sugges.patch new file mode 100644 index 0000000..d14b819 --- /dev/null +++ b/SOURCES/rteval-rteval-__init__.py-A-few-style-changes-sugges.patch @@ -0,0 +1,38 @@ +From 9430749d66a5e55bf51ccdf3bb5b8a3292508161 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 6 May 2020 02:56:46 -0400 +Subject: [PATCH 07/17] rteval: rteval/__init__.py: A few style changes + suggested by pylint-3 + +A few style changes suggested by pylint-3 + +Signed-off-by: John Kacur +--- + rteval/__init__.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/rteval/__init__.py b/rteval/__init__.py +index 5d8e5131051e..a4fd7422cbe1 100644 +--- a/rteval/__init__.py ++++ b/rteval/__init__.py +@@ -125,7 +125,7 @@ class RtEval(rtevalReport): + print("rteval time remaining: %d days, %d hours, %d minutes, %d seconds" % (days, hours, minutes, r)) + + +- def Prepare(self, onlyload = False): ++ def Prepare(self, onlyload=False): + builddir = os.path.join(self.__rtevcfg.workdir, 'rteval-build') + if not os.path.isdir(builddir): os.mkdir(builddir) + +@@ -165,7 +165,7 @@ class RtEval(rtevalReport): + measure_start = None + (with_loads, run_parallel) = measure_profile.GetProfile() + self.__logger.log(Log.INFO, "Using measurement profile [loads: %s parallel: %s]" % ( +- with_loads, run_parallel)) ++ with_loads, run_parallel)) + try: + nthreads = 0 + +-- +2.21.3 + diff --git a/SOURCES/rteval-rteval-cmd-Some-style-changes-suggested-by-py.patch b/SOURCES/rteval-rteval-cmd-Some-style-changes-suggested-by-py.patch new file mode 100644 index 0000000..ef7ae09 --- /dev/null +++ b/SOURCES/rteval-rteval-cmd-Some-style-changes-suggested-by-py.patch @@ -0,0 +1,87 @@ +From 761741d15d08e6ea420b55c9b26b203edc5e9531 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Tue, 5 May 2020 17:02:11 -0400 +Subject: [PATCH 04/17] rteval: rteval-cmd: Some style changes suggested by + pylint-3 + +Some style changes suggested by pylint-3 + +Signed-off-by: John Kacur +--- + rteval-cmd | 27 +++++++++++++-------------- + 1 file changed, 13 insertions(+), 14 deletions(-) + +diff --git a/rteval-cmd b/rteval-cmd +index dff972f663cf..7d0d00516bd3 100755 +--- a/rteval-cmd ++++ b/rteval-cmd +@@ -59,7 +59,7 @@ def summarize(repfile, xslt): + if f.find('summary.xml') != -1: + element = f + break +- if element == None: ++ if element is None: + print("No summary.xml found in tar archive %s" % repfile) + return + tmp = tempfile.gettempdir() +@@ -160,10 +160,10 @@ def parse_options(cfg, parser, cmdargs): + if not cmdargs: + cmdargs = ["--help"] + +- (cmd_opts, cmd_args) = parser.parse_args(args = cmdargs) ++ (cmd_opts, cmd_args) = parser.parse_args(args=cmdargs) + if cmd_opts.rteval___version: + print(("rteval version %s" % RTEVAL_VERSION)) +- sys.exit(0); ++ sys.exit(0) + + if cmd_opts.rteval___duration: + mult = 1.0 +@@ -217,15 +217,14 @@ if __name__ == '__main__': + except ValueError: + # No configuration file given, load defaults + config.Load() +- pass + + if not config.HasSection('loads'): +- config.AppendConfig('loads',{ +- 'kcompile' : 'module', +- 'hackbench' : 'module' }) ++ config.AppendConfig('loads', { ++ 'kcompile' : 'module', ++ 'hackbench' : 'module'}) + +- if not config.HasSection('measurement'): +- config.AppendConfig('measurement', { ++ if not config.HasSection('measurement'): ++ config.AppendConfig('measurement', { + 'cyclictest' : 'module', + 'sysstat' : 'module'}) + +@@ -289,10 +288,10 @@ if __name__ == '__main__': + logging: %s + duration: %f + sysreport: %s''' % ( +- rtevcfg.workdir, rtevcfg.srcdir, +- rtevcfg.reportdir, rtevcfg.verbose, +- rtevcfg.debugging, rtevcfg.logging, +- rtevcfg.duration, rtevcfg.sysreport)) ++ rtevcfg.workdir, rtevcfg.srcdir, ++ rtevcfg.reportdir, rtevcfg.verbose, ++ rtevcfg.debugging, rtevcfg.logging, ++ rtevcfg.duration, rtevcfg.sysreport)) + + if not os.path.isdir(rtevcfg.workdir): + raise RuntimeError("work directory %s does not exist" % rtevcfg.workdir) +@@ -307,7 +306,7 @@ if __name__ == '__main__': + loadmods.Start() + nthreads = loadmods.Unleash() + logger.log(Log.INFO, "Started %i load threads - will run for %f seconds" % ( +- nthreads, rtevcfg.duration)) ++ nthreads, rtevcfg.duration)) + logger.log(Log.INFO, "No measurements will be performed, due to the --onlyload option") + time.sleep(rtevcfg.duration) + loadmods.Stop() +-- +2.21.3 + diff --git a/SOURCES/rteval-rtevalConfig.py-Some-style-changes-suggested-.patch b/SOURCES/rteval-rtevalConfig.py-Some-style-changes-suggested-.patch new file mode 100644 index 0000000..037f4bc --- /dev/null +++ b/SOURCES/rteval-rtevalConfig.py-Some-style-changes-suggested-.patch @@ -0,0 +1,117 @@ +From 415855a8cdafec5b0ec7b97578b9ee1e36878b3e Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Thu, 7 May 2020 04:23:34 -0400 +Subject: [PATCH 14/17] rteval/rtevalConfig.py: Some style changes suggested by + pylint-3 + +Some style changes suggested by pylint-3 + +Signed-off-by: John Kacur +--- + rteval/rtevalConfig.py | 25 +++++++++++++------------ + 1 file changed, 13 insertions(+), 12 deletions(-) + +diff --git a/rteval/rtevalConfig.py b/rteval/rtevalConfig.py +index 36f1354b6a4f..646f33b1b663 100644 +--- a/rteval/rtevalConfig.py ++++ b/rteval/rtevalConfig.py +@@ -30,7 +30,8 @@ + # including keys needed to generate an equivalently functional executable + # are deemed to be part of the source code. + # +-import os, sys ++import os ++import sys + import configparser + from .Log import Log + from .systopology import SysTopology +@@ -47,7 +48,7 @@ def get_user_name(): + return name + + def default_config_search(relative_path, verifdef=os.path.isdir): +- ConfigDirectories=[ ++ ConfigDirectories = [ + os.path.join(os.path.expanduser("~" + get_user_name()), '.rteval'), + '/etc/rteval', + '/usr/share/rteval' +@@ -67,7 +68,7 @@ def default_config_search(relative_path, verifdef=os.path.isdir): + + + # HACK: A temporary hack to try to figure out where the install dir is. +-typical_install_paths = ('/usr/bin','/usr/local/bin') ++typical_install_paths = ('/usr/bin', '/usr/local/bin') + try: + if typical_install_paths.index(os.path.dirname(os.path.abspath(sys.argv[0]))): + installdir = os.path.dirname(os.path.abspath(sys.argv[0])) +@@ -98,9 +99,9 @@ default_config = { + } + + +-class rtevalCfgSection(object): ++class rtevalCfgSection: + def __init__(self, section_cfg): +- if type(section_cfg) is not dict: ++ if not isinstance(section_cfg, dict): + raise TypeError('section_cfg argument is not a dict variable') + + self.__dict__['_rtevalCfgSection__cfgdata'] = section_cfg +@@ -109,9 +110,9 @@ class rtevalCfgSection(object): + + def __str__(self): + "Simple method for dumping config when object is used as a string" +- if len(self.__cfgdata) == 0: ++ if not self.__cfgdata: + return "# empty" +- return "\n".join(["%s: %s" % (k,v) for k,v in list(self.__cfgdata.items())]) + "\n" ++ return "\n".join(["%s: %s" % (k, v) for k, v in list(self.__cfgdata.items())]) + "\n" + + + def __setattr__(self, key, val): +@@ -168,7 +169,7 @@ class rtevalCfgSection(object): + + + def update(self, newdict): +- if type(newdict) is not dict: ++ if not isinstance(newdict, dict): + raise TypeError('update() method expects a dict as argument') + + for key, val in newdict.items(): +@@ -183,7 +184,7 @@ class rtevalCfgSection(object): + class rtevalConfig(object): + "Config parser for rteval" + +- def __init__(self, initvars = None, logger = None): ++ def __init__(self, initvars=None, logger=None): + self.__config_data = {} + self.__config_files = [] + self.__logger = logger +@@ -239,7 +240,7 @@ class rtevalConfig(object): + raise RuntimeError("Unable to find configfile") + + +- def Load(self, fname = None, append = False): ++ def Load(self, fname=None, append=False): + "read and parse the configfile" + + try: +@@ -265,7 +266,7 @@ class rtevalConfig(object): + # copy the section data into the __config_data dictionary + for s in ini.sections(): + cfg = {} +- for (k,v) in ini.items(s): ++ for (k, v) in ini.items(s): + cfg[k] = v.split('#')[0].strip() + + self.__update_section(s, cfg) +@@ -285,7 +286,7 @@ class rtevalConfig(object): + "Parse through the command line options and update the appropriate config settings" + + last_sect = None +- for sk,v in sorted(vars(parser.values).items()): ++ for sk, v in sorted(vars(parser.values).items()): + # optparse key template: {sectionname}___{key} + k = sk.split('___') + if k[0] != last_sect: +-- +2.21.3 + diff --git a/SOURCES/rteval-rtevalReport.py-Fix-non-existant-variable.patch b/SOURCES/rteval-rtevalReport.py-Fix-non-existant-variable.patch new file mode 100644 index 0000000..0378ba4 --- /dev/null +++ b/SOURCES/rteval-rtevalReport.py-Fix-non-existant-variable.patch @@ -0,0 +1,28 @@ +From 4bd385fb5f23e3f507b3dbbc51677b57abb40e7a Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Thu, 7 May 2020 04:51:25 -0400 +Subject: [PATCH 16/17] rteval/rtevalReport.py: Fix non-existant variable + +Fix non-existant variable + +Signed-off-by: John Kacur +--- + rteval/rtevalReport.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rteval/rtevalReport.py b/rteval/rtevalReport.py +index 062cc5efb86f..e02fc9858e69 100644 +--- a/rteval/rtevalReport.py ++++ b/rteval/rtevalReport.py +@@ -130,7 +130,7 @@ class rtevalReport: + + def _tar_results(self): + if not os.path.isdir(self.__reportdir): +- raise RuntimeError("no such directory: %s" % reportdir) ++ raise RuntimeError("no such directory: %s" % self.__reportdir) + + dirname = os.path.dirname(self.__reportdir) + rptdir = os.path.basename(self.__reportdir) +-- +2.21.3 + diff --git a/SOURCES/rteval-rtevalReport.py-Some-style-changes-suggested-.patch b/SOURCES/rteval-rtevalReport.py-Some-style-changes-suggested-.patch new file mode 100644 index 0000000..f0b81df --- /dev/null +++ b/SOURCES/rteval-rtevalReport.py-Some-style-changes-suggested-.patch @@ -0,0 +1,51 @@ +From dab38d731ca8bf69ef41985ff5cc480d64659368 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Thu, 7 May 2020 04:40:33 -0400 +Subject: [PATCH 15/17] rteval/rtevalReport.py: Some style changes suggested by + pylint-3 + + Some style changes suggested by pylint-3 + +Signed-off-by: John Kacur +--- + rteval/rtevalReport.py | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/rteval/rtevalReport.py b/rteval/rtevalReport.py +index a18dd41b36fc..062cc5efb86f 100644 +--- a/rteval/rtevalReport.py ++++ b/rteval/rtevalReport.py +@@ -29,7 +29,7 @@ from datetime import datetime + from . import xmlout + + +-class rtevalReport(object): ++class rtevalReport: + def __init__(self, rtev_version, installdir, annotate): + self.__version = rtev_version + self.__installdir = installdir +@@ -48,10 +48,14 @@ class rtevalReport(object): + + duration = datetime.now() - measure_start + seconds = duration.seconds ++ + hours = int(seconds / 3600) +- if hours: seconds -= (hours * 3600) ++ if hours: ++ seconds -= (hours * 3600) ++ + minutes = int(seconds / 60) +- if minutes: seconds -= (minutes * 60) ++ if minutes: ++ seconds -= (minutes * 60) + + # Start new XML report + self.__xmlreport = xmlout.XMLOut('rteval', self.__version) +@@ -138,4 +142,3 @@ class rtevalReport(object): + t.close() + except: + os.chdir(cwd) +- +-- +2.21.3 + diff --git a/SOURCES/rteval-sysstat-Some-style-changes-suggested-by-pylin.patch b/SOURCES/rteval-sysstat-Some-style-changes-suggested-by-pylin.patch new file mode 100644 index 0000000..0d1be8f --- /dev/null +++ b/SOURCES/rteval-sysstat-Some-style-changes-suggested-by-pylin.patch @@ -0,0 +1,55 @@ +From 0e483c0882b58a1d605e104aa8c1d6c361243116 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 6 May 2020 03:47:06 -0400 +Subject: [PATCH 11/17] rteval: sysstat: Some style changes suggested by + pylint-3 + +Some style changes suggested by pylint-3 + +Signed-off-by: John Kacur +--- + rteval/modules/measurement/sysstat.py | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/rteval/modules/measurement/sysstat.py b/rteval/modules/measurement/sysstat.py +index cbad928326dc..5e68720e25ea 100644 +--- a/rteval/modules/measurement/sysstat.py ++++ b/rteval/modules/measurement/sysstat.py +@@ -33,11 +33,11 @@ from rteval.modules import rtevalModulePrototype + class sysstat(rtevalModulePrototype): + def __init__(self, config, logger=None): + rtevalModulePrototype.__init__(self, 'measurement', 'sysstat', logger) +- self.__cfg = config +- self.__started = False ++ self.__cfg = config ++ self.__started = False + self.__logentry = 0 + self.__bin_sadc = "/usr/lib64/sa/sadc" # FIXME: Do dynamically +- self.__datadir = os.path.join(self.__cfg.reportdir, 'sysstat') ++ self.__datadir = os.path.join(self.__cfg.reportdir, 'sysstat') + self.__datafile = os.path.join(self.__datadir, "sysstat.dat") + + +@@ -93,10 +93,10 @@ class sysstat(rtevalModulePrototype): + compr = bz2.BZ2Compressor(9) + cmpr = compr.compress(fp.read()) + data = base64.b64encode(cmpr + compr.flush()) +- data_n = rep_n.newTextChild(None, 'data', "\n"+"\n".join(textwrap.wrap(data,75))+"\n") ++ data_n = rep_n.newTextChild(None, 'data', "\n"+"\n".join(textwrap.wrap(data, 75))+"\n") + data_n.newProp('contents', 'sysstat/sar binary data') +- data_n.newProp('encoding','base64') +- data_n.newProp('compression','bz2') ++ data_n.newProp('encoding', 'base64') ++ data_n.newProp('compression', 'bz2') + fp.close() + del cmpr + del compr +@@ -154,4 +154,4 @@ if __name__ == '__main__': + + xml = libxml2.newDoc('1.0') + xml.setRootElement(rep_n) +- xml.saveFormatFileEnc('-','UTF-8',1) ++ xml.saveFormatFileEnc('-', 'UTF-8', 1) +-- +2.21.3 + diff --git a/SOURCES/rteval-systopology.py-Some-style-changes-suggested-b.patch b/SOURCES/rteval-systopology.py-Some-style-changes-suggested-b.patch new file mode 100644 index 0000000..821543b --- /dev/null +++ b/SOURCES/rteval-systopology.py-Some-style-changes-suggested-b.patch @@ -0,0 +1,103 @@ +From bf00009c188352d6b6c99273471b285c152313bd Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 6 May 2020 02:47:13 -0400 +Subject: [PATCH 06/17] rteval: systopology.py: Some style changes suggested by + pylint-3 + +Some style changes suggested by pylint-3 + +Signed-off-by: John Kacur +--- + rteval/systopology.py | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/rteval/systopology.py b/rteval/systopology.py +index 7c3878e51be4..8e4daf6c1043 100644 +--- a/rteval/systopology.py ++++ b/rteval/systopology.py +@@ -28,22 +28,22 @@ import os.path + import glob + + def sysread(path, obj): +- fp = open(os.path.join(path,obj), "r") ++ fp = open(os.path.join(path, obj), "r") + return fp.readline().strip() + + # + # class to provide access to a list of cpus + # + +-class CpuList(object): ++class CpuList: + "Object that represents a group of system cpus" + + cpupath = '/sys/devices/system/cpu' + + def __init__(self, cpulist): +- if type(cpulist) is list: ++ if isinstance(cpulist, list): + self.cpulist = cpulist +- elif type(cpulist) is str: ++ elif isinstance(cpulist, str): + self.cpulist = self.__expand_cpulist(cpulist) + self.cpulist = self.online_cpulist(self.cpulist) + self.cpulist.sort() +@@ -66,7 +66,7 @@ class CpuList(object): + # that steps by one + def __longest_sequence(self, cpulist): + lim = len(cpulist) +- for idx,val in enumerate(cpulist): ++ for idx, _ in enumerate(cpulist): + if idx+1 == lim: + break + if int(cpulist[idx+1]) != (int(cpulist[idx])+1): +@@ -107,7 +107,7 @@ class CpuList(object): + else: + a = int(part) + result.append(a) +- return [ int(i) for i in list(set(result)) ] ++ return [int(i) for i in list(set(result))] + + # returns the list of cpus tracked + def getcpulist(self): +@@ -117,7 +117,7 @@ class CpuList(object): + def is_online(self, n): + if n not in self.cpulist: + raise RuntimeError("invalid cpu number %d" % n) +- path = os.path.join(CpuList.cpupath,'cpu%d' % n) ++ path = os.path.join(CpuList.cpupath, 'cpu%d' % n) + # Some hardware doesn't allow cpu0 to be turned off + if not os.path.exists(path + '/online') and n == 0: + return True +@@ -141,7 +141,7 @@ class CpuList(object): + # class to abstract access to NUMA nodes in /sys filesystem + # + +-class NumaNode(object): ++class NumaNode: + "class representing a system NUMA node" + + # constructor argument is the full path to the /sys node file +@@ -172,8 +172,8 @@ class NumaNode(object): + self.meminfo = {} + for l in open(os.path.join(self.path, "meminfo"), "r"): + elements = l.split() +- key=elements[2][0:-1] +- val=int(elements[3]) ++ key = elements[2][0:-1] ++ val = int(elements[3]) + if len(elements) == 5 and elements[4] == "kB": + val *= 1024 + self.meminfo[key] = val +@@ -189,7 +189,7 @@ class NumaNode(object): + # + # Class to abstract the system topology of numa nodes and cpus + # +-class SysTopology(object): ++class SysTopology: + "Object that represents the system's NUMA-node/cpu topology" + + cpupath = '/sys/devices/system/cpu' +-- +2.21.3 + diff --git a/SPECS/rteval.spec b/SPECS/rteval.spec index 28f8e49..932e0f6 100644 --- a/SPECS/rteval.spec +++ b/SPECS/rteval.spec @@ -1,6 +1,6 @@ Name: rteval Version: 3.0 -Release: 6%{?dist} +Release: 13%{?dist} Summary: Utility to evaluate system suitability for RT Linux Group: Development/Tools @@ -14,18 +14,19 @@ Requires: platform-python Requires: python3-schedutils python3-ethtool python3-lxml Requires: python3-dmidecode >= 3.10 Requires: rt-tests >= 1.5-11 -Requires: rteval-loads >= 1.4-5 +Requires: rteval-loads >= 1.4-7 Requires: rteval-common => %{version}-%{release} Requires: sysstat Requires: xz bzip2 -Requires: kernel-headers +Requires: kernel-headers Requires: sos Requires: tar BuildArch: noarch Obsoletes: rteval <= 2.14 Requires: numactl -Requires: gcc flex bison bc +Requires: gcc flex bison bc make Requires: elfutils elfutils-libelf-devel +Requires: openssl Requires: openssl-devel %description @@ -47,6 +48,26 @@ Patch2: rteval-use-systopology-for-hackbench-online-cpus.patch Patch3: rteval-Don-t-assume-cpu0-cannot-be-offlined-test-it.patch Patch4: rteval-node-in-args-to-Popen-must-be-a-string.patch Patch5: rteval-hackbench-Fix-interating-through-nodes.patch +Patch6: Makefile-Remove-non-distutil-install-leftovers.patch +Patch7: Makefile-Use-parentheses-around-print-args.patch +Patch8: modules-Don-t-abort-if-a-workload-isn-t-running.patch +Patch9: rteval-rteval-cmd-Some-style-changes-suggested-by-py.patch +Patch10: rteval-rteval-Log.py-Some-style-changes-suggested-fr.patch +Patch11: rteval-systopology.py-Some-style-changes-suggested-b.patch +Patch12: rteval-rteval-__init__.py-A-few-style-changes-sugges.patch +Patch13: rteval-modules-__init__.py-Some-style-changes-sugges.patch +Patch14: rteval-hackbench.py-Some-Style-changes-suggested-by-.patch +Patch15: rteval-kcompile.py-Some-style-changes-suggested-by-p.patch +Patch16: rteval-sysstat-Some-style-changes-suggested-by-pylin.patch +Patch17: rteval-Some-style-changes-to-rteval-modules-measurem.patch +Patch18: rteval-cyclictest.py-Some-style-changes-suggested-by.patch +Patch19: rteval-rtevalConfig.py-Some-style-changes-suggested-.patch +Patch20: rteval-rtevalReport.py-Some-style-changes-suggested-.patch +Patch21: rteval-rtevalReport.py-Fix-non-existant-variable.patch +Patch22: rteval-Add-the-stressng-load-module.patch +Patch23: rteval-Rename-self.cmd-to-self.args-for-inheritance.patch +Patch24: rteval-Use-linux-5.7-in-kcompile.patch +Patch25: rteval-Parse-cpuinfo-correctly-when-model-name-has-a-colon.patch %description common Common files used by rteval, rteval-xmlrpc and rteval-parser @@ -58,6 +79,26 @@ Common files used by rteval, rteval-xmlrpc and rteval-parser %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 # version sanity check (make sure specfile and rteval.py match) #cp rteval/version.py rtevalversion.py @@ -107,6 +148,34 @@ rm -rf $RPM_BUILD_ROOT %{python3_sitelib}/rteval/__pycache__/* %changelog +* Thu Aug 27 2020 John Kacur - 3.0.13 +- Parse cpuinfo correctly when the model name has a colon in it. +Resolves: rhbz#1873120 + +* Thu Jul 23 2020 John Kacur - 3.0.12 +- Use linux-5.7 in kcompile +Resolves: rhbz#1859762 + +* Thu Jun 25 2020 John Kacur - 3.0.11 +- Make sure "make" is available for the kcompile module +Resolves: rhbz#1850924 + +* Wed Jun 24 2020 John Kacur - 3.0.10 +- Ensure that a recent rteval-loads with stress-ng is required +Resolves: rhbz#1847233 + +* Wed Jun 24 2020 John Kacur - 3.0.9 +- Ensure the stressng command line is displayed in the final report +Resolves: rhbz#1850151 + +* Mon Jun 15 2020 John Kacur - 3.0-8 +- Add the stress-ng load module +Resolves: rhbz#1816360 + +* Mon May 04 2020 John Kacur - 3.0-7 +- Make sure openssl is available so that rteval can compile the kernel +Resolves: rhbz#1831272 + * Tue Dec 10 2019 John Kacur - 3.0-6 - Iterate over nodes and not sysTop - Explictly add a few more software requires for compiling the kernel