History

perf python: Make twatch.py work with both python2 and python3

Will be used to test patches allowing to build perf with python3, so that we make sure that we can build with both versions.

Arnaldo Carvalho de Melo committed 8 years ago

Commit d2ed5d21 parent 63cd02d1 file · +4 −4Browse files

Showing the changes to tools/perf/python (1 of 1 file). Show all

Unified · Split

tools/perf/python/twatch.py+4−4
@@ -42,10 +42,10 @@ def main(context_switch = 0, thread = -1): · 41 unmodified lines
42 event = evlist.read_on_cpu(cpu)42 event = evlist.read_on_cpu(cpu)
43 if not event:43 if not event:
44 continue44 continue
45 print "cpu: %2d, pid: %4d, tid: %4d" % (event.sample_cpu,45 print("cpu: {0}, pid: {1}, tid: {2} {3}".format(event.sample_cpu,
46 event.sample_pid,46 event.sample_pid,
47 event.sample_tid),47 event.sample_tid,
48 print event48 event))
49 49
50if __name__ == '__main__':50if __name__ == '__main__':
51 """51 """