Skip to contentSkip to conversation

Makefile: Make BPF compilation verbose

PATCH In review Wander Lairson Costa 3 participants 4 messages Oct 24, 2025 – Nov 3, 2025 1 message not in the archive Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Make BPF compilation verbose

Remove the '@' prefix from the CLANG and LLVM_STRIP commands in the Makefile. This makes the build system print the commands to the console during the BPF compilation process. This increased verbosity is useful for debugging build issues.

Cc Derek Barbosa <[email protected]>
Cc John Kacur <[email protected]>
Cc Juri Lelli <[email protected]>
Cc Chunsheng Luo <[email protected]>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 7234a46..0b1ad6d 100644
@@ -154,9 +154,9 @@ bpf/vmlinux.h:
 # The .bpf.c needs to be transformed into the .bpf.o.
 # The .bpf.o is then required to build the .skel.h.
 bpf/stalld.bpf.o: bpf/vmlinux.h bpf/stalld.bpf.c
-	@$(CLANG) -g -O2 -target bpf $(CLANGARCH) -DDEBUG_STALLD=$(DEBUG) -D__TARGET_ARCH_$(ARCH) \
+	$(CLANG) -g -O2 -target bpf $(CLANGARCH) -DDEBUG_STALLD=$(DEBUG) -D__TARGET_ARCH_$(ARCH) \
 		$(INCLUDES) $(CLANG_BPF_SYS_INCLUDES) -c $(filter %.c,$^) -o $@
-	@$(LLVM_STRIP) -g $@ # strip useless DWARF info
+	$(LLVM_STRIP) -g $@ # strip useless DWARF info
 
 # This is the second step: The .bpf.o object is translated into
 # a bytecode that is embedded into the .skel.h header.
Signature · 1 line
2.51.0
#1 lore raw

pá 24. 10. 2025 v 19:22 odesílatel Wander Lairson Costa <[email protected]> napsal:

Quoted 6 lines

Remove the '@' prefix from the CLANG and LLVM_STRIP commands in the Makefile. This makes the build system print the commands to the console during the BPF compilation process. This increased verbosity is useful for debugging build issues.

This makes sense, since the BPF program compilation can fail, in that case, it is not clear where the error is coming from:

$ make
ARCH=x86_64
GCC_VER=15
IS_MINVER= true
USE_BPF=1
FCF_PROTECTION=-fcf-protection
MTUNE=-mtune=generic
CFLAGS=-DVERSION=\"1.24.1\" -flto=auto -ffat-lto-objects -fexceptions
-fstack-protector-strong -fasynchronous-unwind-tables
-fstack-clash-protection -fno
-omit-frame-pointer -fcf-protection -fpie -mtune=generic -m64
-mno-omit-leaf-frame-pointer -Wall -Werror=format-security -DUSE_BPF=1
-D_FORTIFY_SOURCE=3
-D_GLIBCXX_ASSERTIONS -DDEBUG_STALLD=0 -g -O2
LDFLAGS=-ggdb -znow -pie
bpftool btf dump file /sys/kernel/btf/vmlinux format c > bpf/vmlinux.h
<--- no command here
bpf/stalld.bpf.c:17:1: error: unknown type name 'c'
  17 | c
     | ^
bpf/stalld.bpf.c:162:37: error: use of undeclared identifier
'stalld_per_cpu_data'
 162 |         stalld_data = bpf_map_lookup_elem(&stalld_per_cpu_data, &key);
     |                                            ^
2 errors generated.
make: *** [Makefile:157: bpf/stalld.bpf.o] Chyba 1

Perf and RTLA use special $(QUIET_CLANG) and $(QUIET_GeNSKEL)
variables that print just CLANG file.o and GENSKEL file.bpf.h in
place of echoing the entire command if V=1 is not set; they are implemented in tools/scripts/Makefile.include.

Tomas

#2 lore raw
Quoted 12 lines · Tomas Glozar

pá 24. 10. 2025 v 19:22 odesílatel Wander Lairson Costa <[email protected]> napsal:

Quoted 6 lines

Remove the '@' prefix from the CLANG and LLVM_STRIP commands in the Makefile. This makes the build system print the commands to the console during the BPF compilation process. This increased verbosity is useful for debugging build issues.

This makes sense, since the BPF program compilation can fail, in that case, it is not clear where the error is coming from:

I'm good with this change.

I would ask in the future if we could add 'stalld' to the subject line text for easy filtering.

Clark

Signature · 2 lines
The United States Coast Guard
Ruining Natural Selection since 1790

A message that is not in the archive (sent off-list or not yet received): CAMLffL-16SO1oue7o8Jhb+Cz-PTauAnNtFAjE=B9V8qpS+dY+g@mail.gmail.com

#4 lore raw
Quoted 3 lines · Clark Williams

Applied.

I don't see it in main:
https://git.kernel.org/pub/scm/utils/stalld/stalld.git/log/?h=main

Quoted 51 lines

Clark

Quoted 47 lines · Tomas Glozar

pá 24. 10. 2025 v 19:22 odesílatel Wander Lairson Costa <[email protected]> napsal:

Quoted 6 lines

Remove the '@' prefix from the CLANG and LLVM_STRIP commands in the Makefile. This makes the build system print the commands to the console during the BPF compilation process. This increased verbosity is useful for debugging build issues.

This makes sense, since the BPF program compilation can fail, in that case, it is not clear where the error is coming from:

$ make
ARCH=x86_64
GCC_VER=15
IS_MINVER= true
USE_BPF=1
FCF_PROTECTION=-fcf-protection
MTUNE=-mtune=generic
CFLAGS=-DVERSION=\"1.24.1\" -flto=auto -ffat-lto-objects -fexceptions
(quoted diff) +0 -6
-fstack-protector-strong -fasynchronous-unwind-tables
-fstack-clash-protection -fno
-omit-frame-pointer -fcf-protection -fpie -mtune=generic -m64
-mno-omit-leaf-frame-pointer -Wall -Werror=format-security -DUSE_BPF=1
-D_FORTIFY_SOURCE=3
-D_GLIBCXX_ASSERTIONS -DDEBUG_STALLD=0 -g -O2

LDFLAGS=-ggdb -znow -pie
bpftool btf dump file /sys/kernel/btf/vmlinux format c > bpf/vmlinux.h <--- no command here
bpf/stalld.bpf.c:17:1: error: unknown type name 'c'
17 | c

     | ^

bpf/stalld.bpf.c:162:37: error: use of undeclared identifier 'stalld_per_cpu_data'
162 | stalld_data = bpf_map_lookup_elem(&stalld_per_cpu_data, &key);
| ^
2 errors generated.
make: *** [Makefile:157: bpf/stalld.bpf.o] Chyba 1

Perf and RTLA use special $(QUIET_CLANG) and $(QUIET_GeNSKEL)
variables that print just CLANG file.o and GENSKEL file.bpf.h in
place of echoing the entire command if V=1 is not set; they are implemented in tools/scripts/Makefile.include.

Tomas