Skip to contentSkip to conversation

rteval: Fix -aNone being passed to cyclictest

PATCH In review [email protected] 2 participants 2 messages Jun 11, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rteval: Fix -aNone being passed to cyclictest

From: Tomas Glozar <[email protected]>

When rteval is called via the command line, cpulists for both measurements and loads default to an empty string and are further processed by parse_cpulist_from_config. However, this is not true when rteval is used as a module: in that case, neither the default command-line value is used nor parse_cpulist_from_config is run, leading to None being set to the config property of measurements which is explicitely passed down to the corresponding cyclictest config property.

After 64ce7848dfab ("rteval: Add relative cpulists for measurements"), where the check for None was removed from the cyclictest module, rteval passes "-aNone" to cyclictest when being used as a module.

Call parse_cpulist_from_config with an empty string to get the default cpulist to pass to cyclictest module if cpulist is empty in the measurement config.

Fixes 64ce7848dfab ("rteval: Add relative cpulists for measurements")
---
 rteval/modules/measurement/__init__.py | 3 +++
 1 file changed, 3 insertions(+)
rteval/modules/measurement/__init__.py +3 -0
index 11bd7b0..43c0fda 100644
@@ -148,6 +148,9 @@ measurement profiles, based on their characteristics"""
         modcfg = self.__cfg.GetSection("measurement")
         cpulist = modcfg.cpulist
         run_on_isolcpus = modcfg.run_on_isolcpus
+        if cpulist is None:
+            # Get default cpulist value
+            cpulist = cpulist_utils.collapse_cpulist(parse_cpulist_from_config("", run_on_isolcpus))
 
         for (modname, modtype) in modcfg:
             if isinstance(modtype, str) and modtype.lower() == 'module':  # Only 'module' will be supported (ds)
Signature · 1 line
2.45.0
#1 lore raw
Quoted 30 lines · On Tue, 11 Jun 2024, [email protected] wrote:

From: Tomas Glozar <[email protected]>

When rteval is called via the command line, cpulists for both measurements and loads default to an empty string and are further processed by parse_cpulist_from_config. However, this is not true when rteval is used as a module: in that case, neither the default command-line value is used nor parse_cpulist_from_config is run, leading to None being set to the config property of measurements which is explicitely passed down to the corresponding cyclictest config property.

After 64ce7848dfab ("rteval: Add relative cpulists for measurements"), where the check for None was removed from the cyclictest module, rteval passes "-aNone" to cyclictest when being used as a module.

Call parse_cpulist_from_config with an empty string to get the default cpulist to pass to cyclictest module if cpulist is empty in the measurement config.

Fixes 64ce7848dfab ("rteval: Add relative cpulists for measurements")
---
 rteval/modules/measurement/__init__.py | 3 +++
 1 file changed, 3 insertions(+)
rteval/modules/measurement/__init__.py +0 -0
index 11bd7b0..43c0fda 100644

rteval/modules/measurement/__init__.py measurement profiles, based on their characteristics""" · line 156

Quoted 9 lines
rteval/modules/measurement/__init__.py +3 -0
@@ -148,6 +148,9 @@ measurement profiles, based on their characteristics"""
         modcfg = self.__cfg.GetSection("measurement")
         cpulist = modcfg.cpulist
         run_on_isolcpus = modcfg.run_on_isolcpus
+        if cpulist is None:
+            # Get default cpulist value
+            cpulist = cpulist_utils.collapse_cpulist(parse_cpulist_from_config("", run_on_isolcpus))
 
         for (modname, modtype) in modcfg:
             if isinstance(modtype, str) and modtype.lower() == 'module':  # Only 'module' will be supported (ds)