Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp5330078rwb; Wed, 17 Aug 2022 15:47:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR4VtOXcMeaFFam+nTSfN3mV//stcxMAV3XfdZw0GqUo3AWOfcs9PLEy4YveNVOWefV8ZhGY X-Received: by 2002:a17:907:160f:b0:731:55b2:1c1f with SMTP id hb15-20020a170907160f00b0073155b21c1fmr106504ejc.731.1660776476439; Wed, 17 Aug 2022 15:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660776476; cv=none; d=google.com; s=arc-20160816; b=oydbNEBvbMYmb6J4NqersRBOkchyQO/fLRm8dqlnh3F3hHyAX7sAgdA+w7N1i9NWOg NTVTP3rERXut3+AhpK8AHMMiQg5ySWcWwCluNm+OcYqNmINXEkn4JaLlxO4stTjPwWjN LJJhUhy3+3SlioEuZ2f6ftcjObs84aaBJfrdTeZUvO3L65cXCAM5UWh5lRzdaP1YZen9 NGE/ZF5E4b8tYxN0N02Y+xpJ5YseBA+Au3drpjEOkmtiFqNSuW64JLQbGjjyGOusclw0 SfSmLBCK8pwjo5i9RyL08X8pMrtUXydnwMAJZKlgprzTAJjGbFgGin5rcKGUMFBFtfDY HXfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SDWaMYet1cn5tTWa6VqUAIapnHAkbX2SDmUgYWXOSHQ=; b=00ODrQwL3TdHk9yxEnoLAzbaF9Y6x/5vpMJwtDlE5wjg82eXtR8decTYszFFhHg8X2 TNPU0snGJSYY6W8+cUe+mfkKHOWT/PE6DrW+cEJ8bj9/La1THcYYnJ3Ad05ardtVdH9m DOUJcjDsRXz//CUm1E3jARpwoKlq3O0CgcC71gEQuJxgAYHYu39ZtntnBkJMxy8y3qL6 sTebf9QDRnWb7AQxbfyr0cL5gRkp+x61m3jqPrmlDjgbaOe9kYO8rzS3swUJN1nOBrNu Xb/LOz55l6iFk98GhPkpxyqjQJopV+vyeNYT8ZT2qjPmdLOyQRXaWaBxfmZJ7OKSpKUN VxVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=cJxcIgHO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb35-20020a170907162300b00718d0604af4si14019648ejc.604.2022.08.17.15.47.24; Wed, 17 Aug 2022 15:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=cJxcIgHO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235407AbiHQWhJ (ORCPT + 99 others); Wed, 17 Aug 2022 18:37:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231496AbiHQWhH (ORCPT ); Wed, 17 Aug 2022 18:37:07 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A2A2DFF8 for ; Wed, 17 Aug 2022 15:37:03 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id h24so3654824wrb.8 for ; Wed, 17 Aug 2022 15:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=SDWaMYet1cn5tTWa6VqUAIapnHAkbX2SDmUgYWXOSHQ=; b=cJxcIgHOBjsIi8gQTDFbQJXNLH8MW+M32YQkEB+DYuv45XL3SHfOUhyrJR2eFdg9Ug 3oNF7fbSC3YoXOWhAX6v0zOkBYybOX4KeVpj+jeynKFCxnE7DdXC4Qd1AUWtyd2I7X7o DrjgdqeikaFxhoNNUV5rPAN8wdxMB11w7cVNDKH8XfAOT1swzWWXKux+fY0i/Pacbt86 YnnUHnfPOa0rt4tsssRtUqwSF9xZV41jzBQkN+XEDIETiQIISR84iqWFhWAoEJsU46bv Bg1v3K6luUz7xwmajDS7BKyfMSVNZvpJnlzTyq5txQ5rzZpNoFy+1p7ZXVo9QM6VJ+pZ sv6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=SDWaMYet1cn5tTWa6VqUAIapnHAkbX2SDmUgYWXOSHQ=; b=eZzP7auwMSSzo91tQtN/AUB+ohXdv+QKB/MseNa2WxZxwg+pd5DzQdeo7HTSYr8KBW BBsMuoMORuipiWsg3LCgOFpp1iLqYuTNuOkS6CMogbcxm3jvIBa9kXE5LK/dWZNTe4i0 W5y/mVaYGejyFndBotyJPjijhCJYtBOFpaohgIgwgvy4XR3PyXAAcR5xjwm2t5kznj0d GrDTxx/tk3E86EYk3ZvNXymtCcCdPa2IHsypg9icA4/yzhWvtwWjllk3z7WUxXHRhuB/ 1nTX2BhdvaYeuiidSedmiavpDr1PbasYRnlY8Um1xRTEK48Pxr+qYxPI3LYYgKZyY3lO as9A== X-Gm-Message-State: ACgBeo0QJfxCwx1X+1e4NEQOP43Oslm+tBrjVjbxfhU02t8EXY4jJVSb ANVHa6CYIxQguOqL7k8AtFBxdnphzsl7xhT7kuO7UA== X-Received: by 2002:a05:6000:1a87:b0:222:2c85:2f5b with SMTP id f7-20020a0560001a8700b002222c852f5bmr83226wry.654.1660775821832; Wed, 17 Aug 2022 15:37:01 -0700 (PDT) MIME-Version: 1.0 References: <20220725104220.1106663-1-leo.yan@linaro.org> <11781d7e-d9de-f889-ff57-9d26d92ada44@netscape.net> <16cb5f73-ac85-5094-3cd1-ec91cb47fb99@netscape.net> In-Reply-To: <16cb5f73-ac85-5094-3cd1-ec91cb47fb99@netscape.net> From: Ian Rogers Date: Wed, 17 Aug 2022 15:36:49 -0700 Message-ID: Subject: Re: [PATCH] perf scripts python: Let script to be python2 compliant To: Chuck Zmudzinski Cc: Arnaldo Carvalho de Melo , Alan Bartlett , Leo Yan , Peter Zijlstra , Ingo Molnar , linux-perf-users@vger.kernel.org, ElRepo , Akemi Yagi , Jiri Olsa , Mark Rutland , Alexander Shishkin , Namhyung Kim , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 17, 2022 at 3:13 PM Chuck Zmudzinski wrote: > > On 8/17/2022 3:52 PM, Chuck Zmudzinski wrote: > > On 7/26/22 4:43 PM, Ian Rogers wrote: > > > On Tue, Jul 26, 2022 at 12:43 PM Arnaldo Carvalho de Melo > > > wrote: > > > > > > > > Em Tue, Jul 26, 2022 at 10:52:31AM -0700, Ian Rogers escreveu: > > > > > On Tue, Jul 26, 2022 at 9:57 AM Alan Bartlett wrote: > > > > > > > > > > > > On Mon, 25 Jul 2022 at 16:51, Arnaldo Carvalho de Melo wrote: > > > > > > > > > > > > > > Em Mon, Jul 25, 2022 at 06:42:20PM +0800, Leo Yan escreveu: > > > > > > > > The mainline kernel can be used for relative old distros, e.g. RHEL 7. > > > > > > > > The distro doesn't upgrade from python2 to python3, this causes the > > > > > > > > building error that the python script is not python2 compliant. > > > > > > > > > > > > > > > > To fix the building failure, this patch changes from the python f-string > > > > > > > > format to traditional string format. > > > > > > > > > > > > > > Thanks, applied. > > > > > > > > > > > > > > - Arnaldo > > > > > > > > > > > > Leo / Arnaldo, > > > > > > > > > > > > Applying the patch on top of -5.19-rc8 fixes the problem that we (the > > > > > > ELRepo Project) experienced when attempting to build on RHEL7. > > > > > > > > > > > > So -- > > > > > > > > > > > > Tested-by: Alan Bartlett > > > > > > > > > > > > Hopefully you will get it to Linus in time for -5.19 GA. > > > > > > > > > So I'm somewhat concerned about perf supporting unsupported > > > > > distributions and this holding the code base back. RHEL7 was launched > > > > > 8 years ago (June 10, 2014) and full support ended 3 years ago (August > > > > > 6, 2019) [1]. Currently RHEL7 is in "Maintenance Support or > > > > > Maintenance Support 2" phase which is defined to mean [2]: > > > > > > > > > > ``` > > > > > During the Maintenance Support Phase for Red Hat Enterprise Linux > > > > > Version 8 & 9, and Maintenance Support 2 Phase for Red Hat Enterprise > > > > > Linux version 7, Red Hat defined Critical and Important impact > > > > > Security Advisories (RHSAs) and selected (at Red Hat discretion) > > > > > Urgent Priority Bug Fix Advisories (RHBAs) may be released as they > > > > > become available. Other errata advisories may be delivered as > > > > > appropriate. > > > > > > > > > > New functionality and new hardware enablement are not planned for > > > > > availability in the Maintenance Support (RHEL 8 & 9) Phase and > > > > > Maintenance Support 2 (RHEL 7) Phase. > > > > > ``` > > > > > > > > > > >From this definition, why would RHEL7 pick up a new perf tool? I don't > > > > > think they would and as such we don't need to worry about supporting > > > > > it. RHEL8 defaults to python 3 and full support ends for it next year. > > > > > Let's set the bar at RHEL8 and not worry about RHEL7 breakages like > > > > > this in future. I think the bar for caring should be "will the distro > > > > > pick up our code", if we don't do this then we're signing up to not > > > > > allowing tools to update for 10 years! If someone is building a kernel > > > > > and perf tool on RHEL7 then they should be signing up to also deal > > > > > with tool chain issues, which in this case can mean installing > > > > > python3. > > > > > > > > In this specific supporting things that people report using, like was > > > > done in this case, isn't such a big problem. > > > > > > So there are linters will fire for this code and say it is not > > > pythonic. It is only a linter warning vs asking to support an 8 year > > > old out of support distribution. There are other cases, such as > > > improving the C code structure, where we've failed to land changes > > > because of build errors on old distributions. This could indicate perf > > > code is wrong or the distribution is wrong. I'm saying that if we > > > believe in the perf code being correct and the distribution is out of > > > support, then we should keep the perf code as-is and the issue is one > > > for user of the out-of-support distribution. > > > > > > > Someone reported a problem in a system they used, the author of the code > > > > in question posted a patch allowing perf to be used in such old systems, > > > > doesn't get in the way of newer systems, small patch, merged, life goes > > > > on. > > > > Considering the proposed patch, can you be sure that replacing the > > f-string format with the legacy format won't cause a regression for > > some python3 user somewhere when this hits the real world? Even > > if it does not cause a regression today, as new versions and features > > are added to python3, can you be sure none of those new features > > will depend on the upgrade from the legacy format to the f-string > > format here to work properly? So many regressions happen because > > the people who write patches cannot possibly foresee how their > > patch is going to affect the millions of Linux users out there, but still > > they are certain it will not cause a regression somewhere. So how > > can the chances that this patch will cause a regression be minimized? > > > > It seems to me for this to be suitable for the Linux kernel, the > > default should be to use the modern python3 format and only > > enable python2 compatibility via a sysctl setting and/or kernel boot > > option for those who are still using python2. There should be no > > change to the behavior of the kernel for users who have upgraded > > to python3. But I don't see any such consideration for python3 > > users in this patch. > > Sorry, I didn't see this is a script, LOL! So obviously a sysctl or boot option > does not apply. But can't the script implement this simple logic: > > If python version = 3 use f-string format > if python version = 2 use traditional string format Doing this in the script would be noisy, having two scripts less than ideal. I'd suggest we wait two weeks, declare the official death of RHEL7 without "rpm -i python3" and then revert the python3 to python2 patch. There are plenty of things to worry about and python2 shouldn't be one of them (it died over 2 years ago). Thanks, Ian > Best regards, > > Chuck