Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp487831img; Thu, 28 Feb 2019 03:04:12 -0800 (PST) X-Google-Smtp-Source: AHgI3IY0yHw7YygMviv2woI7kkJmbO6/cxke8X2eUNhC1vsIcwkCSNClCrv0RPFY3YZ9kFYsniPl X-Received: by 2002:a63:1544:: with SMTP id 4mr7982870pgv.290.1551351852003; Thu, 28 Feb 2019 03:04:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551351851; cv=none; d=google.com; s=arc-20160816; b=dO/UARGoLkzOBjZCwZZ/oHKitT/W5V3xAMGn5vQ40PZcaBu114y5fbyrj6Ud9whgKk tm6mfdeuQh68yKNUmjl05uVS2mx519Bv+eEYCZAO7a9OIDv3de7Ka2lpOdKrnuUnm3iS oZvsCVmVnPa4yRd9MqENUzOueaDNprmwyyXndVZa66gRBssy5ouzvGohnZUSpI/4L+63 OM/Ij6vaAqStXOX0qRcUbmDzkTfyEyxVa8LXfN9P5JZetU7DQqyNIvGNf+qAVqSiYVMt e8FmMzq8tlRUBakRk4SBkaRpjvzhr29MUwXLOQ+EYcPBy3Qr9ThCpeem+l8ZygdThKkn 7JgQ== 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; bh=GgmdUOUUVH+3yuX5Vrbqn/SdzlbceC8FyTsQBmG4/M8=; b=ddQWR1+/QaeAo5xPZObIi5Dua92iq24I8BNmGHnOXCpvbV+oOQpgE3REdi7kgDPZvj paPVRMtKnp9knj2z8J2ku4+xfmQDgw8kd0Oq27/pojN1C0+4rvVp83PF3By7aYLDUljj y5hOgOr+38wwrdDmKnoVrKDJiMMBciXJ8wy4JBPey96qDArCTj7D9GnCdKNti0M2JnFv 19/MSjTmAViZYWVwQ99RqdKCmFJMVaRZRm0su3fLitfNZXTRzr3PL0wj/AeB2RCdHC48 8ZETy1zAkV+8nEYtHfZ5agi4ytdJADWOSZnwHBY3vPzFu76Y8wTvHArJGEL3ucU9V++a f3AA== 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 w8si16374676pgp.320.2019.02.28.03.03.56; Thu, 28 Feb 2019 03:04:11 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731725AbfB1IJ1 (ORCPT + 99 others); Thu, 28 Feb 2019 03:09:27 -0500 Received: from terminus.zytor.com ([198.137.202.136]:60813 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbfB1IJ0 (ORCPT ); Thu, 28 Feb 2019 03:09:26 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x1S881AW2955424 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 28 Feb 2019 00:08:01 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x1S880xi2955420; Thu, 28 Feb 2019 00:08:00 -0800 Date: Thu, 28 Feb 2019 00:08:00 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Tony Jones Message-ID: Cc: tglx@linutronix.de, nhorman@tuxdriver.com, mingo@kernel.org, s1seetee@linux.vnet.ibm.com, acme@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com, tonyj@suse.de Reply-To: tglx@linutronix.de, nhorman@tuxdriver.com, acme@redhat.com, mingo@kernel.org, s1seetee@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, hpa@zytor.com, tonyj@suse.de In-Reply-To: <20190222230619.17887-9-tonyj@suse.de> References: <20190222230619.17887-9-tonyj@suse.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf script python: Add Python3 support to net_dropmonitor.py Git-Commit-ID: 8c42b9600e561666233b9c557a5209d0dc853ba1 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, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: 8c42b9600e561666233b9c557a5209d0dc853ba1 Gitweb: https://git.kernel.org/tip/8c42b9600e561666233b9c557a5209d0dc853ba1 Author: Tony Jones AuthorDate: Fri, 22 Feb 2019 15:06:12 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 25 Feb 2019 17:16:55 -0300 perf script python: Add Python3 support to net_dropmonitor.py Support both Python2 and Python3 in the net_dropmonitor.py script There may be differences in the ordering of output lines due to differences in dictionary ordering etc. However the format within lines should be unchanged. The use of 'from __future__' implies the minimum supported Python2 version is now v2.6 Signed-off-by: Tony Jones Acked-by: Neil Horman Link: http://lkml.kernel.org/r/20190222230619.17887-9-tonyj@suse.de Signed-off-by: Seeteena Thoufeek Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/scripts/python/net_dropmonitor.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/perf/scripts/python/net_dropmonitor.py b/tools/perf/scripts/python/net_dropmonitor.py index a150164b44a3..212557a02c50 100755 --- a/tools/perf/scripts/python/net_dropmonitor.py +++ b/tools/perf/scripts/python/net_dropmonitor.py @@ -1,6 +1,8 @@ # Monitor the system for dropped packets and proudce a report of drop locations and counts # SPDX-License-Identifier: GPL-2.0 +from __future__ import print_function + import os import sys @@ -50,19 +52,19 @@ def get_sym(sloc): return (None, 0) def print_drop_table(): - print "%25s %25s %25s" % ("LOCATION", "OFFSET", "COUNT") + print("%25s %25s %25s" % ("LOCATION", "OFFSET", "COUNT")) for i in drop_log.keys(): (sym, off) = get_sym(i) if sym == None: sym = i - print "%25s %25s %25s" % (sym, off, drop_log[i]) + print("%25s %25s %25s" % (sym, off, drop_log[i])) def trace_begin(): - print "Starting trace (Ctrl-C to dump results)" + print("Starting trace (Ctrl-C to dump results)") def trace_end(): - print "Gathering kallsyms data" + print("Gathering kallsyms data") get_kallsyms_table() print_drop_table()