Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH v1] perf build: Mention NO_* and BUILD_BPF_SKEL=0 flags in build messages
@ 2026-12-02 18:56 Ian Rogers
  2026-12-02 19:00 ` sashiko-bot
  2026-12-02 19:03 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 3+ messages in thread
From: Ian Rogers @ 2026-12-02 18:56 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim
  Cc: Jiri Olsa, Adrian Hunter, James Clark, linux-perf-users,
	linux-kernel, Ian Rogers

A few errors in Makefile.config (libelf, libtraceevent, jevents, and old
Python) already mention the corresponding NO_*=1 flag, but most optional
dependency warnings and several errors only suggest installing the
missing package. Mentioning the disable flag directly in each message
avoids having to grep the Makefiles when building without those
dependencies.

Update Makefile.config and Makefile.perf to mention the corresponding
flag in optional dependency warnings and errors:
- NO_BABELTRACE2=1, NO_LIBTRACEEVENT=1, NO_LIBBPF=1, and NO_RUST=1 in
  the remaining optional $(error ...) messages.
- NO_LIBDW=1, NO_LIBDEBUGINFOD=1, NO_LIBBPF=1, NO_SDT=1,
  BUILD_BPF_SKEL=0, NO_SLANG=1, NO_PYTHON_MODULE=1, NO_LIBLLVM=1,
  NO_LZMA=1, NO_LIBZSTD=1, NO_LIBNUMA=1, NO_BABELTRACE2=1,
  NO_CAPSTONE=1, NO_JVMTI=1, NO_LIBPFM4=1, NO_RUST=1, and NO_PYLINT=1
  in the corresponding $(warning ...) messages.

Also document NO_JEVENTS=1, NO_LIBLLVM, and NO_RUST in the top-of-file
option comments of Makefile.perf, and fix the LIBUNWIND comment which
still described it as opt-out after commit 13e17c9ff491 ("perf build:
Make libunwind opt-in rather than opt-out").

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/all/20261202141307.GL2883950@noisy.programming.kicks-ass.net/
Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/Makefile.config | 66 +++++++++++++++++++-------------------
 tools/perf/Makefile.perf   | 10 ++++--
 2 files changed, 41 insertions(+), 35 deletions(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index aed2e952c8f3..ba919b6681b8 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -200,7 +200,7 @@ FEATURE_CHECK_LDFLAGS-libdw := $(LIBDW_LDFLAGS) $(DWARFLIBS)
 
 ifneq ($(NO_BABELTRACE2),1)
   ifeq ($(call get-executable,$(PKG_CONFIG)),)
-    $(error Error: $(PKG_CONFIG) needed by babeltrace2 is missing on this system, please install it)
+    $(error Error: $(PKG_CONFIG) needed by babeltrace2 is missing on this system, please install it or build with NO_BABELTRACE2=1)
   endif
 endif
 
@@ -225,7 +225,7 @@ FEATURE_CHECK_LDFLAGS-libzstd := $(LIBZSTD_LDFLAGS)
 
 ifneq ($(NO_LIBTRACEEVENT),1)
   ifeq ($(call get-executable,$(PKG_CONFIG)),)
-    $(error Error: $(PKG_CONFIG) needed by libtraceevent is missing on this system, please install it)
+    $(error Error: $(PKG_CONFIG) needed by libtraceevent is missing on this system, please install it or build with NO_LIBTRACEEVENT=1)
   endif
 endif
 
@@ -486,7 +486,7 @@ else
   else
     ifneq ($(feature-libdw), 1)
       ifndef NO_LIBDW
-        $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.160, disables dwarf support. Please install new elfutils-devel/libdw-dev)
+        $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.160, disables dwarf support. Please install new elfutils-devel/libdw-dev or build with NO_LIBDW=1)
         NO_LIBDW := 1
       endif
     endif # Dwarf support
@@ -578,7 +578,7 @@ ifndef NO_LIBELF
       CFLAGS += -DHAVE_DEBUGINFOD_SUPPORT
       EXTLIBS += -ldebuginfod
     else
-      $(warning No elfutils/debuginfod.h found, no debuginfo server support, please install libdebuginfod-dev/elfutils-debuginfod-client-devel or equivalent)
+      $(warning No elfutils/debuginfod.h found, no debuginfo server support, please install libdebuginfod-dev/elfutils-debuginfod-client-devel or equivalent, or build with NO_LIBDEBUGINFOD=1)
     endif
   endif
 
@@ -599,11 +599,11 @@ ifndef NO_LIBELF
           $(call detected,CONFIG_LIBBPF)
           $(call detected,CONFIG_LIBBPF_DYNAMIC)
         else
-          $(error Error: No libbpf devel library found or older than v1.0, please install/update libbpf-devel)
+          $(error Error: No libbpf devel library found or older than v1.0, please install/update libbpf-devel or build with NO_LIBBPF=1)
         endif
       else
         ifeq ($(NO_ZLIB), 1)
-          $(warning Warning: Statically building libbpf not possible as zlib is missing)
+          $(warning Warning: Statically building libbpf not possible as zlib is missing, build with NO_LIBBPF=1 to silence)
           NO_LIBBPF := 1
         else
           # Libbpf will be built as a static library from tools/lib/bpf.
@@ -619,7 +619,7 @@ endif # NO_LIBELF
 
 ifndef NO_SDT
   ifneq ($(feature-sdt), 1)
-    $(warning No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev)
+    $(warning No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev, or build with NO_SDT=1)
     NO_SDT := 1;
   else
     CFLAGS += -DHAVE_SDT_EVENT
@@ -642,7 +642,7 @@ endif
 
 ifndef NO_LIBBPF
   ifneq ($(feature-bpf), 1)
-    $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.)
+    $(warning BPF API too old. Please install recent kernel headers or build with NO_LIBBPF=1. BPF support in 'perf record' is disabled.)
     NO_LIBBPF := 1
   endif
 endif
@@ -660,16 +660,16 @@ endif
 
 ifeq ($(BUILD_BPF_SKEL),1)
   ifeq ($(filter -DHAVE_LIBELF_SUPPORT, $(CFLAGS)),)
-    $(warning Warning: Disabled BPF skeletons as libelf is required by bpftool)
+    $(warning Warning: Disabled BPF skeletons as libelf is required by bpftool, build with BUILD_BPF_SKEL=0 to silence)
     BUILD_BPF_SKEL := 0
   else ifeq ($(filter -DHAVE_ZLIB_SUPPORT, $(CFLAGS)),)
-    $(warning Warning: Disabled BPF skeletons as zlib is required by bpftool)
+    $(warning Warning: Disabled BPF skeletons as zlib is required by bpftool, build with BUILD_BPF_SKEL=0 to silence)
     BUILD_BPF_SKEL := 0
   else ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
-    $(warning Warning: Disabled BPF skeletons as libbpf is required)
+    $(warning Warning: Disabled BPF skeletons as libbpf is required, build with BUILD_BPF_SKEL=0 to silence)
     BUILD_BPF_SKEL := 0
   else ifeq ($(filter -DHAVE_LIBOPENSSL_SUPPORT, $(CFLAGS)),)
-    $(warning Warning: Disabled BPF skeletons as libopenssl is required)
+    $(warning Warning: Disabled BPF skeletons as libopenssl is required, build with BUILD_BPF_SKEL=0 to silence)
     BUILD_BPF_SKEL := 0
   endif
   ifeq ($(BUILD_BPF_SKEL),1)
@@ -730,15 +730,15 @@ ifeq ($(BUILD_BPF_SKEL),1)
       CFLAGS += -DHAVE_BPF_SKEL
     else
       ifeq ($(call get-executable,$(CLANG))$(call get-executable,$(BPF_GCC)),)
-        $(warning Warning: Disabled BPF skeletons as clang ($(CLANG)) and bpf-gcc ($(BPF_GCC)) are missing)
+        $(warning Warning: Disabled BPF skeletons as clang ($(CLANG)) and bpf-gcc ($(BPF_GCC)) are missing, build with BUILD_BPF_SKEL=0 to silence)
       else ifneq ($(call get-executable,$(CLANG)),)
         ifeq ($(call version-lt3,$(CLANG_VERSION),12.0.1),1)
-          $(warning Warning: Disabled BPF skeletons as reliable BTF generation needs at least $(CLANG) version 12.0.1)
+          $(warning Warning: Disabled BPF skeletons as reliable BTF generation needs at least $(CLANG) version 12.0.1, build with BUILD_BPF_SKEL=0 to silence)
         else
-          $(warning Warning: Disabled BPF skeletons as clang is too old)
+          $(warning Warning: Disabled BPF skeletons as clang is too old, build with BUILD_BPF_SKEL=0 to silence)
         endif
       else
-        $(warning Warning: Disabled BPF skeletons as bpf-gcc ($(BPF_GCC)) needs at least version 14.0.0)
+        $(warning Warning: Disabled BPF skeletons as bpf-gcc ($(BPF_GCC)) needs at least version 14.0.0, build with BUILD_BPF_SKEL=0 to silence)
       endif
       BUILD_BPF_SKEL := 0
     endif
@@ -831,7 +831,7 @@ endif
 
 ifndef NO_SLANG
   ifneq ($(feature-libslang), 1)
-    $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev)
+    $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev, or build with NO_SLANG=1)
     NO_SLANG := 1
   endif
   ifndef NO_SLANG
@@ -888,16 +888,16 @@ ifdef NO_PYTHON_MODULE
 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 or build with NO_PYTHON_MODULE=1)
   else
     PYTHON_WORD := $(call shell-wordify,$(PYTHON))
 
     ifndef PYTHON_CONFIG
-      $(call disable-python,No 'python-config' tool was found: disables Python support - please install python-devel/python-dev)
+      $(call disable-python,No 'python-config' tool was found: disables Python support - please install python-devel/python-dev or build with NO_PYTHON_MODULE=1)
     else
 
       ifneq ($(feature-python-module), 1)
-        $(call disable-python,No 'Python.h' was found: disables Python support - please install python-devel/python-dev)
+        $(call disable-python,No 'Python.h' was found: disables Python support - please install python-devel/python-dev or build with NO_PYTHON_MODULE=1)
       else
          # The binding is built even when jevents generation is turned off
          # with NO_JEVENTS=1, which skips the check in that block below, so
@@ -916,7 +916,7 @@ else
            endif
            LANG_BINDINGS += $(obj-perf)python/perf$(PYTHON_EXTENSION_SUFFIX)
 	 else
-           $(warning Missing python setuptools, the python binding won't be built, please install python3-setuptools or equivalent)
+           $(warning Missing python setuptools, the python binding won't be built, please install python3-setuptools or equivalent, or build with NO_PYTHON_MODULE=1)
          endif
          ifeq ($(filter -fPIC,$(CFLAGS)),)
            # Building a shared library requires position independent code.
@@ -998,7 +998,7 @@ ifndef NO_LIBLLVM
     EXTLIBS += -lstdc++
     $(call detected,CONFIG_LIBLLVM)
   else
-    $(warning No libllvm 13+ found, slower source file resolution, please install llvm-devel/llvm-dev)
+    $(warning No libllvm 13+ found, slower source file resolution, please install llvm-devel/llvm-dev or build with NO_LIBLLVM=1)
     NO_LIBLLVM := 1
   endif
 endif
@@ -1031,7 +1031,7 @@ ifndef NO_LZMA
     EXTLIBS += -llzma
     $(call detected,CONFIG_LZMA)
   else
-    $(warning No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev)
+    $(warning No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev or build with NO_LZMA=1)
     NO_LZMA := 1
   endif
 endif
@@ -1044,7 +1044,7 @@ ifndef NO_LIBZSTD
     EXTLIBS += -lzstd
     $(call detected,CONFIG_ZSTD)
   else
-    $(warning No libzstd found, disables trace compression, please install libzstd-dev[el] and/or set LIBZSTD_DIR)
+    $(warning No libzstd found, disables trace compression, please install libzstd-dev[el] and/or set LIBZSTD_DIR, or build with NO_LIBZSTD=1)
     NO_LIBZSTD := 1
   endif
 endif
@@ -1057,11 +1057,11 @@ endif
 
 ifndef NO_LIBNUMA
   ifeq ($(feature-libnuma), 0)
-    $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev)
+    $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev or build with NO_LIBNUMA=1)
     NO_LIBNUMA := 1
   else
     ifeq ($(feature-numa_num_possible_cpus), 0)
-      $(warning Old numa library found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev >= 2.0.8)
+      $(warning Old numa library found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev >= 2.0.8 or build with NO_LIBNUMA=1)
       NO_LIBNUMA := 1
     else
       CFLAGS += -DHAVE_LIBNUMA_SUPPORT
@@ -1104,7 +1104,7 @@ ifndef NO_BABELTRACE2
     EXTLIBS += $(shell $(PKG_CONFIG) --libs-only-l babeltrace2-ctf-writer)
     $(call detected,CONFIG_BABELTRACE2_CTF_WRITER)
   else
-    $(warning No babeltrace2 found, disables 'perf data' CTF format support, please install libbabeltrace2-dev[el])
+    $(warning No babeltrace2 found, disables 'perf data' CTF format support, please install libbabeltrace2-dev[el] or build with NO_BABELTRACE2=1)
   endif
 endif
 
@@ -1120,7 +1120,7 @@ ifndef NO_CAPSTONE
     endif
     $(call detected,CONFIG_LIBCAPSTONE)
   else
-    msg := $(warning No libcapstone found, disables disasm engine support for 'perf script', please install libcapstone-dev/capstone-devel);
+    msg := $(warning No libcapstone found, disables disasm engine support for 'perf script', please install libcapstone-dev/capstone-devel or build with NO_CAPSTONE=1);
   endif
 endif
 
@@ -1138,7 +1138,7 @@ ifndef NO_JVMTI
     endif
   endif
   ifndef JDIR
-    $(warning No alternatives command found, you need to set JDIR= to point to the root of your Java directory)
+    $(warning No alternatives command found, you need to set JDIR= to point to the root of your Java directory or build with NO_JVMTI=1)
     NO_JVMTI := 1
   endif
 endif
@@ -1156,7 +1156,7 @@ ifndef NO_JVMTI
       endif
     endif # NO_JVMTI_CMLR
   else
-    $(warning No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-latest-openjdk-devel)
+    $(warning No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-latest-openjdk-devel, or build with NO_JVMTI=1)
     NO_JVMTI := 1
   endif
 endif
@@ -1169,7 +1169,7 @@ ifndef NO_LIBPFM4
     ASCIIDOC_EXTRA = -aHAVE_LIBPFM=1
     $(call detected,CONFIG_LIBPFM4)
   else
-    $(warning libpfm4 not found, disables libpfm4 support. Please install libpfm-devel or libpfm4-dev)
+    $(warning libpfm4 not found, disables libpfm4 support. Please install libpfm-devel or libpfm4-dev, or build with NO_LIBPFM4=1)
   endif
 endif
 
@@ -1194,7 +1194,7 @@ endif
 ifndef NO_RUST
   $(call feature_check,rust)
   ifneq ($(feature-rust), 1)
-    $(warning Rust is not found. Test workloads with rust are disabled.)
+    $(warning Rust is not found. Test workloads with rust are disabled. Please install rustc or build with NO_RUST=1.)
     NO_RUST := 1
   else
     NO_RUST := 0
@@ -1215,7 +1215,7 @@ ifndef NO_RUST
     RUST_TARGET_FLAGS_x86_64	:= x86_64-unknown-linux-gnu
 
     ifeq ($(RUST_TARGET_FLAGS_$(ARCH)),)
-      $(error Unknown rust cross compilation architecture $(ARCH))
+      $(error Unknown rust cross compilation architecture $(ARCH), build with NO_RUST=1 to disable)
     endif
 
     RUST_FLAGS += --target=$(RUST_TARGET_FLAGS_$(ARCH))
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 977c937f3086..46cb5b82116d 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -57,7 +57,7 @@ include ../scripts/utilities.mak
 #
 # Define NO_LIBELF if you do not want libelf dependency (e.g. cross-builds)
 #
-# Define LIBUNWIND if you do not want libunwind dependency for dwarf
+# Define LIBUNWIND=1 if you want libunwind dependency for dwarf
 # backtrace post unwind.
 #
 # Define NO_BACKTRACE if you do not want stack backtrace debug feature
@@ -132,6 +132,12 @@ include ../scripts/utilities.mak
 # Define NO_MYPY if you do not want to run mypy during build
 #
 # Define NO_PYLINT if you do not want to run pylint during build
+#
+# Define NO_JEVENTS=1 if you do not want to generate pmu-events from json files.
+#
+# Define NO_LIBLLVM if you do not want libLLVM support.
+#
+# Define NO_RUST if you do not want Rust test workloads.
 
 # As per kernel Makefile, avoid funny character set dependencies
 unexport LC_ALL
@@ -315,7 +321,7 @@ ifneq ($(force_fixdep),1)
   ifneq ($(PYLINT),)
     ifneq ($(shell $(PYLINT) --version 2>/dev/null | \
           awk '/^pylint / { split($$2, v, "."); print (v[1]+0 > 2 || (v[1]+0 == 2 && v[2]+0 >= 16)) }'), 1)
-      $(warning Warning: pylint version is older than 2.16.0, skipping pylint checks.)
+      $(warning Warning: pylint version is older than 2.16.0, skipping pylint checks. Build with NO_PYLINT=1 to silence.)
       override PYLINT :=
     else
       override PYLINT := PYTHONPATH=$(srctree)/tools/perf/python:$(srctree)/tools/perf/pmu-events \
-- 
2.56.1.911.g883d8bcb20-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-02 19:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 18:56 [PATCH v1] perf build: Mention NO_* and BUILD_BPF_SKEL=0 flags in build messages Ian Rogers
2026-12-02 19:00 ` sashiko-bot
2026-12-02 19:03 ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox