public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Makefile: Make BPF compilation verbose
@ 2025-10-24 17:21 Wander Lairson Costa
  2025-10-27  7:32 ` Tomas Glozar
  0 siblings, 1 reply; 4+ messages in thread
From: Wander Lairson Costa @ 2025-10-24 17:21 UTC (permalink / raw)
  To: williams
  Cc: linux-rt-users, Wander Lairson Costa, Derek Barbosa, John Kacur,
	Juri Lelli, Chunsheng Luo

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.

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Cc: Derek Barbosa <debarbos@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Chunsheng Luo <luochunsheng@ustc.edu>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 7234a46..0b1ad6d 100644
--- a/Makefile
+++ b/Makefile
@@ -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.
-- 
2.51.0


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

* Re: [PATCH] Makefile: Make BPF compilation verbose
  2025-10-24 17:21 [PATCH] Makefile: Make BPF compilation verbose Wander Lairson Costa
@ 2025-10-27  7:32 ` Tomas Glozar
  2025-10-27 16:28   ` Clark Williams
       [not found]   ` <CAMLffL-16SO1oue7o8Jhb+Cz-PTauAnNtFAjE=B9V8qpS+dY+g@mail.gmail.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Tomas Glozar @ 2025-10-27  7:32 UTC (permalink / raw)
  To: Wander Lairson Costa
  Cc: williams, linux-rt-users, Derek Barbosa, John Kacur, Juri Lelli,
	Chunsheng Luo

pá 24. 10. 2025 v 19:22 odesílatel Wander Lairson Costa
<wander@redhat.com> napsal:
>
> 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


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

* Re: [PATCH] Makefile: Make BPF compilation verbose
  2025-10-27  7:32 ` Tomas Glozar
@ 2025-10-27 16:28   ` Clark Williams
       [not found]   ` <CAMLffL-16SO1oue7o8Jhb+Cz-PTauAnNtFAjE=B9V8qpS+dY+g@mail.gmail.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Clark Williams @ 2025-10-27 16:28 UTC (permalink / raw)
  To: Tomas Glozar
  Cc: Wander Lairson Costa, linux-rt-users, Derek Barbosa, John Kacur,
	Juri Lelli, Chunsheng Luo

On Mon, Oct 27, 2025 at 08:32:25AM +0100, Tomas Glozar wrote:
> pá 24. 10. 2025 v 19:22 odesílatel Wander Lairson Costa
> <wander@redhat.com> napsal:
> >
> > 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

-- 
The United States Coast Guard
Ruining Natural Selection since 1790

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

* Re: [PATCH] Makefile: Make BPF compilation verbose
       [not found]   ` <CAMLffL-16SO1oue7o8Jhb+Cz-PTauAnNtFAjE=B9V8qpS+dY+g@mail.gmail.com>
@ 2025-11-03 20:56     ` Wander Lairson Costa
  0 siblings, 0 replies; 4+ messages in thread
From: Wander Lairson Costa @ 2025-11-03 20:56 UTC (permalink / raw)
  To: Clark Williams
  Cc: Tomas Glozar, linux-rt-users, Derek Barbosa, John Kacur,
	Juri Lelli, Chunsheng Luo

On Wed, Oct 29, 2025 at 10:22 AM Clark Williams <williams@redhat.com> wrote:
>
> Applied.
>

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

> Clark
>
>
> On Mon, Oct 27, 2025 at 7:32 AM Tomas Glozar <tglozar@redhat.com> wrote:
>>
>> pá 24. 10. 2025 v 19:22 odesílatel Wander Lairson Costa
>> <wander@redhat.com> napsal:
>> >
>> > 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
>>


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

end of thread, other threads:[~2025-11-03 20:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24 17:21 [PATCH] Makefile: Make BPF compilation verbose Wander Lairson Costa
2025-10-27  7:32 ` Tomas Glozar
2025-10-27 16:28   ` Clark Williams
     [not found]   ` <CAMLffL-16SO1oue7o8Jhb+Cz-PTauAnNtFAjE=B9V8qpS+dY+g@mail.gmail.com>
2025-11-03 20:56     ` Wander Lairson Costa

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