rt-tests commit 0b90cbbfc5 ("cyclictest: only print non-zero values in histogram output") changed the output format of cyclictest: all-zero lines are now dropped, as they are superfluous. cyclictest.py relied on the structure and is unhappy with the new format. keys is a sorted list of latencies -- simply reverse it and search for the highest non-zero value. This works for both, the new and the old output format of cyclictest. Additionally, rename the index variable. In fact, the index represents the latency, so call it latency. Signed-off-by: Ralf Ramsauer <ralf.ramsauer@xxxxxxxxxxxxxxxxx> --- rteval/modules/measurement/cyclictest.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py index 04f78d1..ae95a7b 100644 --- a/rteval/modules/measurement/cyclictest.py +++ b/rteval/modules/measurement/cyclictest.py @@ -113,9 +113,12 @@ class RunData(object): if self.__samples[i]: low = i break - high = keys[-1] - while high and self.__samples[high] == 0: - high -= 1 + + for i in reversed(keys): + if self.__samples[i]: + high = i + break + self.__range = high - low # Mean Absolute Deviation and standard deviation @@ -343,14 +346,14 @@ class Cyclictest(rtevalModulePrototype): continue try: - index = int(vals[0]) + latency = int(vals[0]) except: self._log(Log.DEBUG, "cyclictest: unexpected output: %s" % line) continue - for i,core in enumerate(self.__cpus): - self.__cyclicdata[core].bucket(index, int(vals[i+1])) - self.__cyclicdata['system'].bucket(index, int(vals[i+1])) + for i, core in enumerate(self.__cpus): + self.__cyclicdata[core].bucket(latency, int(vals[i+1])) + self.__cyclicdata['system'].bucket(latency, int(vals[i+1])) # generate statistics for each RunData object for n in self.__cyclicdata.keys(): -- 2.19.0