LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: tip-bot for Jeremy Cline <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org,
	namhyung@kernel.org, jeremy@jcline.org, tglx@linutronix.de,
	hpa@zytor.com, herton@redhat.com, mingo@kernel.org,
	peterz@infradead.org, jolsa@redhat.com, acme@redhat.com
Subject: [tip:perf/urgent] perf scripts python: Add Python 3 support to EventClass.py
Date: Thu, 12 Jul 2018 07:00:25 -0700	[thread overview]
Message-ID: <tip-12aa6c7389a321b4b5d921f89c3f83b9750598f7@git.kernel.org> (raw)
In-Reply-To: <0100016341a73aac-e0734bdc-dcab-4c61-8333-d8be97524aa0-000000@email.amazonses.com>

Commit-ID:  12aa6c7389a321b4b5d921f89c3f83b9750598f7
Gitweb:     https://git.kernel.org/tip/12aa6c7389a321b4b5d921f89c3f83b9750598f7
Author:     Jeremy Cline <jeremy@jcline.org>
AuthorDate: Tue, 8 May 2018 21:27:48 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 11 Jul 2018 10:01:50 -0300

perf scripts python: Add Python 3 support to EventClass.py

Support both Python 2 and Python 3 in EventClass.py. ``print`` is now a
function rather than a statement. This should have no functional change.

Signed-off-by: Jeremy Cline <jeremy@jcline.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Herton Krzesinski <herton@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/0100016341a73aac-e0734bdc-dcab-4c61-8333-d8be97524aa0-000000@email.amazonses.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 .../perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
index 81a56cd2b3c1..21a7a1298094 100755
--- a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
+++ b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
@@ -8,6 +8,7 @@
 # PerfEvent is the base class for all perf event sample, PebsEvent
 # is a HW base Intel x86 PEBS event, and user could add more SW/HW
 # event classes based on requirements.
+from __future__ import print_function
 
 import struct
 
@@ -44,7 +45,8 @@ class PerfEvent(object):
                 PerfEvent.event_num += 1
 
         def show(self):
-                print "PMU event: name=%12s, symbol=%24s, comm=%8s, dso=%12s" % (self.name, self.symbol, self.comm, self.dso)
+                print("PMU event: name=%12s, symbol=%24s, comm=%8s, dso=%12s" %
+                      (self.name, self.symbol, self.comm, self.dso))
 
 #
 # Basic Intel PEBS (Precise Event-based Sampling) event, whose raw buffer

  reply	other threads:[~2018-07-12 14:02 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-bot for Jeremy Cline [this message]
2018-05-08 21:27 ` [PATCH 8/8] perf tests: Add Python 3 support to attr.py Jeremy Cline
2018-05-08 21:27 ` [PATCH 7/8] perf scripts python: Add Python 3 support to stat-cpi.py Jeremy Cline

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=tip-12aa6c7389a321b4b5d921f89c3f83b9750598f7@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=herton@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jeremy@jcline.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --subject='Re: [tip:perf/urgent] perf scripts python: Add Python 3 support to EventClass.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).