All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rteval: Add --cyclictest-threshold=USEC
@ 2022-01-12 16:11 John Kacur
  0 siblings, 0 replies; only message in thread
From: John Kacur @ 2022-01-12 16:11 UTC (permalink / raw)
  To: RT; +Cc: Clark Williams, John Kacur

Add --cyclictest-threshold=USEC
This option causes rteval to exit if latency is greater than USEC

This is similar to --cyclictest-breaktrace=USEC
and uses the --breaktrace option to cyclictest

The difference is that --cyclictest-threshold does NOT write a tracemark
when the latency is exceeded

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 rteval/modules/measurement/cyclictest.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
index c094df499403..cc74b467913d 100644
--- a/rteval/modules/measurement/cyclictest.py
+++ b/rteval/modules/measurement/cyclictest.py
@@ -295,9 +295,12 @@ class Cyclictest(rtevalModulePrototype):
         if 'threads' in self.__cfg and self.__cfg.threads:
             self.__cmd.append("-t%d" % int(self.__cfg.threads))
 
+        # Should have either breaktrace or threshold, not both
         if 'breaktrace' in self.__cfg and self.__cfg.breaktrace:
             self.__cmd.append("-b%d" % int(self.__cfg.breaktrace))
             self.__cmd.append("--tracemark")
+        elif 'threshold' in self.__cfg and self.__cfg.threshold:
+            self.__cmd.append("-b%d" % int(self.__cfg.threshold))
 
         # Buffer for cyclictest data written to stdout
         self.__cyclicoutput = tempfile.SpooledTemporaryFile(mode='w+b')
@@ -411,7 +414,7 @@ class Cyclictest(rtevalModulePrototype):
         if self.__breaktraceval:
             abrt_n.newProp('reason', 'breaktrace')
             btv_n = abrt_n.newChild(None, 'breaktrace', None)
-            btv_n.newProp('latency_threshold', str(self.__cfg.breaktrace))
+            btv_n.newProp('latency_threshold', str(self.__cfg.breaktrace) if self.__cfg.breaktrace else str(self.__cfg.threshold))
             btv_n.newProp('measured_latency', str(self.__breaktraceval))
             abrt = True
 
@@ -454,7 +457,10 @@ def ModuleParameters():
                          "metavar": "PRIO"},
             "breaktrace": {"descr": "Send a break trace command when latency > USEC",
                            "default": None,
-                           "metavar": "USEC"}
+                           "metavar": "USEC"},
+            "threshold": {"descr": "Exit rteval if latency > USEC",
+                          "default": None,
+                          "metavar": "USEC"}
             }
 
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-12 16:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 16:11 [PATCH] rteval: Add --cyclictest-threshold=USEC John Kacur

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.