Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1710934imu; Thu, 17 Jan 2019 01:54:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN6B4HfdwQzDA07MiPoAXm+t2S7CbQFDVTaOaH4z0XF7wHqOj15cCzUyvII1jAgIkXTI6yle X-Received: by 2002:a63:990a:: with SMTP id d10mr12897664pge.279.1547718869411; Thu, 17 Jan 2019 01:54:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547718869; cv=none; d=google.com; s=arc-20160816; b=zB0n//cWPNlDHBzA4gzegg/7OQ2HkGVLsZpaTQ3zMQhJt324SC0YK5PrpIcyGI3KIi vkWxMKxE6OdBjtUQoivhMkwCpQ1t5vucmfQg9RV9QpYG+qbm3sZlwh9afj/g7bCvfP5i RjWGUw1E80yr+9KG1Xwzv2Q6zx1D9c2Ik3pd6iPW78Z98yFzq1zxIcv/X/meoppbM80s LSrBbC2ntxv7zGCM7htssprdRG3ceQJxZ/gznbVPhldi7NBLQHvNw+GfXVKqGTYCO3lZ R+nh/b0qEvhRovD8+p9PB3+Agu6iBy6WmU1/sQoX3yDyPf055zlmT51uJd21dePtco4r eF6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject; bh=qK38LnjMRcQ76h9kfPyvpeJ+boHQZ80ZjT+tq+Lm0eQ=; b=B350XbjAi9DyKfd2iZPmAvzTXQH51Z3kQxgxAR/x3JgsgvYLq+nWsrzICoebL3IfKO 2Z1CeP6Buy4JorqjQyjKSpr6keY2hh3G1d3MFOqsyuQQYRsdsohiGltbro33nAqB9HmL +ZhivkrETbbzqQbaJV9c5XyYTO5Y3fZABQzsnYiVOCM9ZlFheGBXhWpezE6nQmp9ijq7 /rkI/rQt9JrFEfc1O2TrYDZH2C0KorG5xPp2YmRi3Co3vF2Eu1/HU9EciPNg1lV0CGq/ a/03P1eyzAWygCqoIyi2r8qGERrl12tlvbVqM/oPbAatE9fdTV1Uc7ne6msqG3FXjzFy yS6A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5si1065982pgh.469.2019.01.17.01.54.13; Thu, 17 Jan 2019 01:54:29 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727376AbfAQJs2 (ORCPT + 99 others); Thu, 17 Jan 2019 04:48:28 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59484 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725965AbfAQJs1 (ORCPT ); Thu, 17 Jan 2019 04:48:27 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id x0H9jFt5185667 for ; Thu, 17 Jan 2019 04:48:26 -0500 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0b-001b2d01.pphosted.com with ESMTP id 2q2mt2pbd9-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 17 Jan 2019 04:48:26 -0500 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 Jan 2019 09:48:25 -0000 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 17 Jan 2019 09:48:22 -0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0H9mLD520643954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 17 Jan 2019 09:48:21 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1A5C124052; Thu, 17 Jan 2019 09:48:20 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7459512405C; Thu, 17 Jan 2019 09:48:18 +0000 (GMT) Received: from oc1548405160.ibm.com (unknown [9.124.35.202]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 17 Jan 2019 09:48:18 +0000 (GMT) Subject: Re: [PATCH] perf scripts python: Add Python 3 support to mem-phys-addr.py To: Jonathan Corbet Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, ravi.bangoria@linux.ibm.com References: <1547655825-28754-1-git-send-email-s1seetee@linux.vnet.ibm.com> <1547655825-28754-8-git-send-email-s1seetee@linux.vnet.ibm.com> <20190116093233.4873b784@lwn.net> From: seeteena Date: Thu, 17 Jan 2019 15:18:16 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190116093233.4873b784@lwn.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 19011709-0052-0000-0000-00000379D808 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010423; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000275; SDB=6.01147708; UDB=6.00597870; IPR=6.00928006; MB=3.00025170; MTD=3.00000008; XFM=3.00000015; UTC=2019-01-17 09:48:24 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19011709-0053-0000-0000-00005F7FB170 Message-Id: <89d6529f-1849-ce36-bd33-b65f2252214c@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-17_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901170072 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I have added On 01/16/2019 10:02 PM, Jonathan Corbet wrote: > On Wed, 16 Jan 2019 21:53:36 +0530 > Seeteena Thoufeek wrote: > >> Support both Python 2 and Python 3 in mem-phys-addr.py. ``print`` is now a >> function rather than a statement. This should have no functional change. >> >> Fix lambda syntax error. > So, I just picked one of these at random.... > >> Signed-off-by: Seeteena Thoufeek >> Reviewed-by: Ravi Bangoria >> --- >> tools/perf/scripts/python/mem-phys-addr.py | 12 ++++++------ >> 1 file changed, 6 insertions(+), 6 deletions(-) >> >> diff --git a/tools/perf/scripts/python/mem-phys-addr.py b/tools/perf/scripts/python/mem-phys-addr.py >> index ebee2c5..52fe9bd 100644 >> --- a/tools/perf/scripts/python/mem-phys-addr.py >> +++ b/tools/perf/scripts/python/mem-phys-addr.py >> @@ -38,14 +38,14 @@ def parse_iomem(): >> pmem.append(long(m[1], 16)) >> >> def print_memory_type(): >> - print "Event: %s" % (event_name) >> - print "%-40s %10s %10s\n" % ("Memory type", "count", "percentage"), >> - print "%-40s %10s %10s\n" % ("----------------------------------------", \ >> - "-----------", "-----------"), >> + print("Event: %s" % (event_name)) >> + print("%-40s %10s %10s\n" % ("Memory type", "count", "percentage")), >> + print("%-40s %10s %10s\n" % ("----------------------------------------", \ >> + "-----------", "-----------")), > You have not added "from __future__ import print_function", so you're > relying on a Python 2 parsing oddity to make this work. If anybody ever > adds a second parameter, things will break. I think that if you really > want to support both versions (which seems like the right goal) you should > add the import and do it properly. > > Thanks, > > jon > Thanks Jonathan. I have added "from __future__ import print_function" for all the scripts.