Linux Perf Users
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Sasha Levin <sashal@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
	linux-perf-users@vger.kernel.org,
	Namhyung Kim <namhyung@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nsc@kernel.org>,
	linux-kbuild@vger.kernel.org, Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 3/6] tools: build perf in tools_build
Date: Tue, 13 Oct 2026 17:21:25 -0300	[thread overview]
Message-ID: <as6SxXELnoIJenIX@x2> (raw)
In-Reply-To: <20261013170854.647305-1-sashal@kernel.org>

On Tue, Oct 13, 2026 at 01:08:53PM -0400, Sasha Levin wrote:
> On Mon, Oct 12, 2026 at 03:07:10PM -0700, Ian Rogers wrote:
> > On Sun, Oct 11, 2026 at 4:36 PM Sasha Levin <sashal@kernel.org> wrote:
> > > +# Every optional feature off, so the result does not depend on which
> > > +# libraries are installed
> > > +perf-flags-$(CONFIG_TOOLS_BUILD_PERF_MINIMAL) += \
> > > +       NO_LIBELF=1 NO_LIBTRACEEVENT=1 NO_JEVENTS=1 NO_LIBPYTHON=1 NO_LIBDW=1 \
> > > +       NO_LIBBPF=1 BUILD_BPF_SKEL=0 NO_SLANG=1 NO_GTK2=1 NO_AIO=1 \
> > > +       NO_BACKTRACE=1 NO_DEMANGLE=1 NO_LZMA=1 NO_LIBZSTD=1 NO_ZLIB=1 \
> > > +       NO_LIBNUMA=1 NO_LIBUNWIND=1 NO_LIBLLVM=1 NO_CAPSTONE=1 NO_LIBPFM4=1 \
> > > +       NO_SDT=1 NO_JVMTI=1 NO_LIBDEBUGINFOD=1 NO_BABELTRACE2=1 NO_RUST=1 \
> > > +       NO_SHELLCHECK=1 NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1

> > It seems unfortunate to maintain this list here, we also have a
> > minimal target as a build test here:
> > https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/tests/make?h=perf-tools-next#n123
> > I wonder we should just add support for a MINIMAL=1 variable in
> > tools/perf/Makefile.config and have that set these other variables.
 
> Yup :(
 
> What allmodconfig really wants from perf is what allmodconfig already does for
> the kernel: build everything the environment supports and skip the rest. A
> kernel option that needs something the toolchain lacks just ends up off rather
> than breaking the build.
 
> perf has no mode like that I think? A default build fails when libelf,
> libtraceevent or python is missing, so an arm64 cross build, or a native build
> without libtraceevent-dev, breaks. Turning everything off was the only way I
> found around that.
 
> Would it make sense to add such a mode to perf instead of MINIMAL=1?  A missing
> library would disable its feature with a warning rather than fail the build,
> and the mode could skip shellcheck, mypy and pylint too. allmodconfig would
> then build as much of perf as the host allows.

Alternatively using:

acme@number:~/git/perf-tools-next$ make -C tools/perf help
make: Entering directory '/home/acme/git/perf-tools-next/tools/perf'
  BUILD:   Doing 'make -j32' parallel build
Perf make targets:
  doc		- make *all* documentation (see below)
  man		- make manpage documentation (access with man <foo>)
  html		- make html documentation
  info		- make GNU info documentation (access with info <foo>)
  pdf		- make pdf documentation
  TAGS		- use etags to make tag information for source browsing
  tags		- use ctags to make tag information for source browsing
  cscope	- use cscope to make interactive browsing database

Perf install targets:
  NOTE: documentation build requires asciidoc, xmlto packages to be installed
  HINT: use "prefix" or "DESTDIR" to install to a particular
        path like "make prefix=/usr/local install install-doc"
  install	- install compiled binaries
  install-build-deps - install the development packages needed to build
  install-doc	- install *all* documentation
  install-man	- install manpage documentation
  install-html	- install html documentation
  install-info	- install GNU info documentation
  install-pdf	- install pdf documentation

  quick-install-doc	- alias for quick-install-man
  quick-install-man	- install the documentation quickly
  quick-install-html	- install the html documentation quickly

Perf maintainer targets:
  clean			- clean all binary objects and build output
make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'
acme@number:~/git/perf-tools-next$

Why is that difficult to run:

make -C tools/perf install-build-deps

To do a recommended perf build deps install?

That would be useful as it is what we expect users to do.

If that is too difficult, for some reason, there is a minimal build in
tools/perf/tests/make, that is tested since forever:

# all the NO_* variable combined
make_minimal        := NO_PYTHON_MODULE=1
make_minimal        += NO_DEMANGLE=1 NO_LIBELF=1 NO_BACKTRACE=1
make_minimal        += NO_LIBNUMA=1 NO_LIBBIONIC=1 NO_LIBDW=1
make_minimal        += NO_LIBBPF=1
make_minimal        += NO_SDT=1 NO_JVMTI=1 NO_LIBZSTD=1
make_minimal        += NO_CAPSTONE=1

- Arnaldo

  reply	other threads:[~2026-10-13 20:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 23:36 [RFC PATCH 0/6] kbuild: build the userspace tools in tools/ with the kernel Sasha Levin
2026-10-11 23:36 ` [RFC PATCH 1/6] kbuild: factor the userspace ABI flags out into KBUILD_USERABI Sasha Levin
2026-10-11 23:39   ` sashiko-bot
2026-10-13 20:31   ` Thomas Weißschuh
2026-10-11 23:36 ` [RFC PATCH 2/6] kbuild: add "make tools_build" to build userspace tools from tools/ Sasha Levin
2026-10-11 23:45   ` sashiko-bot
2026-10-13 20:38   ` Thomas Weißschuh
2026-10-11 23:36 ` [RFC PATCH 3/6] tools: build perf in tools_build Sasha Levin
2026-10-11 23:43   ` sashiko-bot
2026-10-12 22:07   ` Ian Rogers
2026-10-13 17:08     ` Sasha Levin
2026-10-13 20:21       ` Arnaldo Carvalho de Melo [this message]
2026-10-11 23:36 ` [RFC PATCH 4/6] tools: build kernel selftests " Sasha Levin
2026-10-11 23:46   ` sashiko-bot
2026-10-13 19:29   ` Shuah Khan
2026-10-13 20:41   ` Thomas Weißschuh
2026-10-11 23:36 ` [RFC PATCH 5/6] kbuild: build the tools selected in tools/Kconfig as part of "make all" Sasha Levin
2026-10-11 23:44   ` sashiko-bot
2026-10-11 23:36 ` [RFC PATCH 6/6] Documentation: describe building tools with the kernel Sasha Levin
2026-10-11 23:39   ` sashiko-bot

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=as6SxXELnoIJenIX@x2 \
    --to=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=sashal@kernel.org \
    --cc=shuah@kernel.org \
    /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