Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4415714imc; Mon, 25 Feb 2019 04:40:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IY/hmeFvRQo2Pj73dPjot13OArcOeAnUe2bKvyMBplvxKLo7bwWZVfwEZ2+3jje4ndsvyKh X-Received: by 2002:a17:902:380c:: with SMTP id l12mr19977563plc.326.1551098428419; Mon, 25 Feb 2019 04:40:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551098428; cv=none; d=google.com; s=arc-20160816; b=G3YZOgUpg0PczAvP+I6aon8mtIhgeP8WFD9lKTAtuVLdAP2g4zxhGNde+i4Z7v5lAl 0BBQo8PyXR34SZViJqEMw3m4QnHAqQSHcT3oveMfwjvD0zwZKcSVfnrDR280XpeFPOPh UBpeiT/FX9uNXmluxEthDO6bFrqrd8rpQFeVau4VFXGaPefmBMiMNEZ/2/3QlEO6BNWA qRrcUKTmEPxPUcxPBLlfPoMKeMxO79sIdou8ok9pGgvyMCKhcNOtjhgT+Q4H2KskmF8c Epa6wZGqU1KX+9xXArwroi7dIaxqJCrhVVxW8CbAVFYZMAfY6m87WQepE+kxhO/yuxMK Vgxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kxOjowQ30buhwcSdo3SPSwcX+g7y62Mj/KjuDvj80pI=; b=vJDTXGFm53aQSgVvxz+fPW+cEzB/78NJSpJW8henCBUUM1T3cmSNegw5zrnnre6qof lsLSWAxteeUhDSIgtdUhgkiZtDpa28Q3pMvflcO64aRWPSsc5jgsHp+3byKP48xY5oss UFDHvVV/Bj/SNnbQBIFlAeOUBjmK6CAGsRnI+4wINFJ8QDoxJl11qR76OcvhVblPz9QU Vk9Uzjm7tgD3syLCaNItNw/NFtuHR6Ys0y57N54ijTgKNt9sAeRakVxjMouVw8zs7bB1 CSyM72tLAyIP1ctzdx99XyRhpP9ZKQR6fAbbuIxqtics1via1X7w06yhK427pYE7sSjf Dc+A== 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 c6si6208678pgd.106.2019.02.25.04.40.13; Mon, 25 Feb 2019 04:40:28 -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 S1726998AbfBYMi3 (ORCPT + 99 others); Mon, 25 Feb 2019 07:38:29 -0500 Received: from charlotte.tuxdriver.com ([70.61.120.58]:54818 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726475AbfBYMi3 (ORCPT ); Mon, 25 Feb 2019 07:38:29 -0500 Received: from cpe-2606-a000-111b-405a-9816-2c85-c514-8f7a.dyn6.twc.com ([2606:a000:111b:405a:9816:2c85:c514:8f7a] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1gyFWa-0002xg-DB; Mon, 25 Feb 2019 07:38:26 -0500 Date: Mon, 25 Feb 2019 07:37:55 -0500 From: Neil Horman To: Tony Jones Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org, Seeteena Thoufeek Subject: Re: [PATCH 08/15] perf script python: add Python3 support to net_dropmonitor.py Message-ID: <20190225123755.GA30699@hmswarspite.think-freely.org> References: <20190222230619.17887-1-tonyj@suse.de> <20190222230619.17887-9-tonyj@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190222230619.17887-9-tonyj@suse.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Score: -2.9 (--) X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 22, 2019 at 03:06:12PM -0800, Tony Jones wrote: > 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 > Signed-off-by: Seeteena Thoufeek > Cc: Neil Horman > --- > 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() > > -- > 2.20.1 > > Acked-by: Neil Horman