Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp980059iob; Fri, 13 May 2022 18:26:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2P4KsWCMI6Nr3O6TnDH/gdTRVGsIWHCtWmErASBphaUUVW586lVTIvHNM+jHvKnDixc3s X-Received: by 2002:a5d:525b:0:b0:20c:e010:b9f3 with SMTP id k27-20020a5d525b000000b0020ce010b9f3mr5806930wrc.291.1652491588709; Fri, 13 May 2022 18:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652491588; cv=none; d=google.com; s=arc-20160816; b=OoTb3N9K/bPorUujeaidgVklG29OBiyRK2QF2Z/SjHTd3ilmNe47YnXQFEa2oxveKo N87Kcg9GeFXiygt2Fu0YPl16soB64Gw4keQekFAz/kePehsqAMpBy0he0xNR5vsnvhj+ tZVmm87ih/ZQdPgLZQamf2oviIBpGKhaGhNAtFt2TtqKhi2gVimALKV0fU3KKkjYa+bi FkXcaDHoaA+h6e23FfN1K0gcFrEcb67rrlnBFmF/WqqGZ3qMW5iZtB3xUsVw2YXKrL0s m8BVpzIiOfEbxaWsh7Rp053GqAUCnIG5hqlwYVOsP9Wg6dhaBcHp2ML29nsw1XvYXYJf SY1g== 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=qVIh9eUIIgdyzs1SJoX3TvDbRmqHTPcaYX9J48VmEYo=; b=pA4/H1BMMguZJY70SBXvcIMgVAllg7KxQXrPax+vWM/JPpd4TsKuIcBMvY0QTmboaO yHdCUayOeMZGbFgGiDAnWSqTzbTRU306fvfO727lsuA7IP5MJ2W0+AlmQFm/BdTiXqnY tAwiJVJ31m5fX02eHOkrmWfSrQEwFfSLdeipkL2/o7Aeqr4HftZOFGCcd54DJAk7BE3w w4h9u2Gwmy+5zNfzL50Vz1PAHo9OBG8L5SC6g0PHTd0+8qgw2dl2iuuCxDjDBzblo/j+ xyL9FIJ0pI7ERGD2oSzhbDhafQyArezKM2yr+AHV34iv7k+wZD4zBCEXWxp2te8Sjyd9 wQEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=IQmFQSH6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o2-20020a5d6842000000b0020aa9a24b54si3068023wrw.929.2022.05.13.18.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:26:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=IQmFQSH6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 91D683E23ED; Fri, 13 May 2022 16:55:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382307AbiEMP7K (ORCPT + 99 others); Fri, 13 May 2022 11:59:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380758AbiEMP7J (ORCPT ); Fri, 13 May 2022 11:59:09 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97734396AB for ; Fri, 13 May 2022 08:59:06 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id q23so12029260wra.1 for ; Fri, 13 May 2022 08:59:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qVIh9eUIIgdyzs1SJoX3TvDbRmqHTPcaYX9J48VmEYo=; b=IQmFQSH6zEf3liWAIBbXa3+BpABH8zHRqbq5EmHGss2WP4aha9h4QusTMp8GdmpFmo eIjWfO+8HhWBxjUpCbdATyYTUkb4Kbm6bAYLp3jHFYtKynJZE7GU/LsCDDLE7Q1crXsf aXZloDGrz50qFWZ9TTC9Gary/NJKVnBoJEhBodfuJwOhxl8qkYGxcsMqYzpz7yG2G0fr 7nF6rd4JHnXeVBsmgbvEzUE8nchVqjUhDVsnF2Uq7amSUJsXQaZQavJu2HkEtvBW4X16 k74Mn7uuttFKeE//SDhJ6wolBER8dnxBP/igjqopDnTt9deehsXmLURVEmww8u1rcWyt +YeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qVIh9eUIIgdyzs1SJoX3TvDbRmqHTPcaYX9J48VmEYo=; b=HaUp54Nw6GwSmAmJHQRU2BRaJlGCEbS7gNYWvrJSi51JpfltiudA+q0x1Sb0YhDq3r PrcxmGfzwqXdiq/0yGFB4wCzKLeF9hyUigE/M1yb43eti7no6ZRLJT2ijJInO6HAGYU1 7pEtGp396nWpgml5AEzvQIrTN1PVqNLtlMBRjgcO0u2ao+pm3LQ1tzxqvtxFCMbyxENP WERUrfgBICkpbgc8Ok2d70J/Nr06fCqKTWa/PqMZngKSk9eqioNX1fnwmRyMa6ULKObl 2lh4Rz9LWv1ABz8me/HdNlltdF+gkKLvTJfqeTLh+SRQp27LbKr/7yKPL37M98DwH+C/ dwSg== X-Gm-Message-State: AOAM531YJAWNF4JoQFEHLB4Nw+s56w2q96hZNM1VOWRZN0vRI10nVPK5 eOr9WGjkU9pNs4QnSrufRkpNM1/yUfgZKO2NNeDM4g== X-Received: by 2002:adf:dd0e:0:b0:20a:c689:f44a with SMTP id a14-20020adfdd0e000000b0020ac689f44amr4596502wrm.40.1652457544970; Fri, 13 May 2022 08:59:04 -0700 (PDT) MIME-Version: 1.0 References: <20220511211526.1021908-1-irogers@google.com> <20220511211526.1021908-7-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Fri, 13 May 2022 08:58:52 -0700 Message-ID: Subject: Re: [PATCH v2 6/7] perf jevents: Switch build to use jevents.py To: John Garry Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Kan Liang , Andi Kleen , Zhengjun Xing , Felix Fietkau , Qi Liu , Like Xu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Nick Forrington , Kajol Jain , James Clark , Andrew Kilroy , "Paul A . Clarke" , Will Deacon , Mathieu Poirier , ananth.narayan@amd.com, ravi.bangoria@amd.com, santosh.shukla@amd.com, sandipan.das@amd.com, Caleb Biggers , Perry Taylor , Kshipra Bopardikar , Stephane Eranian Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Fri, May 13, 2022 at 8:38 AM John Garry wrote: > > On 11/05/2022 22:15, Ian Rogers wrote: > > # jevents.py uses os.scandir and type hints present in Python 3.5 released in Sept. 2015. > > + JEVENTS_PYTHON_GOOD := $(shell $(PYTHON) -c 'import sys;print("1" if(sys.version_info.major >= 3 and sys.version_info.minor >= 5) else "0")') > > I think that many - like me - will have python 2.7, so now will find no > pmu-events generated any longer after missing this message in the build :( > > Maybe many will have python >= 3.5 - but I don't know... So Python 2 has been end-of-life for over 2 years now: https://www.python.org/doc/sunset-python-2/ There have been a number of LKML patches upgrading python to version 3. Python 3.5 has some very nice features of os.scandir and type hints, so if I set the bar lower than this it hurts the code quality. It is also at least 6 years old at this point, and so hopefully not unreasonable for a distribution to have picked it up :-) Looking at the change to C11 thread: https://lore.kernel.org/lkml/20220228103142.3301082-1-arnd@kernel.org/ It seems the motivation for picking a language version is the features it provides and compatibility. If we choose pre-Python 3.5 we get more compatibility but we lose language features. My feeling is that we shouldn't need to support things that are no longer maintained (like Python 2) but I'm less clear if Python 3.5 is sufficiently compatible for everyone's needs. I kind of hope so, hence making the patches this way. > > + ifneq ($(JEVENTS_PYTHON_GOOD), 1) > > + $(warning Python interpreter too old (older than 3.5) disabling > jevent generation) > > + NO_JEVENTS := 1 > > It is possible to flip NO_JEVENTS to be JEVENTS, i.e. no > double-negatives, like NO_JEVENTS := 0 Agreed that double negatives are bad. The NO_... pattern is kind of throughout the make files and build files. I preferred the NO_... for consistency but if there's a consensus I'm happy to change. Thanks, Ian > > + endif > > Thanks, > John