From: Punit Agrawal <punitagrawal@gmail.com>
To: jkacur@redhat.com
Cc: Punit Agrawal <punitagrawal@gmail.com>,
linux-rt-users@vger.kernel.org, punit1.agrawal@toshiba.co.jp,
Venkata.Pyla@toshiba-tsip.com, dinesh.kumar@toshiba-tsip.com
Subject: [PATCH 2/3] rteval: cyclictest.py Parse max latencies from cyclictest ouput
Date: Thu, 2 Sep 2021 18:24:51 +0900 [thread overview]
Message-ID: <20210902092452.726905-3-punitagrawal@gmail.com> (raw)
In-Reply-To: <20210902092452.726905-1-punitagrawal@gmail.com>
When collecting a histogram of latencies, "cyclictest" reports the
maximum latency encountered on each core even if they fall outside the
configured no. of buckets. This can be useful to understand the worst
case latencies for the run as well as right sizing the number of
buckets for the histogram.
While processing the output of cyclictest, rteval skips the reported
max latencies and calculates them by capping to the no. of buckets.
Fix rteval by parsing the maximum latencies reported by cyclictest.
Signed-off-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
---
rteval/modules/measurement/cyclictest.py | 31 +++++++++++++++++++-----
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
index 0037c3ad07bd..67a2eab21d7c 100644
--- a/rteval/modules/measurement/cyclictest.py
+++ b/rteval/modules/measurement/cyclictest.py
@@ -67,20 +67,25 @@ class RunData:
retval += "mean: %f\n" % self.__mean
return retval
- def sample(self, value):
- self.__samples[value] += self.__samples.setdefault(value, 0) + 1
+ def update_max(self, value):
if value > self.__max:
self.__max = value
+
+ def update_min(self, value):
if value < self.__min:
self.__min = value
+
+ def sample(self, value):
+ self.__samples[value] += self.__samples.setdefault(value, 0) + 1
+ self.update_max(value)
+ self.update_min(value)
self.__numsamples += 1
def bucket(self, index, value):
self.__samples[index] = self.__samples.setdefault(index, 0) + value
- if value and index > self.__max:
- self.__max = index
- if value and index < self.__min:
- self.__min = index
+ if value:
+ self.update_max(index)
+ self.update_min(index)
self.__numsamples += value
def reduce(self):
@@ -328,6 +333,18 @@ class Cyclictest(rtevalModulePrototype):
return False
+ def _parse_max_latencies(self, line):
+ if not line.startswith('# Max Latencies: '):
+ return
+
+ line = line.split(':')[1]
+ vals = [int(x) for x in line.split()]
+
+ for i, core in enumerate(self.__cpus):
+ self.__cyclicdata[core].update_max(vals[i])
+ self.__cyclicdata['system'].update_max(vals[i])
+
+
def _WorkloadCleanup(self):
if not self.__started:
return
@@ -344,6 +361,8 @@ class Cyclictest(rtevalModulePrototype):
# Catch if cyclictest stopped due to a breaktrace
if line.startswith('# Break value: '):
self.__breaktraceval = int(line.split(':')[1])
+ elif line.startswith('# Max Latencies: '):
+ self._parse_max_latencies(line)
continue
# Skipping blank lines
--
2.32.0
next prev parent reply other threads:[~2021-09-02 9:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 9:24 [PATCH 0/3] rteval: Fix issues with cyclictest.py module Punit Agrawal
2021-09-02 9:24 ` [PATCH 1/3] rteval: cyclictest.py Enable logging cyclictest output Punit Agrawal
2021-09-12 15:03 ` John Kacur
2021-09-02 9:24 ` Punit Agrawal [this message]
2021-09-02 9:24 ` [PATCH 3/3] rteval: misc.py: Sort the list of cpus returned by online_cpus() Punit Agrawal
2021-09-12 15:39 ` John Kacur
2021-09-08 14:19 ` [PATCH 0/3] rteval: Fix issues with cyclictest.py module Punit Agrawal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210902092452.726905-3-punitagrawal@gmail.com \
--to=punitagrawal@gmail.com \
--cc=Venkata.Pyla@toshiba-tsip.com \
--cc=dinesh.kumar@toshiba-tsip.com \
--cc=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=punit1.agrawal@toshiba.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).