Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1406485imu; Wed, 23 Jan 2019 16:52:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN6W7e2i3Y7NB4lPnQ1AJbeHHGRJhniT2KZII1nvmwDeHrFCgrKwZTwg9RH7dljf/YM85pw9 X-Received: by 2002:a63:1a4b:: with SMTP id a11mr4043835pgm.254.1548291135876; Wed, 23 Jan 2019 16:52:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548291135; cv=none; d=google.com; s=arc-20160816; b=xYZuk10NmkQf2Be5rTJNrJOybt2PMg7Z6+1JcxEroyMPQ2eOOB3mhW6QBANKqnoYqV yyiy9kJ1XedqC3ityTmXBaiFo6XU+BvYCLxJXKgGIISBlFsUa3XHun9stZgiEvS2tJqB c2V7VJzl9oI/dcH9gtFkcVGRYpdjBvv1JA/fs71dfEQJIKiWgai6kDtaFp68iViFuVZ9 fDDrHio/GsFGtkzoOaeTa2awU0B3TPJajntqVqojl1nWz1TI9N6YuUGcC0B9WZ+H/s2n DyQxNOaBYZiwmpF3cTHRSvx1sSVKD9OIH1aybi+x0gG6g6P+f3g1EhXoQIT/IzMysxue RBgg== 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:mime-version :message-id:date:subject:cc:to:from; bh=eOOUPjBcNbBHXGhTD2CFUw0pN4SpTK7vro4FdNv89zU=; b=UztSSeRJsIBFSpX/Xgsj0Wf/7rhp4mYYJ37x6kyaFyO9HfrWoIcy5IALZ2D80ADxXu 6O4d9q8lKST3yEQz3nEAohJURnPNmqPSIDHgOmngXoTSZb4kMTy/bIx3ynYysbUAOutS kP1AblHGU/ENSoU5tJzhP1ops6rT1JfgG2tCNCZDaXnhMy6dmo5Y7Q8jlN7IrcB/Blsh 8ti9HPqsLFnOHRtMbTvhXYIIrhNM0J1gbHFIAPRH/SCeUUwoL3yqVPIwi748UMhJhbZ7 aO45p2GVIGDVAYofNCVs09pO9tOn8PPf76m4kIngU1dgRgl+rpolHMPj7aF3YL/0NsyG pIIA== 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 p11si19880148plk.191.2019.01.23.16.51.48; Wed, 23 Jan 2019 16:52:15 -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 S1726517AbfAXAvn (ORCPT + 99 others); Wed, 23 Jan 2019 19:51:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:37536 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726235AbfAXAvn (ORCPT ); Wed, 23 Jan 2019 19:51:43 -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 8AEBFAFCB; Thu, 24 Jan 2019 00:51:41 +0000 (UTC) From: Tony Jones To: linux-kernel@vger.kernel.org Cc: Seeteena Thoufeek , Ravi Bangoria , Arnaldo Carvalho de Melo , Jiri Olsa , Jonathan Corbet , linux-perf-users@vger.kernel.org, Tony Jones Subject: [PATCH 0/6] Fix issues with Python3 scripting Date: Wed, 23 Jan 2019 16:52:23 -0800 Message-Id: <20190124005229.16146-1-tonyj@suse.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Seeteena posted, earlier this week, some patches to add Python3 support to scripts/python/*.py. Unfortunately there were some issues with these patches (such as: https://lkml.org/lkml/2019/1/17/351) Since I already had a tested set of patches in openSUSE:Factory and SLE15-SP1 and was about to submit them, Seeteena and I that agreed I should post my patches not involving scripts/python/*.py and Seeteena will later resubmit the patches for scripts/python/*.py incorporating my review feedback under a joint signed-off-by. It should be noted that the use of "from __future__ import print_function" (see: https://lkml.org/lkml/2019/1/16/641) and "except as" (see change to: tests/attr.py) implies Python2 >= 2.6 as the necessary support has not been backported to prior versions. I am not sure if it's worth detecting <2.6 at build time or whether it's sufficiently old as to be a non-issue? The shebang changes were driven mostly by our build process as it scans all files within an rpm and the shebangs would result in a rpm requires on the python2 binary when BuildRequires was python3-devel. I think they make sense to apply upstream but understand totally if it's prefered we keep them local. These changes have been tested with PYTHON=python2 (v2.7) and PYTHON=python3 (v3.6) on latest openSUSE Tumbleweed. I did notice that test #18 "'import perf' in python" is failing on my system without these changes. I'll look at it further but didn't want to hold up Seeteena's resubmit. Tony Jones (6): perf script python: Add trace_context extension module to sys,modules perf script python: Use PyBytes for attr in trace-event-python perf script python: remove explicit shebang from setup.py perf script python: remove explicit shebang from tests/attr.c perf script python: remove explicit shebang from Python scripts perf script python: add Python3 support to tests/attr.py tools/perf/Makefile.perf | 4 +-- .../scripts/python/exported-sql-viewer.py | 1 - tools/perf/scripts/python/sched-migration.py | 2 -- tools/perf/scripts/python/stat-cpi.py | 1 - tools/perf/tests/attr.py | 33 +++++++++++-------- .../scripting-engines/trace-event-python.c | 9 ++--- tools/perf/util/setup.py | 2 -- 7 files changed, 26 insertions(+), 26 deletions(-) -- 2.20.1