> diff --git a/tools/testing/selftests/bpf/Makefile 
> b/tools/testing/selftests/bpf/Makefile
> index 608e6dff0392..9becc077eb23 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile

[ ... ]

> @@ -717,11 +723,14 @@ $(TRUNNER_TEST_OBJS): $(TRUNNER_OUTPUT)/%.test.o:       
>                 \
>                     $(TRUNNER_TESTS_DIR)/%.c                          \
>                     | $(TRUNNER_OUTPUT)/%.test.d
>       $$(call msg,TEST-OBJ,$(TRUNNER_BINARY),$$@)
> -     $(Q)cd $$(@D) && $$(CC) -I. $$(CFLAGS) -MMD -MT $$@ -c $(CURDIR)/$$< 
> $$(LDLIBS) -o $$(@F)
> +     $(Q)(cd $$(@D) && $$(CC) -I. $$(CFLAGS) -MMD -MT $$@ -c $(CURDIR)/$$< 
> $$(LDLIBS) -o $$(@F)) $(if $(filter test_progs%,$1),$(if $(PERMISSIVE),|| \
> +             ($(RM) $$@; printf '  %-12s %s\n' 'SKIP-TEST' '$$(notdir $$@)' 
> 1>&2)))
>       $$(if $$(TEST_NEEDS_BTFIDS),                                            
> \
> -             $$(call msg,BTFIDS,$(TRUNNER_BINARY),$$@)                       
> \
> +             $(Q)if [ -f $$@ ]; then                                         
> \
> +             $(if $(V),true,printf '  %-8s%s %s\n' "BTFIDS" " 
> [$(TRUNNER_BINARY)]" "$$(notdir $$@)"); \
>               $(RESOLVE_BTFIDS) --btf $(TRUNNER_OUTPUT)/btf_data.bpf.o $$@;   
> \
> -             $(RESOLVE_BTFIDS) --patch_btfids [email protected]_ids $$@)
> +             $(RESOLVE_BTFIDS) --patch_btfids [email protected]_ids $$@;               
> \
> +             fi)

Does this condition correctly handle V=0 or V=2?

In GNU Make, the $(if) function evaluates to true if the condition expands
to any non-empty string. If a user sets make V=0, $(V) expands to the
string "0", which Make considers true.

Consequently, $(if $(V),true,printf ...) will execute true;, silencing the
BTFIDS output entirely. The standard msg macro used for other compilation
steps explicitly checks ifeq ($(V),1).

This results in inconsistent behavior where V=0 correctly prints brief
messages like TEST-OBJ but silently skips BTFIDS.

Could this explicitly check for "1", such as using
$(if $(filter 1,$(V)),true,printf ...) to accurately match the behavior of
the msg macro?


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/25167006036

Reply via email to