hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/tools/perf/scripts/python/stat-cpi.py
....@@ -1,5 +1,6 @@
1
-#!/usr/bin/env python
21 # SPDX-License-Identifier: GPL-2.0
2
+
3
+from __future__ import print_function
34
45 data = {}
56 times = []
....@@ -20,8 +21,8 @@
2021 threads.append(thread)
2122
2223 def store(time, event, cpu, thread, val, ena, run):
23
- #print "event %s cpu %d, thread %d, time %d, val %d, ena %d, run %d" % \
24
- # (event, cpu, thread, time, val, ena, run)
24
+ #print("event %s cpu %d, thread %d, time %d, val %d, ena %d, run %d" %
25
+ # (event, cpu, thread, time, val, ena, run))
2526
2627 store_key(time, cpu, thread)
2728 key = get_key(time, event, cpu, thread)
....@@ -59,7 +60,7 @@
5960 if ins != 0:
6061 cpi = cyc/float(ins)
6162
62
- print "%15f: cpu %d, thread %d -> cpi %f (%d/%d)" % (time/(float(1000000000)), cpu, thread, cpi, cyc, ins)
63
+ print("%15f: cpu %d, thread %d -> cpi %f (%d/%d)" % (time/(float(1000000000)), cpu, thread, cpi, cyc, ins))
6364
6465 def trace_end():
6566 pass
....@@ -75,4 +76,4 @@
7576 # if ins != 0:
7677 # cpi = cyc/float(ins)
7778 #
78
-# print "time %.9f, cpu %d, thread %d -> cpi %f" % (time/(float(1000000000)), cpu, thread, cpi)
79
+# print("time %.9f, cpu %d, thread %d -> cpi %f" % (time/(float(1000000000)), cpu, thread, cpi))