From: John Kacur <jkacur@redhat.com>
To: RT <linux-rt-users@vger.kernel.org>
Cc: Clark Williams <williams@redhat.com>,
Kate Carcia Poulin <kcarcia@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
Daniel Bristot de Oliveria <bristot@redhat.com>,
John Kacur <jkacur@redhat.com>
Subject: [PATCH 1/2] rteval: Cyclictest.py: Make standalone file work again
Date: Fri, 12 Apr 2024 14:50:51 -0400 [thread overview]
Message-ID: <20240412185052.87056-1-jkacur@redhat.com> (raw)
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
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/modules/measurement/cyclictest.py | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
index 722422589d62..671426e13c4d 100644
--- a/rteval/modules/measurement/cyclictest.py
+++ b/rteval/modules/measurement/cyclictest.py
@@ -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
--
2.44.0
next reply other threads:[~2024-04-12 18:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 18:50 John Kacur [this message]
2024-04-12 18:50 ` [PATCH 2/2] rteval: Add rtla timerlat as a measurement module John Kacur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240412185052.87056-1-jkacur@redhat.com \
--to=jkacur@redhat.com \
--cc=bristot@redhat.com \
--cc=juri.lelli@redhat.com \
--cc=kcarcia@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).