Skip to contentSkip to conversation

rteval: Cyclictest.py: Make standalone file work again

PATCH New John Kacur 1 participant 2 messages Apr 12, 2024

lore
Share & tools
lore

John Kacur

author
#0 lore raw

PATCH 1/2 rteval: Cyclictest.py: Make standalone file work again

Make standalone Cyclictest.py work again for testing purposes
- remove unused parse_cpulist_from_config
- Instead of "import as", use "from" and the requested functionality
- Obtain the default buckets from the ModuleParameters to use if a number is not otherwise provided
- set the cpulist to "" if not otherwise provided
- add a few docstrings to functions
- obtain a default cpulist from online_cpus for the standalone test

---
 rteval/modules/measurement/cyclictest.py | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
rteval/modules/measurement/cyclictest.py +8 -11
index 722422589d62..671426e13c4d 100644
@@ -16,10 +16,8 @@ import math
 import libxml2
 from rteval.Log import Log
 from rteval.modules import rtevalModulePrototype
-from rteval.systopology import cpuinfo, parse_cpulist_from_config
-import rteval.cpulist_utils as cpulist_utils
-
-expand_cpulist = cpulist_utils.expand_cpulist
+from rteval.systopology import cpuinfo, SysTopology
+from rteval.cpulist_utils import expand_cpulist, collapse_cpulist
 
 class RunData:
     '''class to keep instance data from a cyclictest run'''
@@ -190,10 +188,11 @@ class Cyclictest(rtevalModulePrototype):
         # Create a RunData object per CPU core
         self.__numanodes = int(self.__cfg.setdefault('numanodes', 0))
         self.__priority = int(self.__cfg.setdefault('priority', 95))
-        self.__buckets = int(self.__cfg.setdefault('buckets', 2000))
+        default_buckets = ModuleParameters()["buckets"]["default"]
+        self.__buckets = int(self.__cfg.setdefault('buckets', default_buckets))
         self.__numcores = 0
         self.__cyclicdata = {}
-        self.__cpulist = self.__cfg.cpulist
+        self.__cpulist = self.__cfg.setdefault('cpulist', "")
         self.__cpus = [str(c) for c in expand_cpulist(self.__cpulist)]
         self.__numcores = len(self.__cpus)
 
@@ -393,14 +392,13 @@ class Cyclictest(rtevalModulePrototype):
         return rep_n
 
 
-
 def ModuleInfo():
     return {"parallel": True,
             "loads": True}
 
 
-
 def ModuleParameters():
+    """ default parameters """
     return {"interval": {"descr": "Base interval of the threads in microseconds",
                          "default": 100,
                          "metavar": "INTV_US"},
@@ -421,6 +419,7 @@ def ModuleParameters():
 
 
 def create(params, logger):
+    """ Instantiate a Cyclictest measurement module object """
     return Cyclictest(params, logger)
 
 
@@ -438,9 +437,7 @@ if __name__ == '__main__':
     cfg.AppendConfig('cyclictest', prms)
 
     cfg_ct = cfg.GetSection('cyclictest')
-    cfg_ct.reportdir = "."
-    cfg_ct.buckets = 200
-    # cfg_ct.breaktrace = 30
+    cfg_ct.cpulist = collapse_cpulist(SysTopology().online_cpus())
 
     runtime = 10
 
Signature · 1 line
2.44.0
author
#1 lore raw

PATCH 2/2 rteval: Add rtla timerlat as a measurement module

This is the first step to adding timerlat as a measurement module With this change you can run timerlat as a standalone rteval file like this (as root)

python rteval/modules/measurement/timerlat.py

You can also modify your rteval.conf to list timerlat in the [measurement] section, for example like this

[measurement]
cyclictest: module
timerlat: module

and then both measurement moduels will be run from rteval, for example

rteval -D -d5m --measurement-cpulist=1-5

Will run rteval with Debug info, for 5m and cyclictest and timerlat will run on cpus 1-5 and load modules will run on the other available cpus.

Currently MakeReport just prints to standard out the same information that timerlat outputs, in otherwords, there is no processing into xml yet. Also, there is no way to invoke tracing at the time, but that will be added soon!

---
 rteval-cmd                             |   1 +
 rteval/modules/measurement/timerlat.py | 131 +++++++++++++++++++++++++
 2 files changed, 132 insertions(+)
 create mode 100644 rteval/modules/measurement/timerlat.py
rteval-cmd +1 -0
index c72bc614ad78..5cb6d7a44523 100755
@@ -247,6 +247,7 @@ if __name__ == '__main__':
             if not config.HasSection('measurement'):
                 config.AppendConfig('measurement', {
                     'cyclictest' : 'module',
+                    'timerlat' : 'module',
                     'sysstat' : 'module'})
 
         # Prepare log levels before loading modules, not to have unwanted log messages
rteval/modules/measurement/timerlat.py new file +131 -0

131 lines not on this page · raw message

Signature · 1 line
2.44.0