diff options
-rwxr-xr-x | src/hwlatdetect/hwlatdetect.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py index 4a01434..e08c798 100755 --- a/src/hwlatdetect/hwlatdetect.py +++ b/src/hwlatdetect/hwlatdetect.py @@ -474,6 +474,10 @@ if __name__ == '__main__': dest="threshold", help="value above which is considered an hardware latency") + parser.add_option("--hardlimit", default=None, type="string", + dest="hardlimit", + help="value above which the test is considered to fail") + parser.add_option("--window", default=None, type="string", dest="window", help="time between samples") @@ -526,6 +530,12 @@ if __name__ == '__main__': detect.set("threshold", t) debug("threshold set to %dus" % t) + if o.hardlimit: + hardlimit = microseconds(o.hardlimit) + else: + hardlimit = detect.get("threshold") + debug("hardlimit set to %dus" % hardlimit) + if o.window: w = microseconds(o.window) if w < detect.get("width"): @@ -601,5 +611,6 @@ if __name__ == '__main__': for s in detect.samples: print("%s" % s) + maxlatency = int(detect.get("max")) detect.cleanup() - sys.exit(exceeding) + sys.exit(maxlatency > hardlimit) |