summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2016-01-05 21:50:59 -0600
committerJohn Kacur <jkacur@redhat.com>2016-01-13 15:29:40 +0100
commitd7d6d35b157c7d580c3f6e00279e0a9ec7e63f9d (patch)
tree1423c594688f01908d7e5542f39d25221e16806c
parentbbd5a22182f23d73a7930773d4cd562fae8dd4cd (diff)
downloadrt-tests-d7d6d35b157c7d580c3f6e00279e0a9ec7e63f9d.tar.gz
rt-tests-d7d6d35b157c7d580c3f6e00279e0a9ec7e63f9d.tar.xz
hwlatdetect: modify to handle python3 prints
Use __future__ import of print_function and make sure all instances of print are now functions rather than statements. Signed-off-by: Clark Williams <williams@redhat.com> Signed-off-by: John Kacur <jkacur@redhat.com>
-rwxr-xr-xsrc/hwlatdetect/hwlatdetect.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py
index 2a1c562..c8c86ad 100755
--- a/src/hwlatdetect/hwlatdetect.py
+++ b/src/hwlatdetect/hwlatdetect.py
@@ -7,6 +7,8 @@
# modify it under the terms of the GNU General Public License Version 2
# as published by the Free Software Foundation.
+from __future__ import print_function
+
import sys
import os
import time
@@ -295,7 +297,7 @@ class Hwlat(object):
while val:
val = val.strip()
self.samples.append(val)
- if watch: print val
+ if watch: print(val)
debug("got a latency sample: %s" % val)
val = self.get_sample()
time.sleep(0.1)
@@ -391,7 +393,7 @@ class Smi(object):
val = val.strip()
if int(val) >= threshold:
self.samples.append(val)
- if watch: print val
+ if watch: print(val)
debug("got a latency sample: %s (threshold: %d)" % (val, self.get("threshold")))
time.sleep(0.1)
except KeyboardInterrupt as e:
@@ -572,7 +574,7 @@ if __name__ == '__main__':
if count > detect.initsmi[i]:
smis = count - detect.initsmi[i]
total_smis += smis
- print "%d SMIs occured on cpu %d" % (smis, i)
+ print("%d SMIs occured on cpu %d" % (smis, i))
info("SMIs during run: %d" % total_smis)
if reportfile: