rteval/rteval-cyclictest.py-Sort-t...

47 lines
1.7 KiB
Diff

From 8240a34f22c09151501ec1fa2ae76cdad057f9e5 Mon Sep 17 00:00:00 2001
From: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
Date: Mon, 18 Oct 2021 14:57:35 +0900
Subject: [PATCH 2/6] rteval: cyclictest.py: Sort the list of cpus
online_cpus() returns a list of online cpus in arbitrary order. e.g.,
on a hexacore system it returns -
['5', '3', '1', '4', '2', '0']
Generally this wouldn't be a problem but the cyclictest.py module
matches the unsorted list with the latencies output by "cyclictest"
which are ordered by core number. This leads to incorrect reporting of
per-core latencies in the final report generated by rteval. The issue
was noticed when comparing the rteval report with cyclictest logs
(enabled by a recent change).
Fix the inconsistency in core numbering by sorting the list of cpus
used by cyclictest.py module. As the cpus are represented as a string,
sort with the integer key to avoid issues on systems with large number
of cores.
Signed-off-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/modules/measurement/cyclictest.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
index f79949faf031..e459c1839865 100644
--- a/rteval/modules/measurement/cyclictest.py
+++ b/rteval/modules/measurement/cyclictest.py
@@ -214,6 +214,10 @@ class Cyclictest(rtevalModulePrototype):
else:
self.__cpus = online_cpus()
+ # Sort the list of cpus to align with the order reported by
+ # cyclictest
+ self.__cpus.sort(key=int)
+
# Get the cpuset from the environment
cpuset = os.sched_getaffinity(0)
--
2.31.1