Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5919465imu; Sun, 20 Jan 2019 23:26:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN78lz18DMcBeE7HhlZT0UeEefmZS8ZpbBlJRSDPJOeVmVWiflyURlSU92RM6cRu07VUoXBZ X-Received: by 2002:aa7:80d7:: with SMTP id a23mr28326703pfn.86.1548055568506; Sun, 20 Jan 2019 23:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548055568; cv=none; d=google.com; s=arc-20160816; b=AaZYJqi51Rq5dkccAbydJsKy1/Nz6249pMoLSpMMTB78eUKTKIwTrkptrAH8vjItWa j5SRI8Es29HLRcvNX+3e5Jwl8LczhvtXGRYvwMf5crTXYp5Liotx/4M7S0FOYhe8XsFM QZs2tYp3q9VSZA8TnY5KtdW4h59Gby2Xmu5ZYGNnKTDxrjAkjKYxAEw2J1Rj2dabbeZw rN2usegS7omvfrsCAJok99bSODaxOU867cztLHBTxlt53nTpaj0eg8+FGaN1PPIJS9yw 7dccmsWWUjVcLukXM8XMHdt1nph1LA1fGBEoDN4pQT6S8HaYRyHgFPFlSS7Mef/NYaFZ JJgg== 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:cc:to:subject; bh=GvwYDrBo0gHl9YWBFiT9ThfU0GTvmqPfC55ZF3MsNgM=; b=Meaun+TCPMtg3iabJqXpGaQ/wMln71HQo7SvIkRC4OWVv0dMEqx7Gqs69UZviH4L5R Q1XwNtzHf/2M/ZaonAtPcwJCK6c9GANQbvai01ShFrAaJ90wOFx7fh9H8lNFZMGBMeW8 NpIsHRP5iXFQauZca4ee/1V3V4KSqv8F1sAXcG99fX9V7JYymWAUOHgyaRlA4zG3BQB2 yRxlL5TyPi09y8z8wg9kqjryivbiTh8/KpWU/fvAPP99+vuFdXTNhXynDDM/IMVdLStR h9IKWk2FCTJqNxHD9NwWaOFTYH1j/HPkFXjY2bc8RJ+9FR1kpQHc9bWmjGxc/ZYwuGL9 q9Tg== 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 q5si11265873pgb.245.2019.01.20.23.25.52; Sun, 20 Jan 2019 23:26:08 -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 S1728198AbfAUHYV (ORCPT + 99 others); Mon, 21 Jan 2019 02:24:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:56610 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727785AbfAUHYV (ORCPT ); Mon, 21 Jan 2019 02:24:21 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 931CCAF4F; Sun, 20 Jan 2019 20:50:54 +0000 (UTC) Subject: Re: [PATCH v2] perf scripts python: Add Python 3 support to exported-sql-viewer.py To: Jonathan Corbet Cc: 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 References: <1547718344-27382-1-git-send-email-s1seetee@linux.vnet.ibm.com> <1547718344-27382-3-git-send-email-s1seetee@linux.vnet.ibm.com> <20190120122755.1a8fe456@lwn.net> From: Tony Jones Openpgp: preference=signencrypt Autocrypt: addr=tonyj@suse.de; prefer-encrypt=mutual; keydata= mQGiBEkQmbwRBACDch7wo/RzlNt2HA8jLICsO2w8yOkJ7UTzHYNn3Q83Ro0qev2KokfE3EDw il+vam9CDR7jIDmswHqaMe0/O+UnZtO5PlDgylZcrwNwbBzHfm/KGejbi1RBGAoETrvcfwGi w83bR/aDnoRXY5Ho1uphQ05/065EMpbJOOBdn9qQ4wCgv2Q6C/QeYDGsxJPRO+20nLu5K00D /Rde4OTZ5biM+vb6ObTmgPNeiMrTwGpMokN7audIl7njwvD+lYrlgQjmDzcaPFz29rYWwT7g 6t6hcFgjpU1he/v3qxeQlTJoi2+u5Mqj42z//49h6DqNjT859Z/6h5IwKBo/EZC17iBIlS2G VXAstNiZASGiaIlONozWJ/GSjUaRA/9wZTV1nXF/+xX+qmc7SvTg1w6jWyjxVumQLoq2SeA4 1Sy5X2IATkAGCCjbeoQGnFdbOnHRSJdlTazObgwreqGPlPnIROpr9QESkfxsaCkDiZfpl0xk 6X069QMZBEwGAWILHYXL9UqlOjniZaU2BkVA11JEdBhyQorC8T/ji1edc7QaVG9ueSBKb25l cyA8dG9ueWpAc3VzZS5kZT6IYAQTEQIAIAUCSRCZvAIbAwYLCQgHAwIEFQIIAwQWAgMBAh4B AheAAAoJELFYWyEf4koXGmYAoKCnbv9dhAB2vR6IvSJem1ws4HpfAJ9ZqTKiXcogBGfTPaJR GI9QhVUieLkCDQRJEJm8EAgAzr9Zd3v7B10ODtVc7XxbMe3W6o1FdClL9ZIgLv61zhWctafK DMu/MUSvxmYFq00pecD/SfX8oxArA02+sQ2E+/Zb4J7NAWIAxCfmy7VE0wDBrZH/hBapIx/L gVqYfZ9Rw+a4FXrlk1y8oQCwhvj+kWrm7V7olR0aPOy1NFGNUyTFSMj+pbmxiNOXdCxVUQe3 UE1k9yA+mILjyaRanwkiCLCjNvRPL88Q017BdhVBWZmz8qhwXN/RrjCcDHsPX5O0ev68MLyu sh5mfukuvCqzW1Y3Ql+iwfwEw5lNmQGdoV9csg7JP7saDicSFO2KcZvMbvDMqtPFipdF5UWo fZKZ3wADBQf/b5cVNyb5i8QI0G7BPGBNn4VlQX5n66TsPBnrRNOi3MhTTVEBCp8s+jqUjJjX EjjA+O4hIm7Qqdsozurw7GlcQ0A06dIzO/1RUglZZMoC0JL43ZQmJ+3+yFrLjWgGH6ev6AOb YLH7ZujgAB5n0Hy2ZIChzsKLKbHptFtBvpDKB8updq+GunsY4oN3wGa67h9sHqDvjyp64Czg n8G5uGLwx3f/edbECKz5kPUSzChEk3suK742SEP01v4ra5WX88Hn81NjGByQMz9acJLdC7Ff LzXvbNa0KgvDaSllYfsJIoGCz3eKVOuTWXOiaEIKuy833+3mr2PulLCyLKysAEddKohJBBgR AgAJBQJJEJm8AhsMAAoJELFYWyEf4koXhgQAn1EGATLZPS53At9t+p3S8BkNI9yRAJ9A0OmL liv+rwEesYGlGeGNaKHTJw== Message-ID: <6c3d7574-f9cf-d86a-16af-43fa9929015b@suse.de> Date: Sun, 20 Jan 2019 12:50:49 -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: <20190120122755.1a8fe456@lwn.net> 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/20/19 11:27 AM, Jonathan Corbet wrote: > On Fri, 18 Jan 2019 16:45:04 -0800 > Tony Jones wrote: > >> On 1/17/19 1:45 AM, Seeteena Thoufeek wrote: >> >>> +if sys.version_info[0] < 3: >>> + import cPickle >>> +else: >>> + import _pickle as cPickle >> >> Do you really need this? >> >> pickle is already in Python2. > > Did you mean in Python3? I would agree that using it is better than > importing the semi-hidden _pickle module. No. I meant Python2 :) pickle in Python2 is the python implementation cPickle in Python2 is the C implementation. Read: https://docs.python.org/3.1/whatsnew/3.0.html#library-changes A common pattern in Python 2.x is to have one version of a module implemented in pure Python, with an optional accelerated version implemented as a C extension; for example, pickle and cPickle. This places the burden of importing the accelerated version and falling back on the pure Python version on each user of these modules. In Python 3.0, the accelerated versions are considered implementation details of the pure Python versions. Users should always import the standard version, which attempts to import the accelerated version and falls back to the pure Python version. I my patchset "import pickle" was sufficient for Python2 and Python3 The question I suppose is whether this script, for Python2, needs the accelerated C implementation. I decided it didn't. Tony