Skip to content

Commit 12aa6c7

Browse files
jeremyclineacmel
authored andcommitted
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 <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Herton Krzesinski <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/0100016341a73aac-e0734bdc-dcab-4c61-8333-d8be97524aa0-000000@email.amazonses.com Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 8c1c1ab commit 12aa6c7

File tree

1 file changed

+3
-1
lines changed
  • tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace

1 file changed

+3
-1
lines changed

tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# PerfEvent is the base class for all perf event sample, PebsEvent
99
# is a HW base Intel x86 PEBS event, and user could add more SW/HW
1010
# event classes based on requirements.
11+
from __future__ import print_function
1112

1213
import struct
1314

@@ -44,7 +45,8 @@ def __init__(self, name, comm, dso, symbol, raw_buf, ev_type=EVTYPE_GENERIC):
4445
PerfEvent.event_num += 1
4546

4647
def show(self):
47-
print "PMU event: name=%12s, symbol=%24s, comm=%8s, dso=%12s" % (self.name, self.symbol, self.comm, self.dso)
48+
print("PMU event: name=%12s, symbol=%24s, comm=%8s, dso=%12s" %
49+
(self.name, self.symbol, self.comm, self.dso))
4850

4951
#
5052
# Basic Intel PEBS (Precise Event-based Sampling) event, whose raw buffer

0 commit comments

Comments
 (0)