Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1738305imm; Thu, 12 Jul 2018 07:05:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcAUdtx4rjfzGKsriP6L/DXDLVXtNPy+QUjciFnVb/pT0Dg+VzKnHfjolu7N7w3yywsH/Ll X-Received: by 2002:aa7:88d3:: with SMTP id p19-v6mr2599836pfo.160.1531404337892; Thu, 12 Jul 2018 07:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531404337; cv=none; d=google.com; s=arc-20160816; b=elDFXmC3FI99715lgcXF9OZrkB5eOvvVyV5HnVdmxfsA9fmsRqa1WYrqTFh0owrk7q JOUqx72ewAgIEoOlib1+9d/VY+WTy3Dfxoa6xoXyvVAtcuf2d1oFu0uVacHYnJbh0D0s kJgTJwO5o3f9UKV4ZhAGCtGW40Viw02jqXe86O7LYb5thLtZ5obsNFbBlbuJnemgL1i/ +7Uk45KPZv/8ViCCXDEPJGEfiPwV2lerw3XvPTCa/5H7j+EDlRNjbHp2tKrb7UrZsdia FO+uG1psU0zxn46yEkkpjgHJHQiK6/HJCYSObJ7JT4oglNGsvW6sQHtvZ49fpDUCGB8q CHog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=aonK75CHvmkMmVY+ET2uaB3FAiFS6VjkI6mVDvcfFq8=; b=cPuDfigjdc230SrqiwX5OvGFneWIfjKv9Cn2BuUFcDL1AifADlyw4gW4LzQYJSjnx+ rM2ZLPAKqO1zCs0g9QdBSp9dKt2oJmo98XuVMAiky76ObTNNO/UmJ2PODmKQjriw94aV 3jgPi4syRU/rArH7pKEK/56M9Zo5HcT8Iq600ta1r1i+FHj2WPoP55Izzqm9ESKWUYn4 mmEDQ8byMZNvT8XDWvXZ8X5W+NW5XUCcI7lS6XIp9w6eXNUpZSrmuYvgZ+xoSp5vEQuW gCmTu1LiiFmVBF9eRXnBC9ZkBtocMRLvCE+53u4ukK8fOZR3vkage5l+67ARITUOTvMe LttQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3-v6si16715917pgl.583.2018.07.12.07.05.12; Thu, 12 Jul 2018 07:05:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732639AbeGLOMh (ORCPT + 99 others); Thu, 12 Jul 2018 10:12:37 -0400 Received: from terminus.zytor.com ([198.137.202.136]:44431 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726816AbeGLOMh (ORCPT ); Thu, 12 Jul 2018 10:12:37 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w6CE0Qgh3934633 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 12 Jul 2018 07:00:26 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w6CE0P0I3934630; Thu, 12 Jul 2018 07:00:25 -0700 Date: Thu, 12 Jul 2018 07:00:25 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jeremy Cline Message-ID: 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 Reply-To: mingo@kernel.org, peterz@infradead.org, jolsa@redhat.com, acme@redhat.com, herton@redhat.com, hpa@zytor.com, tglx@linutronix.de, jeremy@jcline.org, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, namhyung@kernel.org In-Reply-To: <0100016341a73aac-e0734bdc-dcab-4c61-8333-d8be97524aa0-000000@email.amazonses.com> References: <0100016341a73aac-e0734bdc-dcab-4c61-8333-d8be97524aa0-000000@email.amazonses.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf scripts python: Add Python 3 support to EventClass.py Git-Commit-ID: 12aa6c7389a321b4b5d921f89c3f83b9750598f7 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 12aa6c7389a321b4b5d921f89c3f83b9750598f7 Gitweb: https://git.kernel.org/tip/12aa6c7389a321b4b5d921f89c3f83b9750598f7 Author: Jeremy Cline AuthorDate: Tue, 8 May 2018 21:27:48 +0000 Committer: Arnaldo Carvalho de Melo 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 Cc: Alexander Shishkin Cc: Herton Krzesinski Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/0100016341a73aac-e0734bdc-dcab-4c61-8333-d8be97524aa0-000000@email.amazonses.com Signed-off-by: Arnaldo Carvalho de Melo --- .../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