mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	"Namhyung Kim" <namhyung@kernel.org>,
	Kan Liang <kan.liang@linux.intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	Zhengjun Xing <zhengjun.xing@linux.intel.com>,
	"Felix Fietkau" <nbd@nbd.name>, Qi Liu <liuqi115@huawei.com>,
	Like Xu <likexu@tencent.com>, <linux-kernel@vger.kernel.org>,
	<linux-perf-users@vger.kernel.org>,
	Nick Forrington <nick.forrington@arm.com>,
	Kajol Jain <kjain@linux.ibm.com>,
	James Clark <james.clark@arm.com>,
	Andrew Kilroy <andrew.kilroy@arm.com>,
	"Paul A . Clarke" <pc@us.ibm.com>, Will Deacon <will@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	<ananth.narayan@amd.com>, <ravi.bangoria@amd.com>,
	<santosh.shukla@amd.com>, <sandipan.das@amd.com>,
	Caleb Biggers <caleb.biggers@intel.com>,
	Perry Taylor <perry.taylor@intel.com>,
	Kshipra Bopardikar <kshipra.bopardikar@intel.com>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH v2 6/7] perf jevents: Switch build to use jevents.py
Date: Tue, 17 May 2022 11:32:04 +0100	[thread overview]
Message-ID: <1e9d2bce-b967-dccb-e6af-241830e5b38e@huawei.com> (raw)
In-Reply-To: <CAP-5=fUAXLL0CXrfrzYV2TT_31kouvJV-FWrZsipR27tT3i+uQ@mail.gmail.com>

On 13/05/2022 16:58, Ian Rogers wrote:
> On Fri, May 13, 2022 at 8:38 AM John Garry <john.garry@huawei.com> 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.

Fine, I just think that you need to make this transition as seamless as 
possible, otherwise it can be judged as a regression.

For example, I have now python 3.6 (default) and 2.7 but it still 
doesn't seem to work:

john@localhost:~/acme/tools/perf> make
   BUILD:   Doing 'make -j4' parallel build
Warning: Kernel ABI header at 'tools/include/linux/coresight-pmu.h' 
differs from latest version at 'include/linux/coresight-pmu.h'
diff -u tools/include/linux/coresight-pmu.h include/linux/coresight-pmu.h
Makefile.config:593: No sys/sdt.h found, no SDT events are defined, 
please install systemtap-sdt-devel or systemtap-sdt-dev
Makefile.config:871: Python interpreter too old (older than 3.5) 
disabling jevent generation
Makefile.config:904: Old version of libbfd/binutils things like PE 
executable profiling will not be available
Makefile.config:1092: No openjdk development package found, please 
install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel

Auto-detecting system features:
...                         dwarf: [ on  ]
...            dwarf_getlocations: [ on  ]
...                         glibc: [ on  ]
...                        libbfd: [ OFF ]
...                libbfd-buildid: [ OFF ]
...                        libcap: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...        numa_num_possible_cpus: [ on  ]
...                       libperl: [ on  ]
...                     libpython: [ on  ]
...                     libcrypto: [ on  ]
...                     libunwind: [ on  ]
...            libdw-dwarf-unwind: [ on  ]
...                          zlib: [ on  ]
...                          lzma: [ on  ]
...                     get_cpuid: [ on  ]
...                           bpf: [ on  ]
...                        libaio: [ on  ]
...                       libzstd: [ on  ]
...        disassembler-four-args: [ on  ]


make[3]: Nothing to be done for 'install_headers'.
john@localhost:~/acme/tools/perf> python --version
Python 3.6.12
john@localhost:~/acme/tools/perf>

which I need to figure out...

> 
>>   > + 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.
> 

I have no strong preference. I just find that double negatives boggle 
the mind.

Thanks,
john

  reply	other threads:[~2022-05-17 10:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11 21:15 [PATCH v2 0/7] Rewrite jevents program in python Ian Rogers
2022-05-11 21:15 ` [PATCH v2 1/7] perf jevents: Append PMU description later Ian Rogers
2022-05-17 13:28   ` John Garry
2022-05-11 21:15 ` [PATCH v2 2/7] perf vendor events: Fix Alderlake metric groups Ian Rogers
2022-05-17 13:30   ` John Garry
2022-05-11 21:15 ` [PATCH v2 3/7] perf vendor events: Fix Ivytown UNC_M_ACT_COUNT.RD umask Ian Rogers
2022-05-17 13:31   ` John Garry
2022-05-11 21:15 ` [PATCH v2 4/7] perf jevents: Modify match field Ian Rogers
2022-05-17 13:35   ` John Garry
2022-05-23 13:09     ` Arnaldo Carvalho de Melo
2022-05-11 21:15 ` [PATCH v2 5/7] perf jevents: Add python converter script Ian Rogers
2022-05-11 21:47   ` Andi Kleen
2022-05-12  1:15     ` Ian Rogers
2022-05-11 21:15 ` [PATCH v2 6/7] perf jevents: Switch build to use jevents.py Ian Rogers
2022-05-13 15:37   ` John Garry
2022-05-13 15:58     ` Ian Rogers
2022-05-17 10:32       ` John Garry [this message]
2022-05-18  4:37         ` Ian Rogers
2022-05-11 21:15 ` [PATCH v2 7/7] perf jevents: Remove jevents.c Ian Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e9d2bce-b967-dccb-e6af-241830e5b38e@huawei.com \
    --to=john.garry@huawei.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ananth.narayan@amd.com \
    --cc=andrew.kilroy@arm.com \
    --cc=caleb.biggers@intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=kjain@linux.ibm.com \
    --cc=kshipra.bopardikar@intel.com \
    --cc=likexu@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=liuqi115@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=nbd@nbd.name \
    --cc=nick.forrington@arm.com \
    --cc=pc@us.ibm.com \
    --cc=perry.taylor@intel.com \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --cc=sandipan.das@amd.com \
    --cc=santosh.shukla@amd.com \
    --cc=will@kernel.org \
    --cc=zhengjun.xing@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome