perf build: Ubuntu LTS fixes
cover perf build: Ubuntu LTS fixes
Hi all,
This patch series is the result of getting "make tools/perf" working on Ubuntu 24.04.3 LTS.
There was one remaining issue, which I could fix manually, but I don't know a good way to auto-suggest this to the user when needed. Initially, I was greeted with:
Makefile.config:1161: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-latest-openjdk-devel
However, installing openjdk-8-jdk (or the latest version) did not help. Apparently tools/perf/Makefile.config sets JDIR to the first Java environment found. Hence if a Java environment was already installed, but it is not a full environment (e.g. just openjdk-21-jre) and lacks the <jvmti.h> header file, the build always fails. Only installing the matching full jdk version (i.e. openjdk-21-jdk in my case) can fix that.
Thanks for your comments!
Geert Uytterhoeven (2):
perf build: Fix confusing "No python interpreter needed" message perf build: Add Debian/Ubuntu python-is-python3
tools/perf/Makefile.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 12 lines
2.43.0
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus TorvaldsPATCH 1/2 perf build: Fix confusing "No python interpreter needed" message
When python is not installed, the error message sounds like python is not a dependency, while it is. Reword to make this clear.
--- tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile.config +1 -1
@@ -915,7 +915,7 @@ endif ifneq ($(NO_JEVENTS),1) NO_JEVENTS := 0 ifndef PYTHON - $(error ERROR: No python interpreter needed for jevents generation. Install python or build with NO_JEVENTS=1.) + $(error ERROR: No python interpreter found for jevents generation. Install python or build with NO_JEVENTS=1.) else # jevents.py uses f-strings present in Python 3.6 released in Dec. 2016. JEVENTS_PYTHON_GOOD := $(shell $(PYTHON) -c 'import sys;print("1" if(sys.version_info.major >= 3 and sys.version_info.minor >= 6) else "0")' 2> /dev/null)
Signature · 1 line
2.43.0
PATCH 2/2 perf build: Add Debian/Ubuntu python-is-python3
In reply to Geert UytterhoevenThe build looks for "python" and "python-config", while modern distributions provide only "python3" and "python3-config" by default. Suggest installing "python-is-python3" and "python-dev-is-python3", as available on Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal) and later.
--- tools/perf/Makefile.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/Makefile.config +2 -2
@@ -872,7 +872,7 @@ ifdef NO_LIBPYTHON else ifndef PYTHON - $(call disable-python,No python interpreter was found: disables Python support - please install python-devel/python-dev) + $(call disable-python,No python interpreter was found: disables Python support - please install python-devel/python-dev/python-dev-is-python3) else PYTHON_WORD := $(call shell-wordify,$(PYTHON))
@@ -915,7 +915,7 @@ endif ifneq ($(NO_JEVENTS),1) NO_JEVENTS := 0 ifndef PYTHON - $(error ERROR: No python interpreter found for jevents generation. Install python or build with NO_JEVENTS=1.) + $(error ERROR: No python interpreter found for jevents generation. Install python/python-is-python3 or build with NO_JEVENTS=1.) else # jevents.py uses f-strings present in Python 3.6 released in Dec. 2016. JEVENTS_PYTHON_GOOD := $(shell $(PYTHON) -c 'import sys;print("1" if(sys.version_info.major >= 3 and sys.version_info.minor >= 6) else "0")' 2> /dev/null)
Signature · 1 line
2.43.0
Re: [PATCH 2/2] perf build: Add Debian/Ubuntu python-is-python3
Hi Geert,
Quoted 5 lines · Geert Uytterhoeven
The build looks for "python" and "python-config", while modern distributions provide only "python3" and "python3-config" by default. Suggest installing "python-is-python3" and "python-dev-is-python3", as available on Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal) and later.
Seems to me, this change is not necessary. The Makefile [1] searches python[2|3]/python[2|3]-cofig if un-versioned executables are not found.
I confirmed that I can build successfully without installation python-dev-is-python3 package.
Thanks,
Leo
Re: [PATCH 2/2] perf build: Add Debian/Ubuntu python-is-python3
Hi Leo,
Quoted 7 lines · Leo Yan
Quoted 5 lines · Geert Uytterhoeven
The build looks for "python" and "python-config", while modern distributions provide only "python3" and "python3-config" by default. Suggest installing "python-is-python3" and "python-dev-is-python3", as available on Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal) and later.
Quoted 5 lines
Seems to me, this change is not necessary. The
Makefile[1] searches python[2|3]/python[2|3]-cofig if un-versioned executables are not found.I confirmed that I can build successfully without installation python-dev-is-python3 package.
$ sudo apt remove python-dev-is-python3 python-is-python3
$ make tools/perfIndeed, it still works. I am quite sure I had to install both, and even verified that uninstalling them again broke the build again before creating my patch.
/me dives deeper.
Aha, I found it. After uninstalling python3-dev, I got into the same state as yesterday:
$ make tools/perf
[...]
Makefile.config:875: No python interpreter was found: disables
Python support - please install python-devel/python-dev
Makefile.config:918: *** ERROR: No python interpreter needed for
jevents generation. Install python or build with NO_JEVENTS=1.. Stop.So these error messages sound like python is missing. And "python" is indeed missing, but "python3" is available.
Hence I installed python-is-python3, but that turned out not to be sufficient.
Hence I also installed python-dev-is-python3, and that fixed the issue, as python-dev-is-python3 depends on python3-dev, so the latter was installed, too.
After removing python-is-python3 and python-dev-is-python3, everything keeps on working. But if you never installed python3-dev manually, and run "sudo apt autoremove", python3-dev is uninstalled, reintroducing the issue.
So just recomming to install python-dev-is-python3 in the error message should be sufficient?
What do you think?
Thanks!
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Namhyung Kim
maintainerRe: [PATCH 2/2] perf build: Add Debian/Ubuntu python-is-python3
Hello,
Quoted 48 lines · Geert Uytterhoeven
Hi Leo,
Quoted 7 lines · Leo Yan
Quoted 5 lines · Geert Uytterhoeven
The build looks for "python" and "python-config", while modern distributions provide only "python3" and "python3-config" by default. Suggest installing "python-is-python3" and "python-dev-is-python3", as available on Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal) and later.
Quoted 5 lines
Seems to me, this change is not necessary. The
Makefile[1] searches python[2|3]/python[2|3]-cofig if un-versioned executables are not found.I confirmed that I can build successfully without installation python-dev-is-python3 package.
$ sudo apt remove python-dev-is-python3 python-is-python3 $ make tools/perfIndeed, it still works. I am quite sure I had to install both, and even verified that uninstalling them again broke the build again before creating my patch.
/me dives deeper.
Aha, I found it. After uninstalling python3-dev, I got into the same state as yesterday:
$ make tools/perf [...] Makefile.config:875: No python interpreter was found: disables Python support - please install python-devel/python-dev Makefile.config:918: *** ERROR: No python interpreter needed for jevents generation. Install python or build with NO_JEVENTS=1.. Stop.So these error messages sound like python is missing. And "python" is indeed missing, but "python3" is available.
Hence I installed python-is-python3, but that turned out not to be sufficient.
Hence I also installed python-dev-is-python3, and that fixed the issue, as python-dev-is-python3 depends on python3-dev, so the latter was installed, too.After removing python-is-python3 and python-dev-is-python3, everything keeps on working. But if you never installed python3-dev manually, and run "sudo apt autoremove", python3-dev is uninstalled, reintroducing the issue.
Quoted 5 lines
So just recomming to install python-dev-is-python3 in the error message should be sufficient?
What do you think?
Thanks!
Thanks for looking at the issue.
I think the code was to deal with either python2 or python3 in the past and we removed python2 support recently. I don't know if any distro made 'python' to refer python3 and removed 'python3' otherwise we can just check python3.
Thanks,
Namhyung
Re: [PATCH 2/2] perf build: Add Debian/Ubuntu python-is-python3
On Sun, Oct 19, 2025 at 11:49:56AM +0900, Namhyung Kim wrote:
[...]
Quoted 23 lines
Quoted 23 lines
Aha, I found it. After uninstalling python3-dev, I got into the same state as yesterday:
$ make tools/perf [...] Makefile.config:875: No python interpreter was found: disables Python support - please install python-devel/python-dev Makefile.config:918: *** ERROR: No python interpreter needed for jevents generation. Install python or build with NO_JEVENTS=1.. Stop.So these error messages sound like python is missing. And "python" is indeed missing, but "python3" is available.
Hence I installed python-is-python3, but that turned out not to be sufficient.
Hence I also installed python-dev-is-python3, and that fixed the issue, as python-dev-is-python3 depends on python3-dev, so the latter was installed, too.After removing python-is-python3 and python-dev-is-python3, everything keeps on working. But if you never installed python3-dev manually, and run "sudo apt autoremove", python3-dev is uninstalled, reintroducing the issue.
Quoted 4 lines
Quoted 4 lines
So just recomming to install python-dev-is-python3 in the error message should be sufficient?
What do you think?
Can we explicitly suggest that developers install python3-devel or python3-dev instead? Two reasons:
- python-dev-is-python3 is specific to Ubuntu/Debian; some distros do not provide this package and even advocate against using unversioned "/usr/bin/python" shebangs [1].
- As Namhyung mentioned, perf has removed Python 2 support (at least this is claimed), it is straightforward to install only the Python3 packages.
[...]
Quoted 4 lines
I think the code was to deal with either python2 or python3 in the past and we removed python2 support recently. I don't know if any distro made 'python' to refer python3 and removed 'python3' otherwise we can just check python3.
I agreed with only checking python3 - neat and compatible for distros.
Just note, some legacy python shebangs are left, we can update to "#!/usr/bin/env python3" but this can be done separately.
$ git grep "#\!.*/usr/bin.*python" python/tracepoint.py:#! /usr/bin/env python python/twatch.py:#! /usr/bin/env python scripts/python/export-to-postgresql.py:# #!/usr/bin/python2 scripts/python/exported-sql-viewer.py:#!/usr/bin/env python scripts/python/libxed.py:#!/usr/bin/env python tests/shell/lib/perf_json_output_lint.py:#!/usr/bin/python
Thanks,
Leo
[1] https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package#Motivation
Re: [PATCH 2/2] perf build: Add Debian/Ubuntu python-is-python3
Hi Leo,
Quoted 32 lines · Leo Yan
Quoted 23 lines · Namhyung Kim
Quoted 23 lines
Aha, I found it. After uninstalling python3-dev, I got into the same state as yesterday:
$ make tools/perf [...] Makefile.config:875: No python interpreter was found: disables Python support - please install python-devel/python-dev Makefile.config:918: *** ERROR: No python interpreter needed for jevents generation. Install python or build with NO_JEVENTS=1.. Stop.So these error messages sound like python is missing. And "python" is indeed missing, but "python3" is available.
Hence I installed python-is-python3, but that turned out not to be sufficient.
Hence I also installed python-dev-is-python3, and that fixed the issue, as python-dev-is-python3 depends on python3-dev, so the latter was installed, too.After removing python-is-python3 and python-dev-is-python3, everything keeps on working. But if you never installed python3-dev manually, and run "sudo apt autoremove", python3-dev is uninstalled, reintroducing the issue.
Quoted 4 lines
Quoted 4 lines
So just recomming to install python-dev-is-python3 in the error message should be sufficient?
What do you think?
Can we explicitly suggest that developers install python3-devel or python3-dev instead? Two reasons:
Quoted 7 lines
- python-dev-is-python3 is specific to Ubuntu/Debian; some distros do not provide this package and even advocate against using unversioned "
/usr/bin/python" shebangs [1].- As Namhyung mentioned, perf has removed Python 2 support (at least this is claimed), it is straightforward to install only the Python3 packages.
Suggesting python3-dev sounds good to me.
None of the two checks:
ifndef PYTHON
$(call disable-python,No python interpreter was found: disablesPython support - please install python-devel/python-dev)
ifndef PYTHON
$(error ERROR: No python interpreter found for jeventsgeneration. Install python or build with NO_JEVENTS=1.)
seem to be about the python interpreter anyway, but about the python development environment.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 2/2] perf build: Add Debian/Ubuntu python-is-python3
Hi Geert,
On Mon, Oct 20, 2025 at 12:15:22PM +0200, Geert Uytterhoeven wrote:
[...]
Quoted 7 lines
Quoted 7 lines
Can we explicitly suggest that developers install python3-devel or python3-dev instead? Two reasons:
- python-dev-is-python3 is specific to Ubuntu/Debian; some distros do not provide this package and even advocate against using unversioned "
/usr/bin/python" shebangs [1].
Quoted 5 lines
Quoted 3 lines
- As Namhyung mentioned, perf has removed Python 2 support (at least this is claimed), it is straightforward to install only the Python3 packages.
Suggesting python3-dev sounds good to me.
It is good to mention both python3-devel / python3-dev (one is for Fedora and another is for Debian/Ubuntu). Sorry for confusion.
Quoted 4 lines
None of the two checks:
ifndef PYTHON $(call disable-python,No python interpreter was found: disables
Quoted 8 lines
Python support - please install python-devel/python-dev)
ifndef PYTHON $(error ERROR: No python interpreter found for jeventsgeneration. Install python or build with NO_JEVENTS=1.)
seem to be about the python interpreter anyway, but about the python development environment.
Either is fine for me.
Thanks,
Leo
Quoted 10 lines
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds