Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp877248imm; Wed, 25 Jul 2018 07:41:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdR4v/6wzrYhp7GG2GiuIfEAkAEUt38SlWMYk/TbfwxtS1JG/64JZ+ETUjPZo6frRt6Nr6h X-Received: by 2002:a63:d5b:: with SMTP id 27-v6mr20494773pgn.107.1532529693213; Wed, 25 Jul 2018 07:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532529693; cv=none; d=google.com; s=arc-20160816; b=iFCUnV7Kzvf2o2EhHhxdrH0265O7mWoBQuxtGAS3Yzzb7AN5hPDmtBoyrDtBo0YpJ2 xCxebNiwGPoPcYlQwOyYvF9BJQiuoJMjHeBouOGPSGyze+npnhBNlPRjKC+Voghkv5WO WTUvyGcbLpJPtGauBgG9nco8SfbldxVOqYjBQCYJHyzS2uVxSx3ovgdoagKP9GpKlny/ eaFdeskLBfy2PuORw0aLHj4y0ardW3fNxSEjR+6CbTOI/nz5rI5y+omH8Y0ux6uCLXVb LMXpLIdaUIHHW0WK0n6CrxTH2oEbeP7/jtH6qVFa+CHGEDAPnpNR1ckkuyRuis48VnVN qMeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=mmco++PLQyXJUprrrFPTT8JVnXIVAQFX2GupmkMSGrw=; b=zDeVsmdolyObSNmSzONlJ9k0/UioxV46HhXXrOF46ZejLx9SqiC6EDpwj0HFb6j95v V2pBdxthYSbmhFiDsJq/HCJVigoO7ydIs+yWwLTcjl/gmDp1Lghol2iVkHhHQhYHdb5f QYd2NGGC4mCHvQdpg7QPE+IzP6jD1OIV2XVcK9F2owEIDtwhYvj9cqHttGLtsmufgD6G dvPRfJEbQ8fhuZVQbapjDC9DDAp8Zfa6SapXdnj/CBuHjabSj+fGlUE/+zeUcPaxBmFl suqSsIGlsqtdZnH6eGuQEVFUroGc22kMpxD4ZoBd9zFY4sgyKvaCW1zv675EbMwqruDE s/Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=SvmnGLH5; 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 n34-v6si14262741pgm.28.2018.07.25.07.41.18; Wed, 25 Jul 2018 07:41:33 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=SvmnGLH5; 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 S1729369AbeGYPvy (ORCPT + 99 others); Wed, 25 Jul 2018 11:51:54 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:27771 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729092AbeGYPvy (ORCPT ); Wed, 25 Jul 2018 11:51:54 -0400 Received: from mail-vk0-f45.google.com (mail-vk0-f45.google.com [209.85.213.45]) (authenticated) by conssluserg-05.nifty.com with ESMTP id w6PEdpiP028890; Wed, 25 Jul 2018 23:39:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com w6PEdpiP028890 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1532529592; bh=mmco++PLQyXJUprrrFPTT8JVnXIVAQFX2GupmkMSGrw=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=SvmnGLH5mxT/1h7t2UGpAw/cNMBLXPEBeUuadvEMFT5MCTYOXyTsycKg/LCHCjrDU 1P4Nv9KYcjcxNrnII8fRb891xLlyEWVGmAdlacaWnPLHo85GVld20V+Kd3EcladFIH c17dwqRhTIYQ+ads3MxPQ7xHdtwK1ChjxwafJ2RdXX83s0+9I5JMQY8JOGsZX6KR6t oiUamXA48BPg/veA9H7cUfNq9+1lnXqSD7kq8SP/8JxGrC4Ellf7pyn9TYWCxmqWih YlSDqpt1dUz4LG1JtSYoVwli5bu503i7u203kJuiKDvs4mxK+cEFOgHHrnaJaeY//B Qzko5qhy7KCdw== X-Nifty-SrcIP: [209.85.213.45] Received: by mail-vk0-f45.google.com with SMTP id p12-v6so3913031vkf.2; Wed, 25 Jul 2018 07:39:51 -0700 (PDT) X-Gm-Message-State: AOUpUlE5btl/OcBEAw/se72bxEbGqAZhxm9uCZpn1JzJI23gEhjMCQo6 ySaQPPht9VlIM2fmmz2t5DCto0gvlezsorsk/sM= X-Received: by 2002:a1f:4049:: with SMTP id n70-v6mr13915794vka.140.1532529590360; Wed, 25 Jul 2018 07:39:50 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:7289:0:0:0:0:0 with HTTP; Wed, 25 Jul 2018 07:39:09 -0700 (PDT) In-Reply-To: <20180720193528.1341-1-jcline@redhat.com> References: <20180720193528.1341-1-jcline@redhat.com> From: Masahiro Yamada Date: Wed, 25 Jul 2018 23:39:09 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] scripts: Add Python 3 support to tracing/draw_functrace.py To: Jeremy Cline Cc: Michal Marek , Frederic Weisbecker , Linux Kbuild mailing list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-07-21 4:35 GMT+09:00 Jeremy Cline : > Use the print function. This maintains Python 2 support and should have > no functional change. > > Signed-off-by: Jeremy Cline > --- > scripts/tracing/draw_functrace.py | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/scripts/tracing/draw_functrace.py b/scripts/tracing/draw_functrace.py > index db40fa04cd51..7d44e796d362 100755 > --- a/scripts/tracing/draw_functrace.py > +++ b/scripts/tracing/draw_functrace.py > @@ -20,6 +20,7 @@ Usage: > $ scripts/draw_functrace.py < raw_trace_func > draw_functrace > Then you have your drawn trace in draw_functrace > """ > +from __future__ import print_function What do you need this line for? I have not tested this, but I guess print(CallTree.ROOT) will work for Python 2. > > import sys, re > @@ -123,7 +124,7 @@ def main(): > tree = tree.getParent(caller) > tree = tree.calls(callee, calltime) > > - print CallTree.ROOT > + print(CallTree.ROOT) > > if __name__ == "__main__": > main() > -- > 2.17.1 > -- Best Regards Masahiro Yamada