Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1215933imu; Wed, 16 Jan 2019 15:01:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN4pufOvzOlkBrzdrQhAe+c2tApcVmqxjOPyskYRWQR5Qjgaely5h0NHzyJcGA2NYCBepDsc X-Received: by 2002:a62:2fc3:: with SMTP id v186mr12346251pfv.82.1547679661426; Wed, 16 Jan 2019 15:01:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547679661; cv=none; d=google.com; s=arc-20160816; b=oX/Evjga/tYojXWsWrLXhwx/qylxTG7bw6F+SG7tRKisFlmRxL1OqiY1bYxmWI2kXs qP7SazHp1cbfLumwNs6Y+1cal1NpFju0D433EI0Moyt26kjYvR+0GxCVLqZFBdS5WE9J vDTYLcVYi3YoiNXESYbPa1BjvYcAX5YNO9fF2biH9G7iIzFfnVxae4ucSI05zcjNNuan ZhDUX3HFklatRzEY5BtYW0uRH8qjuW7JxitPqEob/wh++LTckih3feu+x7zZsNHFYAdn 8Y4zqvHW6+pe71OHxKHwxD4byU1Sux9y6SiWVElW0DDlS/ds8NZGoVGOSjd27TGnV0hy Oaog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=rnivmHYC28AmBCHCX0qIKQHjxaLI7v/1la+NVBZxLQY=; b=mR17QXUOycM7f0YamrtzSyn0EbgbITK3GsD7nqQzLlt7zq1DXq/As62BaWpB8iqkBz +6jAWzFsI2a+m8z7n/Sy5aSb78qRREGy7B244dRMfBxbgR8IewE4MKr1miIDd7EAtwYz RuKr5K4J4giwVMQjQXiA0VO8PQARmAE8Q0/Qkix1wEWDuAURgcxbKkTOZAE4um/I+HMH tPIfMcagPduef9emE9dqRt+YsPQge5Cq4YDTJUvG8Oue2p16IBFKc650x0lY2VA07PQt wa7a+myMPPb0OdISWH9bPpgjrF/n4kwPVrSEXDIrOpr52lQ3bCVUPlYrNeCVWIHeyO72 wbWw== 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 c13si7227989pgi.531.2019.01.16.15.00.45; Wed, 16 Jan 2019 15:01:01 -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 S2405600AbfAPQY4 (ORCPT + 99 others); Wed, 16 Jan 2019 11:24:56 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47588 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731019AbfAPQYy (ORCPT ); Wed, 16 Jan 2019 11:24:54 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id x0GGJsCX104000 for ; Wed, 16 Jan 2019 11:24:53 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2q25vx705x-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 16 Jan 2019 11:24:52 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 16 Jan 2019 16:24:51 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 16 Jan 2019 16:24:48 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0GGOmO732964818 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 16 Jan 2019 16:24:48 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D751F42045; Wed, 16 Jan 2019 16:24:46 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9500342042; Wed, 16 Jan 2019 16:24:44 +0000 (GMT) Received: from oc1548405160.ibm.com (unknown [9.85.72.239]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 16 Jan 2019 16:24:44 +0000 (GMT) From: Seeteena Thoufeek To: 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 Cc: s1seetee@linux.vnet.ibm.com, ravi.bangoria@linux.ibm.com Subject: [PATCH] perf scripts python: Add Python 3 support to syscall-counts.py Date: Wed, 16 Jan 2019 21:53:44 +0530 X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1547655825-28754-1-git-send-email-s1seetee@linux.vnet.ibm.com> References: <1547655825-28754-1-git-send-email-s1seetee@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19011616-0028-0000-0000-0000033A0BFE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19011616-0029-0000-0000-000023F733C8 Message-Id: <1547655825-28754-16-git-send-email-s1seetee@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-16_06:,, 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-1901160132 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Support both Python 2 and Python 3 in syscall-counts.py. ``print`` is now a function rather than a statement. This should have no functional change. Fix lambda syntax error Signed-off-by: Seeteena Thoufeek Reviewed-by: Ravi Bangoria --- tools/perf/scripts/python/syscall-counts.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/perf/scripts/python/syscall-counts.py b/tools/perf/scripts/python/syscall-counts.py index e66a773..141b7fc 100644 --- a/tools/perf/scripts/python/syscall-counts.py +++ b/tools/perf/scripts/python/syscall-counts.py @@ -28,7 +28,7 @@ if len(sys.argv) > 1: syscalls = autodict() def trace_begin(): - print "Press control+C to stop and show the summary" + print("Press control+C to stop and show the summary") def trace_end(): print_syscall_totals() @@ -51,14 +51,14 @@ def syscalls__sys_enter(event_name, context, common_cpu, def print_syscall_totals(): if for_comm is not None: - print "\nsyscall events for %s:\n\n" % (for_comm), + print("\nsyscall events for %s:\n\n" % (for_comm)), else: - print "\nsyscall events:\n\n", + print("\nsyscall events:\n\n"), - print "%-40s %10s\n" % ("event", "count"), - print "%-40s %10s\n" % ("----------------------------------------", \ - "-----------"), + print("%-40s %10s\n" % ("event", "count")), + print("%-40s %10s\n" % ("----------------------------------------", \ + "-----------")), - for id, val in sorted(syscalls.iteritems(), key = lambda(k, v): (v, k), \ + for id, val in sorted(syscalls.iteritems(), key = lambda k_v: (k_v[1], k_v[0]), \ reverse = True): - print "%-40s %10d\n" % (syscall_name(id), val), + print("%-40s %10d\n" % (syscall_name(id), val)), -- 1.8.3.1