import rteval-3.0-6.el8

This commit is contained in:
CentOS Sources 2020-01-21 16:40:39 -05:00 committed by Stepan Oksanichenko
parent 19ab0b5210
commit 2187328364
28 changed files with 383 additions and 2768 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/rteval-2.14.tar.bz2
SOURCES/rteval-3.0.tar.xz

View File

@ -1 +1 @@
d59b224576a8c1106d4cde856158814a6bfe9fb2 SOURCES/rteval-2.14.tar.bz2
ee9134bcf8791823770f3ed764e52d003bd7a597 SOURCES/rteval-3.0.tar.xz

View File

@ -1,30 +0,0 @@
From 7768ab5bc6b1c428de1dd1b3d9a4340bd020a2cd Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Wed, 30 May 2018 13:17:36 +0100
Subject: [PATCH] python: setup.py: Comment out os.unlink
Comment out os.unlink('dist/__init__.pyc')
as a temporary fix
Signed-off-by: John Kacur <jkacur@redhat.com>
---
setup.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 95efa905f4d1..9a76ffbf89be 100644
--- a/setup.py
+++ b/setup.py
@@ -79,7 +79,8 @@ mean, variance and standard deviation) and a report is generated.
os.unlink('dist/rteval')
os.unlink('dist/rteval.8.gz')
os.unlink('dist/__init__.py')
-os.unlink('dist/__init__.pyc')
+# TODO FIX THIS, or at least find out why it was there
+#os.unlink('dist/__init__.pyc')
if distcreated:
try:
--
2.14.3

File diff suppressed because it is too large Load Diff

View File

@ -1,156 +0,0 @@
From 1897019ec6fd7bfd465dd687e58ed355e6e0bead Mon Sep 17 00:00:00 2001
From: root <root@hp-dl380g7-01.lab.bos.redhat.com>
Date: Sat, 23 Jun 2018 12:34:36 -0400
Subject: [PATCH] rteval: Changes for python3 and rt-tests with automated numa
detection
cyclictest no-longer requires --numa, but uses it automatically if detected.
rteval was changed to accomodate this.
In addtion a number of changes were made for python3 compatibility.
Mostly these ahd to do with string and bytes.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/modules/measurement/cyclictest.py | 5 +++--
rteval/sysinfo/kernel.py | 8 +++++---
rteval/sysinfo/network.py | 2 +-
rteval/xmlout.py | 21 +++++++++------------
4 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
index c992c0c..21d313c 100644
--- a/rteval/modules/measurement/cyclictest.py
+++ b/rteval/modules/measurement/cyclictest.py
@@ -228,7 +228,7 @@ class Cyclictest(rtevalModulePrototype):
def __getmode(self):
if self.__numanodes > 1:
self._log(Log.DEBUG, "running in NUMA mode (%d nodes)" % self.__numanodes)
- return '--numa'
+ return ''
self._log(Log.DEBUG, "running in SMP mode")
return '--smp'
@@ -278,7 +278,7 @@ class Cyclictest(rtevalModulePrototype):
self.__cmd.append("--notrace")
# Buffer for cyclictest data written to stdout
- self.__cyclicoutput = tempfile.SpooledTemporaryFile(mode='rw+b')
+ self.__cyclicoutput = tempfile.SpooledTemporaryFile(mode='w+b')
def _WorkloadTask(self):
@@ -327,6 +327,7 @@ class Cyclictest(rtevalModulePrototype):
# now parse the histogram output
self.__cyclicoutput.seek(0)
for line in self.__cyclicoutput:
+ line = bytes.decode(line)
if line.startswith('#'):
# Catch if cyclictest stopped due to a breaktrace
if line.startswith('# Break value: '):
diff --git a/rteval/sysinfo/kernel.py b/rteval/sysinfo/kernel.py
index fd261fe..308846b 100644
--- a/rteval/sysinfo/kernel.py
+++ b/rteval/sysinfo/kernel.py
@@ -50,9 +50,11 @@ class KernelInfo(object):
for p in c.stdout:
v = p.strip().split()
kcmd = v.pop(0)
+ kcmd = bytes.decode(kcmd)
try:
if int(v[0]) > 0 and kcmd.startswith('[') and kcmd.endswith(']'):
- ret_kthreads[v[0]] = {'policy' : policies[v[1]],
+
+ ret_kthreads[v[0]] = {'policy' : policies[bytes.decode(v[1])],
'priority' : v[2], 'name' : v[3] }
except ValueError:
pass # Ignore lines which don't have a number in the first row
@@ -137,9 +139,9 @@ class KernelInfo(object):
for pid in keys:
kthri_n = libxml2.newNode("thread")
kthreads_n.addChild(kthri_n)
- kthri_n.addContent(kthreads[pid]["name"])
+ kthri_n.addContent(bytes.decode(kthreads[pid]["name"]))
kthri_n.newProp("policy", kthreads[pid]["policy"])
- kthri_n.newProp("priority", kthreads[pid]["priority"])
+ kthri_n.newProp("priority", bytes.decode(kthreads[pid]["priority"]))
return rep_n
diff --git a/rteval/sysinfo/network.py b/rteval/sysinfo/network.py
index 9b933c1..ce9989a 100644
--- a/rteval/sysinfo/network.py
+++ b/rteval/sysinfo/network.py
@@ -53,7 +53,7 @@ class NetworkInfo(object):
if hasattr(ethtool, 'get_interfaces_info'):
# Using the newer python-ethtool API (version >= 0.4)
for dev in ethtool.get_interfaces_info(ethtool.get_devices()):
- if cmp(dev.device,'lo') == 0:
+ if dev.device == 'lo':
continue
intf_n = libxml2.newNode('interface')
diff --git a/rteval/xmlout.py b/rteval/xmlout.py
index 6464258..15391a6 100644
--- a/rteval/xmlout.py
+++ b/rteval/xmlout.py
@@ -29,7 +29,6 @@ import libxml2
import lxml.etree
import codecs
import re
-#from string import maketrans
def convert_libxml2_to_lxml_doc(inxml):
@@ -51,7 +50,7 @@ def convert_lxml_to_libxml2_nodes(inlxml):
if not isinstance(inlxml,lxml.etree._Element) and not isinstance(inlxml, lxml.etree._XSLTResultTree):
raise TypeError('Function requires an lxml.etree object as input')
- return libxml2.parseDoc(lxml.etree.tostring(inlxml)).getRootElement()
+ return libxml2.parseDoc(bytes.decode(lxml.etree.tostring(inlxml))).getRootElement()
@@ -74,13 +73,13 @@ class XMLOut(object):
self.xmldoc.freeDoc()
def __setup_tag_trans(self):
- t = maketrans('', '')
- t = t.replace(' ', '_')
- t = t.replace('\t', '_')
- t = t.replace('(', '_')
- t = t.replace(')', '_')
- t = t.replace(':', '-')
+ t = str.maketrans('', '')
return t
+# t = t.replace(' ', '_')
+# t = t.replace('\t', '_')
+# t = t.replace('(', '_')
+# t = t.replace(')', '_')
+# t = t.replace(':', '-')
def __fixtag(self, tagname):
if not isinstance(tagname, str):
@@ -99,9 +98,7 @@ class XMLOut(object):
rx = re.compile(" ")
val = rx.sub("_", val)
- # libxml2 uses UTF-8 internally and must have
- # all input as UTF-8.
- return val.encode('utf-8')
+ return val
def __add_attributes(self, node, attr):
@@ -223,7 +220,7 @@ class XMLOut(object):
resdoc = parser(xmldoc)
# Write the file with the requested output encoding
- dstfile.write(str(resdoc).encode(self.encoding))
+ dstfile.write(bytes.decode(str(resdoc).encode(self.encoding)))
if dstfile != sys.stdout:
dstfile.close()
--
2.17.0

View File

@ -0,0 +1,119 @@
From f65d46723cd0e2d3a9b1f788b0ffa51e7fd04f8b Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Thu, 23 May 2019 17:54:20 +0200
Subject: [PATCH 1/2] rteval: Check whether a cpu is online before adding it to
the list
Check whether a cpu is online before adding it to the list
If sys online files exist, use them to determine if a cpu is online
This is done in two places, misc.py, and also in systopology which is
getting the cpus from the numa node in /sys/devices, including offline
cpus
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/misc.py | 19 ++++++++++++++++++-
rteval/systopology.py | 29 ++++++++++++++++++++++++-----
2 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/rteval/misc.py b/rteval/misc.py
index 7c9991483728..a43a8964e061 100644
--- a/rteval/misc.py
+++ b/rteval/misc.py
@@ -36,7 +36,24 @@ def expand_cpulist(cpulist):
return [ str(i) for i in list(set(result)) ]
def online_cpus():
- return [ str(c.replace('/sys/devices/system/cpu/cpu', '')) for c in glob.glob('/sys/devices/system/cpu/cpu[0-9]*') ]
+ online_cpus = []
+ # Check for the online file with cpu1 since cpu0 can't always be offlined
+ if os.path.exists('/sys/devices/system/cpu/cpu1/online'):
+ for c in glob.glob('/sys/devices/system/cpu/cpu[0-9]*'):
+ num = str(c.replace('/sys/devices/system/cpu/cpu',''))
+ # On some machine you can't turn off cpu0
+ if not os.path.exists(c + '/online') and num == "0":
+ online_cpus.append(num)
+ else:
+ with open(c + '/online') as f:
+ is_online = f.read().rstrip('\n')
+ if is_online == "1":
+ online_cpus.append(num)
+ else: # use the old heuristic
+ for c in glob.glob('/sys/devices/system/cpu/cpu[0-9]*'):
+ num = str(c.replace('/sys/devices/system/cpu/cpu',''))
+ online_cpus.append(num)
+ return online_cpus
def invert_cpulist(cpulist):
return [ c for c in online_cpus() if c not in cpulist]
diff --git a/rteval/systopology.py b/rteval/systopology.py
index 97a6037e83aa..07674658df8e 100644
--- a/rteval/systopology.py
+++ b/rteval/systopology.py
@@ -45,6 +45,7 @@ class CpuList(object):
self.cpulist = cpulist
elif type(cpulist) is str:
self.cpulist = self.__expand_cpulist(cpulist)
+ self.cpulist = self.online_cpulist(self.cpulist)
self.cpulist.sort()
def __str__(self):
@@ -56,6 +57,10 @@ class CpuList(object):
def __len__(self):
return len(self.cpulist)
+ def online_file_exists(self):
+ if os.path.exists('/sys/devices/system/cpu/cpu1/online'):
+ return True
+ return False
# return the index of the last element of a sequence
# that steps by one
@@ -68,7 +73,6 @@ class CpuList(object):
return idx
return lim - 1
-
#
# collapse a list of cpu numbers into a string range
# of cpus (e.g. 0-5, 7, 9)
@@ -110,15 +114,30 @@ class CpuList(object):
return self.cpulist
# check whether cpu n is online
- def isonline(self, n):
+ def is_online(self, n):
if n not in self.cpulist:
raise RuntimeError("invalid cpu number %d" % n)
if n == 0:
return True
path = os.path.join(CpuList.cpupath,'cpu%d' % n)
- if os.path.exists(path):
- return sysread(path, "online") == 1
- return False
+ # Some hardware doesn't allow cpu0 to be turned off
+ if not os.path.exists(path + '/online') and n == 0:
+ return True
+ else:
+ return sysread(path, "online") == "1"
+
+ # Given a cpulist, return a cpulist of online cpus
+ def online_cpulist(self, cpulist):
+ # This only works if the sys online files exist
+ if not self.online_file_exists():
+ return cpulist
+ newlist = []
+ for cpu in cpulist:
+ if not self.online_file_exists() and cpu == '0':
+ newlist.append(cpu)
+ elif self.is_online(int(cpu)):
+ newlist.append(cpu)
+ return newlist
#
# class to abstract access to NUMA nodes in /sys filesystem
--
2.20.1

View File

@ -1,41 +0,0 @@
From 2d547eb6a7598f608a5fce44988223186cb65760 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Tue, 16 Oct 2018 19:23:25 +0200
Subject: [PATCH] rteval: Disable options for remote xmlrpc server
Disable options for remote xmlrpc server
The simplest way to keep the code in place but disable this is to
comment out the options where the commandline is parsed.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval-cmd | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/rteval-cmd b/rteval-cmd
index 404d4ca0eb37..dff972f663cf 100755
--- a/rteval-cmd
+++ b/rteval-cmd
@@ -129,12 +129,12 @@ def parse_options(cfg, parser, cmdargs):
parser.add_option("-D", '--debug', dest='rteval___debugging',
action='store_true', default=rtevcfg.debugging,
help='turn on debug prints (default: %default)')
- parser.add_option("-X", '--xmlrpc-submit', dest='rteval___xmlrpc',
- action='store', default=rtevcfg.xmlrpc, metavar='HOST',
- help='Hostname to XML-RPC server to submit reports')
- parser.add_option("-P", "--xmlrpc-no-abort", dest="rteval___xmlrpc_noabort",
- action='store_true', default=False,
- help="Do not abort if XML-RPC server do not respond to ping request");
+ #parser.add_option("-X", '--xmlrpc-submit', dest='rteval___xmlrpc',
+ # action='store', default=rtevcfg.xmlrpc, metavar='HOST',
+ # help='Hostname to XML-RPC server to submit reports')
+ #parser.add_option("-P", "--xmlrpc-no-abort", dest="rteval___xmlrpc_noabort",
+ # action='store_true', default=False,
+ # help="Do not abort if XML-RPC server do not respond to ping request");
parser.add_option("-Z", '--summarize', dest='rteval___summarize',
action='store_true', default=False,
help='summarize an already existing XML report')
--
2.14.4

View File

@ -0,0 +1,33 @@
From 24efd8cf2fbde73636c4c8434447b0e04dc7a89a Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Tue, 19 Nov 2019 12:12:33 +0100
Subject: [PATCH] rteval: Don't assume cpu0 cannot be offlined, test it
Don't just assume that cpu0 cannot be offlined.
If the file /sys/devices/system/cpu/cpu0/online exists, then test the
value just like for every other cpu
However, if the file doesn't exist, that means that it cannot be
offlined.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/systopology.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/rteval/systopology.py b/rteval/systopology.py
index 9556e51d96a2..7c3878e51be4 100644
--- a/rteval/systopology.py
+++ b/rteval/systopology.py
@@ -117,8 +117,6 @@ class CpuList(object):
def is_online(self, n):
if n not in self.cpulist:
raise RuntimeError("invalid cpu number %d" % n)
- if n == 0:
- return True
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:
--
2.20.1

View File

@ -1,47 +0,0 @@
From 0c6bc0249618ba3833d062f13ff987fd29a11ab8 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Tue, 8 May 2018 19:18:54 +0100
Subject: [PATCH 17/18] rteval: Explicitly use python3
Make the use of python3 explicit
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval-cmd | 2 +-
rteval/misc.py | 2 +-
setup.py | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/rteval-cmd b/rteval-cmd
index ed61d98de1a2..3ae29dbd9fe3 100755
--- a/rteval-cmd
+++ b/rteval-cmd
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
# -*- coding: utf-8 -*-
#
# rteval - script for evaluating platform suitability for RT Linux
diff --git a/rteval/misc.py b/rteval/misc.py
index 7b55b3490e61..0cfc69dfbd62 100644
--- a/rteval/misc.py
+++ b/rteval/misc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
#
# Copyright (C) 2015 Clark Williams <clark.williams@gmail.com>
# Copyright (C) 2015 Red Hat, Inc.
diff --git a/setup.py b/setup.py
index f5dc14610ae4..39bc8247b704 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
from distutils.sysconfig import get_python_lib
from distutils.core import setup
from os.path import isfile, join
--
2.14.3

View File

@ -1,28 +0,0 @@
From 098651a756aaad2d638dec12b9f387e416339892 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Mon, 17 Dec 2018 17:40:49 +0100
Subject: [PATCH] rteval: Fix typo in debug output
Fix typo in debug output. Should say cmdline
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/sysinfo/cmdline.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rteval/sysinfo/cmdline.py b/rteval/sysinfo/cmdline.py
index 12b3a5d9b7bd..7e7566aa2d8e 100644
--- a/rteval/sysinfo/cmdline.py
+++ b/rteval/sysinfo/cmdline.py
@@ -13,7 +13,7 @@ class cmdlineInfo:
cmdlineList = []
fp = open('/proc/cmdline', 'r')
line = fp.readline()
- self.__log(Log.DEBUG, "/proc/mcdline\n")
+ self.__log(Log.DEBUG, "/proc/cmdline\n")
fp.close()
return line
--
2.19.2

View File

@ -1,50 +0,0 @@
From afbb4f884cd4221f557f8de98670c106448d2529 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Tue, 16 May 2017 20:55:36 -0400
Subject: [PATCH 04/18] rteval: Improve error handling if cyclictest fails to
run
Improve error handling if cyclictest fails to run.
An example of this could be if cyclictest is not installed, or rteval
cannot find the installation
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/modules/measurement/cyclictest.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
index c5b30557da0b..d920e4be6548 100644
--- a/rteval/modules/measurement/cyclictest.py
+++ b/rteval/modules/measurement/cyclictest.py
@@ -299,11 +299,14 @@ class Cyclictest(rtevalModulePrototype):
fp.close()
self.__cyclicoutput.seek(0)
- self.__cyclicprocess = subprocess.Popen(self.__cmd,
+ try:
+ self.__cyclicprocess = subprocess.Popen(self.__cmd,
stdout=self.__cyclicoutput,
stderr=self.__nullfp,
stdin=self.__nullfp)
- self.__started = True
+ self.__started = True
+ except OSError:
+ self.__started = False
def WorkloadAlive(self):
@@ -314,7 +317,9 @@ class Cyclictest(rtevalModulePrototype):
def _WorkloadCleanup(self):
- while self.__cyclicprocess.poll() == None:
+ if not self.__started:
+ return
+ while self.__cyclicprocess.poll() is None:
self._log(Log.DEBUG, "Sending SIGINT")
os.kill(self.__cyclicprocess.pid, signal.SIGINT)
time.sleep(2)
--
2.14.3

View File

@ -1,262 +0,0 @@
From 59d3912d71832092c4daadf31fb3184f50aaa8b0 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Thu, 18 May 2017 14:49:03 +0200
Subject: [PATCH 09/18] rteval: Remove rteval/sysinfo/systopology.py
Remove rteval/sysinfo/systopology.py as it is replaced by
rteval/systopology.py
As was intended by 6e4d54b8c6d3697efba0e3d
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/sysinfo/systopology.py | 237 ------------------------------------------
1 file changed, 237 deletions(-)
delete mode 100644 rteval/sysinfo/systopology.py
diff --git a/rteval/sysinfo/systopology.py b/rteval/sysinfo/systopology.py
deleted file mode 100644
index a6e5c1a8b409..000000000000
--- a/rteval/sysinfo/systopology.py
+++ /dev/null
@@ -1,237 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Copyright 2016 - Clark Williams <williams@redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# For the avoidance of doubt the "preferred form" of this code is one which
-# is in an open unpatent encumbered format. Where cryptographic key signing
-# forms part of the process of creating an executable the information
-# including keys needed to generate an equivalently functional executable
-# are deemed to be part of the source code.
-#
-
-import os, sys
-import os.path
-import glob
-
-def _sysread(path, obj):
- fp = open(os.path.join(path,obj), "r")
- return fp.readline().strip()
-
-#
-# class to provide access to a list of cpus
-#
-
-class CpuList(object):
- "Object that represents a group of system cpus"
-
- cpupath = '/sys/devices/system/cpu'
-
- def __init__(self, cpulist):
- if type(cpulist) is list:
- self.cpulist = cpulist
- elif type(cpulist) is str:
- self.cpulist = self.__expand_cpulist(cpulist)
- self.cpulist.sort()
-
- def __str__(self):
- return self.__collapse_cpulist(self.cpulist)
-
- def __contains__(self, cpu):
- return cpu in self.cpulist
-
- def __len__(self):
- return len(self.cpulist)
-
-
- # return the index of the last element of a sequence
- # that steps by one
- def __longest_sequence(self, cpulist):
- lim = len(cpulist)
- for idx,val in enumerate(cpulist):
- if idx+1 == lim:
- break
- if int(cpulist[idx+1]) != (int(cpulist[idx])+1):
- return idx
- return lim - 1
-
-
- #
- # collapse a list of cpu numbers into a string range
- # of cpus (e.g. 0-5, 7, 9)
- #
- def __collapse_cpulist(self, cpulist):
- if len(cpulist) == 0:
- return ""
- idx = self.__longest_sequence(cpulist)
- if idx == 0:
- seq = str(cpulist[0])
- else:
- if idx == 1:
- seq = "%d,%d" % (cpulist[0], cpulist[idx])
- else:
- seq = "%d-%d" % (cpulist[0], cpulist[idx])
-
- rest = self.__collapse_cpulist(cpulist[idx+1:])
- if rest == "":
- return seq
- return ",".join((seq, rest))
-
- # expand a string range into a list
- # don't error check against online cpus
- def __expand_cpulist(self, cpulist):
- '''expand a range string into an array of cpu numbers'''
- result = []
- for part in cpulist.split(','):
- if '-' in part:
- a, b = part.split('-')
- a, b = int(a), int(b)
- result.extend(range(a, b + 1))
- else:
- a = int(part)
- result.append(a)
- return [ int(i) for i in list(set(result)) ]
-
- # returns the list of cpus tracked
- def getcpulist(self):
- return self.cpulist
-
- # check whether cpu n is online
- def isonline(self, n):
- if n not in self.cpulist:
- raise RuntimeError, "invalid cpu number %d" % n
- if n == 0:
- return True
- path = os.path.join(CpuList.cpupath,'cpu%d' % n)
- if os.path.exists(path):
- return _sysread(path, "online") == 1
- return False
-
-#
-# class to abstract access to NUMA nodes in /sys filesystem
-#
-
-class NumaNode(object):
- "class representing a system NUMA node"
-
- # constructor argument is the full path to the /sys node file
- # e.g. /sys/devices/system/node/node0
- def __init__(self, path):
- self.path = path
- self.nodeid = int(os.path.basename(path)[4:].strip())
- self.cpus = CpuList(_sysread(self.path, "cpulist"))
- self.getmeminfo()
-
- # function for the 'in' operator
- def __contains__(self, cpu):
- return cpu in self.cpus
-
- # allow the 'len' builtin
- def __len__(self):
- return len(self.cpus)
-
- # string representation of the cpus for this node
- def __str__(self):
- return self.getcpustr()
-
- # read info about memory attached to this node
- def getmeminfo(self):
- 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])
- if len(elements) == 5 and elements[4] == "kB":
- val *= 1024
- self.meminfo[key] = val
-
- # return list of cpus for this node as a string
- def getcpustr(self):
- return str(self.cpus)
-
- # return list of cpus for this node
- def getcpulist(self):
- return self.cpus.getcpulist()
-
-#
-# Class to abstract the system topology of numa nodes and cpus
-#
-class SysTopology(object):
- "Object that represents the system's NUMA-node/cpu topology"
-
- cpupath = '/sys/devices/system/cpu'
- nodepath = '/sys/devices/system/node'
-
- def __init__(self):
- self.nodes = {}
- self.getinfo()
-
- def __len__(self):
- return len(self.nodes.keys())
-
- # inplement the 'in' function
- def __contains__(self, node):
- for n in self.nodes:
- if self.nodes[n].nodeid == node:
- return True
- return False
-
- # allow indexing for the nodes
- def __getitem__(self, key):
- return self.nodes[key]
-
- # allow iteration over the cpus for the node
- def __iter__(self):
- self.current = 0
- return self
-
- # iterator function
- def next(self):
- if self.current >= len(self.nodes):
- raise StopIteration
- n = self.nodes[self.current]
- self.current += 1
- return n
-
- def getinfo(self):
- nodes = glob.glob(os.path.join(SysTopology.nodepath, 'node[0-9]*'))
- if not nodes:
- raise RuntimeError, "No valid nodes found in %s!" % SysTopology.nodepath
- nodes.sort()
- for n in nodes:
- node = int(os.path.basename(n)[4:])
- self.nodes[node] = NumaNode(n)
-
- def getnodes(self):
- return self.nodes.keys()
-
- def getcpus(self, node):
- return self.nodes[node]
-
-
-
-if __name__ == "__main__":
-
- def unit_test():
- s = SysTopology()
- print "number of nodes: %d" % len(s)
- for n in s:
- print "node[%d]: %s" % (n.nodeid, n)
- print "system has numa node 0: %s" % (0 in s)
- print "system has numa node 2: %s" % (2 in s)
- print "system has numa node 24: %s" % (24 in s)
-
- unit_test()
--
2.14.3

View File

@ -1,115 +0,0 @@
From 5a54d982b05caa48a51fb7db1c5c1d10a76dcc68 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Fri, 20 Oct 2017 12:17:47 +0100
Subject: [PATCH 12/18] rteval: add the /proc/cmdline to rteval report
Bugzilla: bz1452788
Creates a new class cmdlineInfo which is added to the report
example of the output:
Cmdline: BOOT_IMAGE=/vmlinuz-3.10.0-663.el7.x86_64
root=/dev/mapper/rhel_dell--pem710--02-root ro crashkernel=auto
rd.lvm.lv=rhel_dell-pem710-02/root rd.lvm.lv=rhel_dell-pem710-02/swap
console=ttyS0,115200n81 isolcpus=3
Signed-off-by: John Kacur <jkacur@redhat.com>
cmdline
Signed-off-by: John Kacur <jkacur@redhat.com>
(cherry picked from commit 3e883c598c5588ebec3e9a6e1f8bd396e5d3ab94)
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/rteval_text.xsl | 5 +++++
rteval/sysinfo/__init__.py | 5 ++++-
rteval/sysinfo/cmdline.py | 28 ++++++++++++++++++++++++++++
3 files changed, 37 insertions(+), 1 deletion(-)
create mode 100644 rteval/sysinfo/cmdline.py
diff --git a/rteval/rteval_text.xsl b/rteval/rteval_text.xsl
index e99c0162c75a..c40063e3dd19 100644
--- a/rteval/rteval_text.xsl
+++ b/rteval/rteval_text.xsl
@@ -136,6 +136,11 @@
<xsl:apply-templates select="loads/command_line"/>
</xsl:if>
<xsl:text>&#10;</xsl:text>
+
+ <xsl:text> Cmdline: </xsl:text>
+ <xsl:value-of select="SystemInfo/cmdlineInfo/cmdline"/>
+ <xsl:text>&#10;</xsl:text>
+
<!-- Generate a summary report for all measurement profiles -->
<xsl:apply-templates select="Measurements/Profile"/>
<xsl:text> ===================================================================&#10;</xsl:text>
diff --git a/rteval/sysinfo/__init__.py b/rteval/sysinfo/__init__.py
index 0de985bf86f1..f7bf823aa36d 100644
--- a/rteval/sysinfo/__init__.py
+++ b/rteval/sysinfo/__init__.py
@@ -32,9 +32,10 @@ from cputopology import CPUtopology
from memory import MemoryInfo
from osinfo import OSInfo
from network import NetworkInfo
+from cmdline import cmdlineInfo
import dmi
-class SystemInfo(KernelInfo, SystemServices, dmi.DMIinfo, CPUtopology, MemoryInfo, OSInfo, NetworkInfo):
+class SystemInfo(KernelInfo, SystemServices, dmi.DMIinfo, CPUtopology, MemoryInfo, OSInfo, NetworkInfo, cmdlineInfo):
def __init__(self, config, logger=None):
self.__logger = logger
KernelInfo.__init__(self, logger=logger)
@@ -42,6 +43,7 @@ class SystemInfo(KernelInfo, SystemServices, dmi.DMIinfo, CPUtopology, MemoryInf
dmi.DMIinfo.__init__(self, config, logger=logger)
CPUtopology.__init__(self)
OSInfo.__init__(self, logger=logger)
+ cmdlineInfo.__init__(self, logger=logger)
# Parse initial DMI decoding errors
dmi.ProcessWarnings()
@@ -62,6 +64,7 @@ class SystemInfo(KernelInfo, SystemServices, dmi.DMIinfo, CPUtopology, MemoryInf
report_n.addChild(CPUtopology.MakeReport(self))
report_n.addChild(MemoryInfo.MakeReport(self))
report_n.addChild(dmi.DMIinfo.MakeReport(self))
+ report_n.addChild(cmdlineInfo.MakeReport(self))
return report_n
diff --git a/rteval/sysinfo/cmdline.py b/rteval/sysinfo/cmdline.py
new file mode 100644
index 000000000000..12b3a5d9b7bd
--- /dev/null
+++ b/rteval/sysinfo/cmdline.py
@@ -0,0 +1,28 @@
+import sys, os, readline, libxml2
+from rteval.Log import Log
+
+class cmdlineInfo:
+ def __init__(self, logger = None):
+ self.__logger = logger
+
+ def __log(self, logtype, msg):
+ if self.__logger:
+ self.__logger.log(logtype, msg)
+
+ def read_cmdline(self):
+ cmdlineList = []
+ fp = open('/proc/cmdline', 'r')
+ line = fp.readline()
+ self.__log(Log.DEBUG, "/proc/mcdline\n")
+ fp.close()
+ return line
+
+ def MakeReport(self):
+ rep_n = libxml2.newNode("cmdlineInfo")
+ cmdline_n = libxml2.newNode("cmdline")
+ cmdlineStr = self.read_cmdline()
+ cmdline_n.addContent(cmdlineStr)
+ self.__log(Log.DEBUG, cmdlineStr)
+ rep_n.addChild(cmdline_n)
+
+ return rep_n
--
2.14.3

View File

@ -1,38 +0,0 @@
From 3ec25aea4b437db0d0910b4cb7110c8850d3b64b Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Tue, 8 May 2018 15:44:50 +0100
Subject: [PATCH 15/18] rteval: cyclictest.py: Fix spacing problems
Some spacing problems got introduced with the last fix, possibly
as a result of examining them with certain text editors
Fix these
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/modules/measurement/cyclictest.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
index d920e4be6548..f6c6d1353fac 100644
--- a/rteval/modules/measurement/cyclictest.py
+++ b/rteval/modules/measurement/cyclictest.py
@@ -299,13 +299,13 @@ class Cyclictest(rtevalModulePrototype):
fp.close()
self.__cyclicoutput.seek(0)
- try:
+ try:
self.__cyclicprocess = subprocess.Popen(self.__cmd,
stdout=self.__cyclicoutput,
stderr=self.__nullfp,
stdin=self.__nullfp)
self.__started = True
- except OSError:
+ except OSError:
self.__started = False
--
2.14.3

View File

@ -1,30 +0,0 @@
From 6c89a0dcb9133792fc755d2b7370b81b5471753e Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Tue, 8 May 2018 16:35:59 +0100
Subject: [PATCH 16/18] rteval: cyclictest.py: Remove -n for cyclictest options
Upstream cyclictest made clock_nanosleep the default and removed
the -n option. Passing it as an option now creates an error, so remove
that here too.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
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 f6c6d1353fac..04f78d1c9612 100644
--- a/rteval/modules/measurement/cyclictest.py
+++ b/rteval/modules/measurement/cyclictest.py
@@ -259,7 +259,7 @@ class Cyclictest(rtevalModulePrototype):
self.__cmd = ['cyclictest',
self.__interval,
- '-qmun',
+ '-qmu',
'-h %d' % self.__buckets,
"-p%d" % int(self.__priority),
]
--
2.14.3

View File

@ -1,29 +0,0 @@
From 989eb650c0171a3d79e33986627ed4d5fb970b46 Mon Sep 17 00:00:00 2001
From: Jiri Kastner <jkastner@redhat.com>
Date: Thu, 2 Aug 2018 16:37:15 +0200
Subject: [PATCH] rteval: fix rtevalclient import
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/rtevalXMLRPC.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rteval/rtevalXMLRPC.py b/rteval/rtevalXMLRPC.py
index 7b2d207e0088..54bc114099d9 100644
--- a/rteval/rtevalXMLRPC.py
+++ b/rteval/rtevalXMLRPC.py
@@ -24,8 +24,8 @@
# are deemed to be part of the source code.
#
-import socket, time
-import rtevalclient, xmlrpc.client
+import socket, time, xmlrpc.client
+from .rtevalclient import rtevalclient
from .Log import Log
class rtevalXMLRPC(object):
--
2.14.4

View File

@ -0,0 +1,41 @@
From 3c6483c6e6e24a3e457c631f031f83e81b5e930c Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Tue, 10 Dec 2019 02:23:10 +0100
Subject: [PATCH] rteval: hackbench Fix interating through nodes
Fix iterating through the nodes in hackbench.
When creating a dictionary of node, cpus, we need to iterate through the
nodes and not through sysTop alone.
Also use python3 syntax for iterating through a dictionary.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/modules/loads/hackbench.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py
index f31e29dd3f13..d951d1a0b930 100644
--- a/rteval/modules/loads/hackbench.py
+++ b/rteval/modules/loads/hackbench.py
@@ -61,7 +61,7 @@ class Hackbench(CommandLineLoad):
# get the cpus for each node
self.cpus = {}
biggest = 0
- for n in sysTop:
+ for n in sysTop.getnodes():
self.cpus[n] = sysTop.getcpus(int(n))
# if a cpulist was specified, only allow cpus in that list on the node
if self.cpulist:
@@ -73,7 +73,7 @@ class Hackbench(CommandLineLoad):
biggest = node_biggest
# remove nodes with no cpus available for running
- for node,cpus in 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)
--
2.20.1

View File

@ -1,41 +0,0 @@
From 5ed68ae77ec05786aab99fbed35d0347a5d25997 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Fri, 20 Oct 2017 12:17:49 +0100
Subject: [PATCH 14/18] rteval: hackbench.py: Do not sleep if hackbench fails
from memory errors
Do not sleep if hackbench fails to launch due to out-of-memory errors.
This can cause rteval to execute correctly without applying a full
stress load. Instead, exit gracefully
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/modules/loads/hackbench.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py
index 8456a24f4bba..9d3f6c834356 100644
--- a/rteval/modules/loads/hackbench.py
+++ b/rteval/modules/loads/hackbench.py
@@ -150,14 +150,10 @@ class Hackbench(CommandLineLoad):
except OSError, e:
if e.errno != errno.ENOMEM:
raise e
- # Catch out-of-memory errors and wait a bit to (hopefully)
- # ease memory pressure
- self._log(Log.DEBUG, "ERROR: %s, sleeping for %f seconds" % (e.strerror, self.__err_sleep))
- time.sleep(self.__err_sleep)
- if self.__err_sleep < 60.0:
- self.__err_sleep *= 2.0
- if self.__err_sleep > 60.0:
- self.__err_sleep = 60.0
+ # Exit gracefully without a traceback for out-of-memory errors
+ self._log(Log.DEBUG, "ERROR, ENOMEM while trying to launch hackbench")
+ print("out-of-memory trying to launch hackbench, exiting")
+ sys.exit(-1)
def WorkloadAlive(self):
--
2.14.3

View File

@ -0,0 +1,54 @@
From ba69dfd96da37208c63313ecab233a39568d576c Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Mon, 2 Dec 2019 13:05:02 +0100
Subject: [PATCH] rteval: node in args to Popen must be a string
In hackbench.py, the args to Popen must be a string and not an integer
Before this change, this can happen.
rteval --duration=1m
got system topology: 2 node system (10 cores per node)
rteval run on 4.18.0-151.rt13.8.el8.x86_64 started at Tue Nov 26 14:42:18 2019
started 2 loads on 20 cores with 2 numa nodes
started measurement threads on 20 cores
Run duration: 60.0 seconds
Exception in thread hackbench:
Traceback (most recent call last):
File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/site-packages/rteval/modules/__init__.py", line 188, in run
self._WorkloadTask()
File "/usr/lib/python3.6/site-packages/rteval/modules/loads/hackbench.py", line 147, in _WorkloadTask
self.tasks[n] = self.__starton(n)
File "/usr/lib/python3.6/site-packages/rteval/modules/loads/hackbench.py", line 134, in __starton
stderr=self.__err)
File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
restore_signals, start_new_session)
File "/usr/lib64/python3.6/subprocess.py", line 1295, in _execute_child
restore_signals, start_new_session, preexec_fn)
TypeError: expected str, bytes or os.PathLike object, not int
After converting the node to a string, it works as expected
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/modules/loads/hackbench.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py
index b15ea6378310..f31e29dd3f13 100644
--- a/rteval/modules/loads/hackbench.py
+++ b/rteval/modules/loads/hackbench.py
@@ -120,7 +120,7 @@ class Hackbench(CommandLineLoad):
def __starton(self, node):
if self.__multinodes or self.cpulist:
if self.__usenumactl:
- args = [ 'numactl', '--cpunodebind', 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
--
2.20.1

View File

@ -1,36 +0,0 @@
From 69a848c0030d39a9546253b27b060634852bf8e9 Mon Sep 17 00:00:00 2001
From: Jiri Kastner <jkastner@redhat.com>
Date: Fri, 3 Aug 2018 13:09:56 +0200
Subject: [PATCH] rteval: remaining time fix
in python3 division of integer/integer results in float.
casting division to int gives us needed numbers.
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/__init__.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/rteval/__init__.py b/rteval/__init__.py
index 176715f74ebd..88145b7eba1c 100644
--- a/rteval/__init__.py
+++ b/rteval/__init__.py
@@ -116,11 +116,11 @@ class RtEval(rtevalReport):
def __show_remaining_time(self, remaining):
r = int(remaining)
- days = r / 86400
+ days = int(r / 86400)
if days: r = r - (days * 86400)
- hours = r / 3600
+ hours = int(r / 3600)
if hours: r = r - (hours * 3600)
- minutes = r / 60
+ minutes = int(r / 60)
if minutes: r = r - (minutes * 60)
print("rteval time remaining: %d days, %d hours, %d minutes, %d seconds" % (days, hours, minutes, r))
--
2.14.4

View File

@ -1,33 +0,0 @@
From 4c64b6b5ef7eba57c0892407816223c3f226b9ae Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Fri, 10 Aug 2018 17:44:35 +0200
Subject: [PATCH] rteval: remove unnecssary encode
When running $ rteval --summarize <run-tarball>
the newlines are missing and the output comes out as one big line.
The addition of the encoding for python3 compatibility has made the
encoding here unnessary and in fact it causes problems, so remove it
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval-cmd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rteval-cmd b/rteval-cmd
index 739a929316a3..404d4ca0eb37 100755
--- a/rteval-cmd
+++ b/rteval-cmd
@@ -83,7 +83,7 @@ def summarize(repfile, xslt):
# Parse and print the report through the XSLT template - preserve proper encoding
resdoc = xsltprs(xmldoc)
- print(str(resdoc).encode('UTF-8'))
+ print(str(resdoc))
# Clean up
del resdoc
--
2.14.4

View File

@ -1,28 +0,0 @@
From b64537b1530b7918618f925ea7ccc3b119a8b471 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Wed, 30 May 2018 13:12:21 +0100
Subject: [PATCH] rteval: setup.py: Open byte like object
python3 differentiates between text and binary data
Signed-off-by: John Kacur <jkacur@redhat.com>
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index fc78a93c8793..95efa905f4d1 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@ from dist import RTEVAL_VERSION
# Compress the man page, so distutil will only care for the compressed file
mangz = gzip.GzipFile('dist/rteval.8.gz', 'w', 9)
-man = open('doc/rteval.8', 'r')
+man = open('doc/rteval.8', 'rb')
mangz.writelines(man)
man.close()
mangz.close()
--
2.14.3

View File

@ -1,48 +0,0 @@
From 42d724f1a68815ecf7b44c7a2b9001363c93f4ce Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Thu, 18 May 2017 13:32:48 +0200
Subject: [PATCH 08/18] rteval: systopology.py: Remove underscore from sysread
Remove underscore from sysread.
I'm eseentially backporting this comment from the obsolete file
rteval/sysinfo/systopology.py
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/systopology.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/rteval/systopology.py b/rteval/systopology.py
index 7c0985e9d26e..fc3876c20bc9 100644
--- a/rteval/systopology.py
+++ b/rteval/systopology.py
@@ -27,7 +27,7 @@ import os, sys
import os.path
import glob
-def _sysread(path, obj):
+def sysread(path, obj):
fp = open(os.path.join(path,obj), "r")
return fp.readline().strip()
@@ -117,7 +117,7 @@ class CpuList(object):
return True
path = os.path.join(CpuList.cpupath,'cpu%d' % n)
if os.path.exists(path):
- return _sysread(path, "online") == 1
+ return sysread(path, "online") == 1
return False
#
@@ -132,7 +132,7 @@ class NumaNode(object):
def __init__(self, path):
self.path = path
self.nodeid = int(os.path.basename(path)[4:].strip())
- self.cpus = CpuList(_sysread(self.path, "cpulist"))
+ self.cpus = CpuList(sysread(self.path, "cpulist"))
self.getmeminfo()
# function for the 'in' operator
--
2.14.3

View File

@ -0,0 +1,78 @@
From c7ba86bae03dc98f3f988e0f261af1651930fd50 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Tue, 28 May 2019 23:47:22 +0200
Subject: [PATCH 2/2] rteval: Change hackbench to use systopology to calculate
online cpus
- change the class SysTopology method getcpus to work properly
. have hackbench make use of SysTopology instead of it's own
implementation to calculate cpus. The advantage is that this will
automatically calculate online cpus and sort them
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/modules/loads/hackbench.py | 18 +++++++++---------
rteval/systopology.py | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py
index 0ee60d900f18..b15ea6378310 100644
--- a/rteval/modules/loads/hackbench.py
+++ b/rteval/modules/loads/hackbench.py
@@ -30,6 +30,7 @@ from signal import SIGKILL
from rteval.modules.loads import CommandLineLoad
from rteval.Log import Log
from rteval.misc import expand_cpulist
+from rteval.systopology import SysTopology
class Hackbench(CommandLineLoad):
def __init__(self, config, logger):
@@ -53,24 +54,23 @@ class Hackbench(CommandLineLoad):
mult = 0
self._donotrun = True
- # figure out how many nodes we have
- self.nodes = [ n.split('/')[-1][4:] for n in glob.glob('/sys/devices/system/node/node*') ]
-
+ sysTop = SysTopology()
+ # get the number of nodes
+ self.nodes = sysTop.getnodes()
# get the cpus for each node
self.cpus = {}
biggest = 0
- 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].sort()
-
+ for n in sysTop:
+ 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) ]
# track largest number of cpus used on a node
- if len(self.cpus[n]) > biggest:
- biggest = len(self.cpus[n])
+ node_biggest = len(sysTop.getcpus(int(n)))
+ if node_biggest > biggest:
+ biggest = node_biggest
# remove nodes with no cpus available for running
for node,cpus in self.cpus.items():
diff --git a/rteval/systopology.py b/rteval/systopology.py
index 07674658df8e..9556e51d96a2 100644
--- a/rteval/systopology.py
+++ b/rteval/systopology.py
@@ -246,7 +246,7 @@ class SysTopology(object):
return list(self.nodes.keys())
def getcpus(self, node):
- return self.nodes[node]
+ return self.nodes[node].getcpulist()
--
2.20.1

View File

@ -1,32 +0,0 @@
From 8a704e7b12b132d4e161bcc49f009a05350b98ca Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Fri, 12 Oct 2018 00:49:33 +0200
Subject: [PATCH] rteval: rtevalReport.py: Fix time format in report
Another case where python3 division generates floats
This can be fixed by converting the result to an int
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/rtevalReport.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rteval/rtevalReport.py b/rteval/rtevalReport.py
index 55594ae8f0bc..a18dd41b36fc 100644
--- a/rteval/rtevalReport.py
+++ b/rteval/rtevalReport.py
@@ -48,9 +48,9 @@ class rtevalReport(object):
duration = datetime.now() - measure_start
seconds = duration.seconds
- hours = seconds / 3600
+ hours = int(seconds / 3600)
if hours: seconds -= (hours * 3600)
- minutes = seconds / 60
+ minutes = int(seconds / 60)
if minutes: seconds -= (minutes * 60)
# Start new XML report
--
2.14.4

View File

@ -1,32 +0,0 @@
From 74432794f6bf0bcb984cf53982e9495163b76b3a Mon Sep 17 00:00:00 2001
From: Clark Williams <williams@redhat.com>
Date: Tue, 12 Sep 2017 13:36:31 -0500
Subject: [PATCH 10/18] sysinfo: don't fail if we don't know the init system
Signed-off-by: Clark Williams <williams@redhat.com>
---
rteval/sysinfo/services.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rteval/sysinfo/services.py b/rteval/sysinfo/services.py
index e7c2fe0dc00e..6465d35e1b73 100644
--- a/rteval/sysinfo/services.py
+++ b/rteval/sysinfo/services.py
@@ -95,7 +95,8 @@ class SystemServices(object):
self.__log(Log.DEBUG, "Using sysvinit to get services status")
return self.__get_services_sysvinit()
else:
- raise RuntimeError, "Unknown init system (%s)" % self.__init
+ self.__init = 'container'
+ self.__log(Log.DEBUG, "Running inside container")
return {}
@@ -133,4 +134,3 @@ def unit_test(rootdir):
if __name__ == '__main__':
sys.exit(unit_test(None))
-
--
2.14.3

View File

@ -1,27 +0,0 @@
From ed5cb77f7bcfee9833e41d675246cec310143179 Mon Sep 17 00:00:00 2001
From: Clark Williams <williams@redhat.com>
Date: Fri, 17 Mar 2017 16:44:32 -0500
Subject: [PATCH 01/18] update rt-tests URL in docs/README
Signed-off-by: Clark Williams <williams@redhat.com>
---
README | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/README b/README
index 1fcc34749394..62b1cd25f4fd 100644
--- a/README
+++ b/README
@@ -35,8 +35,7 @@ libxml2-python
http://xmlsoft.org/
rt-tests
- git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git
-
+ git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
Clark Williams <williams@redhat.com> wrote rteval
David Sommerseth <davids@redhat.com> wrote the XML-RPC and database
--
2.14.3

View File

@ -1,29 +1,32 @@
Name: rteval
Version: 2.14
Release: 25%{?dist}
Version: 3.0
Release: 6%{?dist}
Summary: Utility to evaluate system suitability for RT Linux
Group: Development/Tools
License: GPLv2
URL: http://git.kernel.org/?p=linux/kernel/git/clrkwllms/rteval.git
Source0: rteval-%{version}.tar.bz2
URL: https://www.kernel.org/pub/linux/utils/rteval/rteval-3.0.tar.xz
Source0: rteval-%{version}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python3-devel
Requires: platform-python
Requires: python3-schedutils python3-ethtool python3-lxml
Requires: python3-dmidecode >= 3.10
Requires: rt-tests >= 0.97
Requires: rteval-loads >= 1.4
Requires: rt-tests >= 1.5-11
Requires: rteval-loads >= 1.4-5
Requires: rteval-common => %{version}-%{release}
Requires: sysstat
Requires: bzip2
Requires: xz bzip2
Requires: kernel-headers
Requires: sos
Requires: tar
BuildArch: noarch
Obsoletes: rteval <= 1.7
Obsoletes: rteval <= 2.14
Requires: numactl
Requires: gcc flex bison bc
Requires: elfutils elfutils-libelf-devel
Requires: openssl-devel
%description
The rteval script is a utility for measuring various aspects of
@ -34,31 +37,16 @@ is run to measure event response time. After the run time completes,
a statistical analysis of the event response times is done and printed
to the screen.
%package common
Summary: Common rteval files
BuildArch: noarch
Patch1: update-rt-tests-URL-in-docs-README.patch
Patch2: rteval-Improve-error-handling-if-cyclictest-fails-to.patch
Patch3: rteval-systopology.py-Remove-underscore-from-sysread.patch
Patch4: rteval-Remove-rteval-sysinfo-systopology.py.patch
Patch5: sysinfo-don-t-fail-if-we-don-t-know-the-init-system.patch
Patch6: rteval-add-the-proc-cmdline-to-rteval-report.patch
Patch7: rteval-hackbench.py-Do-not-sleep-if-hackbench-fails-.patch
Patch8: rteval-cyclictest.py-Fix-spacing-problems.patch
Patch9: rteval-cyclictest.py-Remove-n-for-cyclictest-options.patch
Patch10: rteval-Explicitly-use-python3.patch
Patch11: rteval-2to3-transformations.patch
Patch12: rteval-setup.py-Open-byte-like-object.patch
Patch13: python-setup.py-Comment-out-os.unlink.patch
Patch14: rteval-Changes-for-python3-and-rt-tests-with-automat.patch
Patch15: rteval-fix-rtevalclient-import.patch
Patch16: rteval-remaining-time-fix.patch
Patch17: rteval-remove-unnecssary-encode.patch
Patch18: rtevalReport.py-Fix-time-format-in-report.patch
Patch19: rteval-Disable-options-for-remote-xmlrpc-server.patch
Patch20: rteval-Fix-typo-in-debug-output.patch
# Patches
Patch1: rteval-Check-whether-cpu-online-before-adding-to-list.patch
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
%description common
Common files used by rteval, rteval-xmlrpc and rteval-parser
@ -70,21 +58,6 @@ 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
# version sanity check (make sure specfile and rteval.py match)
#cp rteval/version.py rtevalversion.py
@ -134,11 +107,48 @@ rm -rf $RPM_BUILD_ROOT
%{python3_sitelib}/rteval/__pycache__/*
%changelog
* Mon Apr 02 2019 Clark Williams <williams@redhat.com> - 2.14.25
* Tue Dec 10 2019 John Kacur <jkacur@redhat.com> - 3.0-6
- Iterate over nodes and not sysTop
- Explictly add a few more software requires for compiling the kernel
Resolves: rhbz#1755603
* Tue Dec 03 2019 John Kacur <jkacur@redhat.com> - 3.0-5
- Explicitly add some software requires for compiling the kernel
Resolves: rhbz#1766879
* Mon Dec 02 2019 John Kacur <jkacur@redhat.com> - 3.0-4
- In hackbench.py node in args to Popen must be a string
Resolves: rhbz#1777048
* Tue Nov 19 2019 John Kacur <jkacur@redhat.com> - 3.0-3
- Don't assume cpu0 cannot be offlined, test for it
- Drop patches that are no longer in the spec file
Resolves: rhbz#1773792
* Mon Nov 18 2019 John Kacur <jkacur@redhat.com> - 3.0-2
- Check whether a cpu is online before adding to a list
- Change hackbench to use the systopology interface for online cpus
Resolves: rhbz#1715081
* Fri Nov 15 2019 John Kacur <jkacur@redhat.com> - 3.0-1
- Sync rt-tests and rteval-loads versions in the specfile
- Upgrade to upstream rteval-3.0
Resolves: rhbz#1748955
* Fri Nov 08 2019 John Kacur <jkacur@redhat.com> - 2.14-27
- Update kcompile sources to linux-5.1
Resolves: rhbz#1770215
* Fri Nov 08 2019 John Kacur <jkacur@redhat.com> - 2.14-26
- Fix number of hackbench jobs wrt number of CPUs
- Don't run on nodes with no CPUs available
Resolves: rhbz#1770211
* Tue Apr 02 2019 Clark Williams <williams@redhat.com> - 2.14.25
- fix incorrect test logic in gating tests
Resolves: rhbz#1682426
* Mon Apr 02 2019 Clark Williams <williams@redhat.com> - 2.14.24
* Tue Apr 02 2019 Clark Williams <williams@redhat.com> - 2.14.24
- add rteval-loads dependency to gating
- added second test (short_run) to gating
Resolves: rhbz#1682426