Makefile: Make BPF compilation verbose
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.
--- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
@@ -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
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_STRIPcommands in theMakefile. 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 1Perf 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
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_STRIPcommands in theMakefile. 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
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_STRIPcommands in theMakefile. 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 -O2LDFLAGS=-ggdb -znow -pie
bpftool btf dump file/sys/kernel/btf/vmlinuxformat c >bpf/vmlinux.h<--- no command herebpf/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 1Perf and RTLA use special $(QUIET_CLANG) and $(QUIET_GeNSKEL)
variables that print just CLANG file.o and GENSKELfile.bpf.hin
place of echoing the entire command if V=1 is not set; they are implemented intools/scripts/Makefile.include.Tomas