diff mbox series

[2/2] rteval: run cyclictest using '--default-system' when setting idle states

Message ID 20240715182035.191318-2-ashelat@redhat.com
State Superseded
Headers show
Series [1/2] rteval: Added functionality to allow user to set the cstate of specified cpus when running rteval | expand

Commit Message

Anubhav Shelat July 15, 2024, 6:20 p.m. UTC
When running cyclictest in rteval, cyclictest automatically disables
idle states. This means whenever the user sets the idle state of a cpu
list using '--idle-set' it is overridden by cyclictest.

To fix this, the variable 'usingCpupower' is appended to the parameter
dictionary that's passed to the Cyclictest measurement object which executes
cyclictest in rteval.

If '--idle-set' is specified when running rteval,
'usingCpupower' is set to true and the '--default-system' option is
appended to the cyclictest command, which will prevent cyclictest from
disabling cstates.

Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
---
 rteval-cmd                               | 3 +++
 rteval/__init__.py                       | 1 +
 rteval/modules/measurement/cyclictest.py | 3 +++
 3 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/rteval-cmd b/rteval-cmd
index d9bf16838b6d..f96772c7027e 100755
--- a/rteval-cmd
+++ b/rteval-cmd
@@ -268,6 +268,9 @@  if __name__ == '__main__':
                 | (rtevcfg.debugging and Log.DEBUG)
         logger.SetLogVerbosity(loglev)
 
+        # check if cpupower is being used
+        if sys.argv.count('--idle-set') > 0:
+            rtevcfg.update({'usingCpupower': True})
         # Load modules
         loadmods = LoadModules(config, logger=logger)
         measuremods = MeasurementModules(config, logger=logger)
diff --git a/rteval/__init__.py b/rteval/__init__.py
index 1a61148ef327..ad3de3a04b97 100644
--- a/rteval/__init__.py
+++ b/rteval/__init__.py
@@ -123,6 +123,7 @@  class RtEval(rtevalReport):
                   'memsize':self._sysinfo.mem_get_size(),
                   'numanodes':self._sysinfo.mem_get_numa_nodes(),
                   'duration': float(self.__rtevcfg.duration),
+                  'usingCpupower': self.__rtevcfg.usingCpupower
                   }
         self._loadmods.Setup(params)
 
diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
index 3301e1b45e11..80c75d6e857c 100644
--- a/rteval/modules/measurement/cyclictest.py
+++ b/rteval/modules/measurement/cyclictest.py
@@ -250,6 +250,9 @@  class Cyclictest(rtevalModulePrototype):
         self.__cmd.append(f'-t{self.__numcores}')
         self.__cmd.append(f'-a{self.__cpulist}')
 
+        if (self.__cfg.usingCpupower):
+            self.__cmd.append('--default-system')
+
         if 'threads' in self.__cfg and self.__cfg.threads:
             self.__cmd.append(f"-t{int(self.__cfg.threads)}")