All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Jiayuan Chen <mrpre@163.com>
Cc: bpf@vger.kernel.org, martin.lau@linux.dev, ast@kernel.org,
	edumazet@google.com, jakub@cloudflare.com, davem@davemloft.net,
	dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	linux-kernel@vger.kernel.org, song@kernel.org,
	john.fastabend@gmail.com, andrii@kernel.org, mhal@rbox.co,
	yonghong.song@linux.dev, daniel@iogearbox.net,
	xiyou.wangcong@gmail.com, horms@kernel.org, eddyz87@gmail.com,
	mykolal@fb.com, kpsingh@kernel.org, sdf@fomichev.me,
	haoluo@google.com, shuah@kernel.org, pulehui@huawei.com
Subject: Re: [PATCH bpf-next v2] selftests/bpf: avoid generating untracked files when running bpf selftests
Date: Sun, 29 Dec 2024 22:40:58 +0100	[thread overview]
Message-ID: <Z3HB6mUNW6beUkwz@krava> (raw)
In-Reply-To: <20241224075957.288018-1-mrpre@163.com>

On Tue, Dec 24, 2024 at 03:59:57PM +0800, Jiayuan Chen wrote:
> Currently, when we run the BPF selftests with the following command:
> 'make -C tools/testing/selftests TARGETS=bpf SKIP_TARGETS=""'
> 
> The command generates untracked files and directories with make version
> less than 4.4:
> '''
> Untracked files:
>   (use "git add <file>..." to include in what will be committed)
> 	tools/testing/selftests/bpfFEATURE-DUMP.selftests
> 	tools/testing/selftests/bpffeature/
> '''
> We lost slash after word "bpf".
> 
> The reason is slash appending code is as follow:
> '''
> OUTPUT := $(OUTPUT)/
> $(eval include ../../../build/Makefile.feature)
> OUTPUT := $(patsubst %/,%,$(OUTPUT))
> '''
> 
> This way of assigning values to OUTPUT will never be effective for the
> variable OUTPUT provided via the command argument [1] and bpf makefile
> is called from parent Makfile(tools/testing/selftests/Makefile) like:
> '''
> all:
>   ...
> 	$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET
> '''
> 
> According to GNU make, we can use override Directive to fix this issue [2].
> 
> [1]: https://www.gnu.org/software/make/manual/make.html#Overriding
> [2]: https://www.gnu.org/software/make/manual/make.html#Override-Directive
> Fixes: dc3a8804d790 ("selftests/bpf: Adapt OUTPUT appending logic to lower versions of Make")
> 
> Signed-off-by: Jiayuan Chen <mrpre@163.com>

lgtm, tested with make 4.3

Acked-by: Jiri Olsa <jolsa@kernel.org>

jirka


> 
> ---
> v1->v2: fix patchwork check fail.
> ---
> ---
>  tools/testing/selftests/bpf/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 9e870e519c30..eb4d21651aa7 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -202,9 +202,9 @@ ifeq ($(shell expr $(MAKE_VERSION) \>= 4.4), 1)
>  $(let OUTPUT,$(OUTPUT)/,\
>  	$(eval include ../../../build/Makefile.feature))
>  else
> -OUTPUT := $(OUTPUT)/
> +override OUTPUT := $(OUTPUT)/
>  $(eval include ../../../build/Makefile.feature)
> -OUTPUT := $(patsubst %/,%,$(OUTPUT))
> +override OUTPUT := $(patsubst %/,%,$(OUTPUT))
>  endif
>  endif
>  
> -- 
> 2.43.5
> 

  reply	other threads:[~2024-12-29 21:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-24  7:59 [PATCH bpf-next v2] selftests/bpf: avoid generating untracked files when running bpf selftests Jiayuan Chen
2024-12-29 21:40 ` Jiri Olsa [this message]
2025-01-06 14:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z3HB6mUNW6beUkwz@krava \
    --to=olsajiri@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=haoluo@google.com \
    --cc=horms@kernel.org \
    --cc=jakub@cloudflare.com \
    --cc=john.fastabend@gmail.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mhal@rbox.co \
    --cc=mrpre@163.com \
    --cc=mykolal@fb.com \
    --cc=pabeni@redhat.com \
    --cc=pulehui@huawei.com \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.