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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>
---
 rteval/modules/measurement/cyclictest.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
index 4ca310bf7490..8fdd5341794a 100644
--- a/rteval/modules/measurement/cyclictest.py
+++ b/rteval/modules/measurement/cyclictest.py
@@ -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)
-- 
2.34.1




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux