From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
"Arnaldo Carvalho de Melo" <acme@redhat.com>,
"Adrian Hunter" <adrian.hunter@intel.com>,
"David Ahern" <dsahern@gmail.com>,
"Jaroslav Škarvada" <jskarvad@redhat.com>,
"Jiri Olsa" <jolsa@kernel.org>,
"Namhyung Kim" <namhyung@kernel.org>,
"Wang Nan" <wangnan0@huawei.com>
Subject: [PATCH 4/5] perf python: Make twatch.py work with both python2 and python3
Date: Tue, 20 Feb 2018 22:34:30 -0300 [thread overview]
Message-ID: <20180221013431.11738-5-acme@kernel.org> (raw)
In-Reply-To: <20180221013431.11738-1-acme@kernel.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
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 c235c22b107a..0a29c5c3079f 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__':
"""
--
2.14.3
next prev parent reply other threads:[~2018-02-21 1:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-21 1:34 [GIT PULL 0/5] perf/core improvements and fixes Arnaldo Carvalho de Melo
2018-02-21 1:34 ` [PATCH 1/5] perf s390: Fix reading cpuid model information Arnaldo Carvalho de Melo
2018-02-21 1:34 ` [PATCH 2/5] perf machine: Fix paranoid check in machine__set_kernel_mmap() Arnaldo Carvalho de Melo
2018-02-21 1:34 ` [PATCH 3/5] perf ftrace: Append an EOL when write tracing files Arnaldo Carvalho de Melo
2018-02-21 1:34 ` Arnaldo Carvalho de Melo [this message]
2018-02-21 1:34 ` [PATCH 5/5] perf tools: Add Python 3 support Arnaldo Carvalho de Melo
2018-02-21 7:52 ` [GIT PULL 0/5] perf/core improvements and fixes Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180221013431.11738-5-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=jskarvad@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).