summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2009-06-30 13:36:06 -0500
committerClark Williams <williams@redhat.com>2009-06-30 13:36:06 -0500
commitf247fd753a307b0ceae7941a282a93ccc614f529 (patch)
treebeca0494212079a54bb68bb17bcc0805e514c9df
parent803a41737827db85a89b8ae3822c3a1c7b64916b (diff)
downloadrt-tests-f247fd753a307b0ceae7941a282a93ccc614f529.tar.gz
rt-tests-f247fd753a307b0ceae7941a282a93ccc614f529.tar.xz
added code to resize window/width when setting the other to a smaller value
-rwxr-xr-xsrc/hwlatdetect/hwlatdetect.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py
index dacf884..e7c2fe1 100755
--- a/src/hwlatdetect/hwlatdetect.py
+++ b/src/hwlatdetect/hwlatdetect.py
@@ -312,12 +312,18 @@ if __name__ == '__main__':
if o.window:
w = microseconds(o.window)
+ if w < hwlat.get("width"):
+ debug("shrinking width to %d for new window of %d" % (w/2, w))
+ hwlat.set("width", w/2)
debug("window parameter = %d" % w)
hwlat.set("window", w)
debug("window for sampling set to %dus" % w)
if o.width:
w = microseconds(o.width)
+ if w > hwlat.get("window"):
+ debug("widening window to %d for new width of %d" % (w*2, w))
+ hwlat.set("window", w*2)
debug("width parameter = %d" % w)
hwlat.set("width", w)
debug("sample width set to %dus" % w)