Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6488431imu; Mon, 21 Jan 2019 09:44:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN6+uf8zDnBkIa1jYXsuQq3MJEZoAJPiRCJqEZ5uOIiOTtUkP66+9Yk/GVC7ozk5voKq46Fi X-Received: by 2002:a17:902:4:: with SMTP id 4mr31232967pla.20.1548092650776; Mon, 21 Jan 2019 09:44:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548092650; cv=none; d=google.com; s=arc-20160816; b=PB4f8ydouM3HLl7ykxvhieNbEaZ2lFqkf0/KMPsjVp/VDmJLq863luGNjqC1yEMknT 5RW6vakS1fUH4jf/C8/GiRcoMdm6btjOwPKT0w5elS/OofDF/D4XYgXNmQSZ6NGWkZ4R iVjiw5m/hIOnC6Ex2u2fV5Jjyi34ZtwuM2hbs6D2H2JYnfYRi67vNlYTKZ/XEZc0umfM btfsyYkjz0CVJmfJune+CEA10wrSyXKKKXLIXcjyPqJ3DKhfoc0b2hKMkYJp8m+y3I20 hkZus0Ppr3LmVI+XTbIeH1Srswwn9oFRVamGF+BqTAqBwTrWgpBM5JJ8iS0c70g0iWry rP3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:to:subject; bh=1EZNsS1ft3ruiMAOEPdpz9MIbDDmrOd92/yQwvYbWR0=; b=zDI2lOTbj13BYci1vQ4rGOZsR59BDyQ7KVEUEFqEvo1Twq/6ngxwUmQ10D4xieDIJY u3xCUnziXN6y+waKjqxNM1H++9j9cWVPyNT3ec1mcrfOATrTsbcjF1INlckkImEFu8SA Bz1wQY8zUcIfWzfre95GS1S7OrXGOdRM5rePivMPqCj3rORDgTE/Jbd1+3V+NOrfEkiO 2OJ9+vRjpBzBRlDH0ja2lVhiPCHX506SPYd9UIk7dysShzeaJY0Ov9RCon0Te4RLFifP 5pZq99miRTFfBWe1hLO/AWugcqGHRgIRcE4Uu8iC4V3yQP0DEZgG4B++sVm5Kkdyu//W PInw== 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 i20si12990312pgh.187.2019.01.21.09.43.55; Mon, 21 Jan 2019 09:44:10 -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 S1727796AbfAURiT (ORCPT + 99 others); Mon, 21 Jan 2019 12:38:19 -0500 Received: from mx2.suse.de ([195.135.220.15]:59718 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726020AbfAURiT (ORCPT ); Mon, 21 Jan 2019 12:38:19 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 04132AF1A; Mon, 21 Jan 2019 17:38:16 +0000 (UTC) Subject: Re: [PATCH v3] perf scripts python: Add Python 3 support to export-to-sqlite.py To: Seeteena Thoufeek , 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: <1548067157-10395-1-git-send-email-s1seetee@linux.vnet.ibm.com> From: Tony Jones Openpgp: preference=signencrypt Autocrypt: addr=tonyj@suse.de; prefer-encrypt=mutual;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FipdF5UWo fZKZ3wADBQf/b5cVNyb5i8QI0G7BPGBNn4VlQX5n66TsPBnrRNOi3MhTTVEBCp8s+jqUjJjX EjjA+O4hIm7Qqdsozurw7GlcQ0A06dIzO/1RUglZZMoC0JL43ZQmJ+3+yFrLjWgGH6ev6AOb YLH7ZujgAB5n0Hy2ZIChzsKLKbHptFtBvpDKB8updq+GunsY4oN3wGa67h9sHqDvjyp64Czg n8G5uGLwx3f/edbECKz5kPUSzChEk3suK742SEP01v4ra5WX88Hn81NjGByQMz9acJLdC7Ff LzXvbNa0KgvDaSllYfsJIoGCz3eKVOuTWXOiaEIKuy833+3mr2PulLCyLKysAEddKohJBBgR AgAJBQJJEJm8AhsMAAoJELFYWyEf4koXhgQAn1EGATLZPS53At9t+p3S8BkNI9yRAJ9A0OmL liv+rwEesYGlGeGNaKHTJw== Message-ID: Date: Mon, 21 Jan 2019 09:38:11 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <1548067157-10395-1-git-send-email-s1seetee@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/21/19 2:39 AM, Seeteena Thoufeek wrote: > Support both Python 2 and Python 3 in export-to-sqlite.py. ``print`` is > now a function rather than a statement. This should have no functional > change. > > Also, handles the conversion of "print >> sys.stderr". > > Signed-off-by: Seeteena Thoufeek > Reviewed-by: Ravi Bangoria > --- > tools/perf/scripts/python/export-to-sqlite.py | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) > > diff --git a/tools/perf/scripts/python/export-to-sqlite.py b/tools/perf/scripts/python/export-to-sqlite.py > index 245caf2..95bfcb2 100644 > --- a/tools/perf/scripts/python/export-to-sqlite.py > +++ b/tools/perf/scripts/python/export-to-sqlite.py > @@ -9,6 +9,7 @@ > # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > # more details. > +from __future__ import print_function So is the script failing for you without the above As I said in previous reviews you should not need this unless you are using features of the latest print function (end, sep etc). You will need this import in the other scripts (once you fix the numerous errors regarding the trailing comma usage) as some need to concatenate output onto one line but I don't think you need it here. tony $ python2 --version Python 2.7.15 $ python3 --version Python 3.6.5 $ a='print("abcd") ; print("defg")' $ echo $a | python2 abcd defg $ echo $a | python3 abcd defg $ b='print("abcd", end="") ; print("defg")' $ echo $b | python2 File "", line 1 print("abcd", end="") ; print("defg") ^ SyntaxError: invalid syntax $ echo $b | python3 abcddefg $ c='from __future__ import print_function ; print("abcd", end="") ; print("defg")' $ echo $c | python2 abcddefg $ echo $c | python3 abcddefg