From 7818ecdae095722a6b5aed3a309bb9f5e71bf508 Mon Sep 17 00:00:00 2001 From: John Kacur Date: Thu, 18 Aug 2016 11:05:30 -0400 Subject: rt-tests: hwlatdetect: Improve message if max latency is below threshold Improve message if max latency is below threshold. If the maximum latency is below the threshold for reporting, 0us is output. This is confusing, and not accurate, so print the message "Below threshold" instead. Suggested-by: Jiri Kastner Signed-off-by: John Kacur --- src/hwlatdetect/hwlatdetect.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py index d9ef027..4a01434 100755 --- a/src/hwlatdetect/hwlatdetect.py +++ b/src/hwlatdetect/hwlatdetect.py @@ -568,9 +568,15 @@ if __name__ == '__main__': info("test finished") - exceeding = detect.get("count") - info("Max Latency: %dus" % detect.get("max")) + max_latency = detect.get("max") + if max_latency == 0: + info("Max Latency: Below threshold") + else: + info("Max Latency: %dus" % max_latency) + info("Samples recorded: %d" % len(detect.samples)) + + exceeding = detect.get("count") info("Samples exceeding threshold: %d" % exceeding) if detect.have_msr: -- cgit 1.2.3-korg