Skip to content

Commit d2ed5d2

Browse files
committed
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. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jaroslav Škarvada <jskarvad@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-c2ynv0ozr3eifzsyit6qgh3h@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 63cd02d commit d2ed5d2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎tools/perf/python/twatch.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ def main(context_switch = 0, thread = -1):
4242
event = evlist.read_on_cpu(cpu)
4343
if not event:
4444
continue
45-
print "cpu: %2d, pid: %4d, tid: %4d" % (event.sample_cpu,
46-
event.sample_pid,
47-
event.sample_tid),
48-
print event
45+
print("cpu: {0}, pid: {1}, tid: {2} {3}".format(event.sample_cpu,
46+
event.sample_pid,
47+
event.sample_tid,
48+
event))
4949

5050
if __name__ == '__main__':
5151
"""

0 commit comments

Comments
 (0)