mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [tip:perf/core] perf python: Make twatch.py work with both python2 and python3
@ 2018-02-21 10:26 tip-bot for Arnaldo Carvalho de Melo
  0 siblings, 0 replies; only message in thread
From: tip-bot for Arnaldo Carvalho de Melo @ 2018-02-21 10:26 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, acme, adrian.hunter, wangnan0, namhyung, jolsa, dsahern,
	jskarvad, hpa, tglx, linux-kernel

Commit-ID:  d2ed5d2bdc5cd30b44dc52c44c63f08c0a31b845
Gitweb:     https://git.kernel.org/tip/d2ed5d2bdc5cd30b44dc52c44c63f08c0a31b845
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Mon, 19 Feb 2018 12:24:13 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 19 Feb 2018 12:28:08 -0300

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>
---
 tools/perf/python/twatch.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/python/twatch.py b/tools/perf/python/twatch.py
index c235c22..0a29c5c 100755
--- a/tools/perf/python/twatch.py
+++ b/tools/perf/python/twatch.py
@@ -42,10 +42,10 @@ def main(context_switch = 0, thread = -1):
 			event = evlist.read_on_cpu(cpu)
 			if not event:
 				continue
-			print "cpu: %2d, pid: %4d, tid: %4d" % (event.sample_cpu,
-								event.sample_pid,
-								event.sample_tid),
-			print event
+			print("cpu: {0}, pid: {1}, tid: {2} {3}".format(event.sample_cpu,
+                                                                        event.sample_pid,
+                                                                        event.sample_tid,
+                                                                        event))
 
 if __name__ == '__main__':
     """

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-21 10:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-21 10:26 [tip:perf/core] perf python: Make twatch.py work with both python2 and python3 tip-bot for Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome