LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jeremy Cline <jeremy@jcline.org>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
"Herton R . Krzesinski" <herton@redhat.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Jeremy Cline <jeremy@jcline.org>
Subject: [PATCH 7/8] perf scripts python: Add Python 3 support to stat-cpi.py
Date: Tue, 8 May 2018 21:27:51 +0000 [thread overview]
Message-ID: <0100016341a74569-b9ac2ac6-f99b-41ed-be0d-f7cb3c69e6de-000000@email.amazonses.com> (raw)
In-Reply-To: <cover.1525811971.git.jeremy@jcline.org>
Support both Python 2 and Python 3 in stat-cpi.py. This should have no
functional change.
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
---
tools/perf/scripts/python/stat-cpi.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/perf/scripts/python/stat-cpi.py b/tools/perf/scripts/python/stat-cpi.py
index 8410672efb8b..fc53a03da412 100644
--- a/tools/perf/scripts/python/stat-cpi.py
+++ b/tools/perf/scripts/python/stat-cpi.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# SPDX-License-Identifier: GPL-2.0
+from __future__ import print_function
+
data = {}
times = []
threads = []
@@ -59,7 +61,8 @@ def stat__interval(time):
if ins != 0:
cpi = cyc/float(ins)
- print "%15f: cpu %d, thread %d -> cpi %f (%d/%d)" % (time/(float(1000000000)), cpu, thread, cpi, cyc, ins)
+ print("%15f: cpu %d, thread %d -> cpi %f (%d/%d)" %
+ (time/(float(1000000000)), cpu, thread, cpi, cyc, ins))
def trace_end():
pass
--
2.17.0
prev parent reply other threads:[~2018-05-08 21:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1525811971.git.jeremy@jcline.org>
2018-05-08 21:27 ` [PATCH 1/8] perf tools: Generate a Python script compatible with Python 2 and 3 Jeremy Cline
2018-07-12 13:57 ` [tip:perf/urgent] " tip-bot for Jeremy Cline
2018-05-08 21:27 ` [PATCH 3/8] perf scripts python: Add Python 3 support to SchedGui.py Jeremy Cline
2018-07-12 13:58 ` [tip:perf/urgent] " tip-bot for Jeremy Cline
2018-05-08 21:27 ` [PATCH 2/8] perf scripts python: Add Python 3 support to Core.py Jeremy Cline
2018-07-12 13:58 ` [tip:perf/urgent] " tip-bot for Jeremy Cline
2018-05-08 21:27 ` [PATCH 4/8] perf scripts python: Add Python 3 support to Util.py Jeremy Cline
2018-07-12 13:59 ` [tip:perf/urgent] " tip-bot for Jeremy Cline
2018-05-08 21:27 ` [PATCH 6/8] perf scripts python: Add Python 3 support to sched-migration.py Jeremy Cline
2018-07-12 13:59 ` [tip:perf/urgent] " tip-bot for Jeremy Cline
2018-05-08 21:27 ` [PATCH 5/8] perf scripts python: Add Python 3 support to EventClass.py Jeremy Cline
2018-07-12 14:00 ` [tip:perf/urgent] " tip-bot for Jeremy Cline
2018-05-08 21:27 ` [PATCH 8/8] perf tests: Add Python 3 support to attr.py Jeremy Cline
2018-05-08 21:27 ` Jeremy Cline [this message]
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=0100016341a74569-b9ac2ac6-f99b-41ed-be0d-f7cb3c69e6de-000000@email.amazonses.com \
--to=jeremy@jcline.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=herton@redhat.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--subject='Re: [PATCH 7/8] perf scripts python: Add Python 3 support to stat-cpi.py' \
/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
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).