Skip to contentSkip to conversation

rteval: If the user doesn't specify a cpumask, use the inherited one

PATCH New John Kacur 1 participant 1 message Feb 15, 2022

lore
Share & tools
lore

John Kacur

author
#0 lore raw

PATCH 1/1 rteval: If the user doesn't specify a cpumask, use the inherited one

If the user doesn't specify a cpumask, then we need to use the inherited one to match what cyclictest currently does

---
 rteval/modules/measurement/cyclictest.py | 6 ++++++
 1 file changed, 6 insertions(+)
rteval/modules/measurement/cyclictest.py +6 -0
index 4ca310bf7490..8fdd5341794a 100644
@@ -216,6 +216,12 @@ class Cyclictest(rtevalModulePrototype):
             self.__sparse = True
         else:
             self.__cpus = online_cpus()
+            # Get the cpuset from the environment
+            cpuset = os.sched_getaffinity(0)
+            # Convert the elements to strings
+            cpuset = [str(c) for c in cpuset]
+            # Only include cpus that are in the cpuset
+            self.__cpus = [c for c in self.__cpus if c in cpuset]
 
         # Sort the list of cpus to align with the order reported by cyclictest
         self.__cpus.sort(key=int)
Signature · 1 line
2.34.1