BPF List
 help / color / mirror / Atom feed
From: Quentin Monnet <quentin@isovalent.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	"David S. Miller" <davem@davemloft.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	David Beckett <david.beckett@netronome.com>,
	Jakub Kicinski <kuba@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>, Martin KaFai Lau <kafai@fb.com>,
	Shuah Khan <shuah@kernel.org>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 08/24] tools: bpftool: update bpftool-prog.rst reference
Date: Thu, 16 Sep 2021 13:12:57 +0100	[thread overview]
Message-ID: <8d5eaebb-29ac-5ee6-20ec-09d30d33dd73@isovalent.com> (raw)
In-Reply-To: <20210916133036.37c50383@coco.lan>

2021-09-16 13:30 UTC+0200 ~ Mauro Carvalho Chehab
<mchehab+huawei@kernel.org>

> [PATCH] scripts: documentation-file-ref-check: fix bpf selftests path
> 
> tools/testing/selftests/bpf/test_bpftool_synctypes.py use
> relative patches on the top of BPFTOOL_DIR:
> 
> 	BPFTOOL_DIR = os.path.join(LINUX_ROOT, 'tools/bpf/bpftool')
> 
> Change the script to automatically convert:
> 
> 	testing/selftests/bpf -> bpf/bpftool
> 
> In order to properly check the files used by such script.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> 
> diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check
> index 7187ea5e5149..2d91cfe11cd2 100755
> --- a/scripts/documentation-file-ref-check
> +++ b/scripts/documentation-file-ref-check
> @@ -144,6 +144,7 @@ while (<IN>) {
>  		if ($f =~ m/tools/) {
>  			my $path = $f;
>  			$path =~ s,(.*)/.*,$1,;
> +			$path =~ s,testing/selftests/bpf,bpf/bpftool,;
>  			next if (grep -e, glob("$path/$ref $path/../$ref $path/$fulref"));
>  		}
>  
> 
> 
> 

I tested the patch and it works well on my side.

However, this looks a bit fragile to me. There is no particular reason
to have testing/selftests/bpf point to bpf/bpftool other than to
accommodate the current case, we could imagine other selftest files
pointing to other parts of the documentation in the future. I would
instead make an exception for test_bpftool_synctypes.py specifically
(other selftest files don't usually parse documentation anyway).
Alternatively, I would look at excluding lines where the path is used in
code (tricky to detect), maybe at least when used with os.path.join():

    next if ($ln =~ m,os\.path\.join\([^\,]*\,\s*['"]$fulref,);

But I'm not familiar with documentation-file-ref-check in the first
place, so these are just my two cents.

Thanks,
Quentin

  reply	other threads:[~2021-09-16 12:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16  9:13 [PATCH 00/24] Fix some issues at documentation Mauro Carvalho Chehab
2021-09-16  9:13 ` [PATCH 06/24] libbpf: update index.rst reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 08/24] tools: bpftool: update bpftool-prog.rst reference Mauro Carvalho Chehab
2021-09-16  9:43   ` Quentin Monnet
2021-09-16 10:49     ` Mauro Carvalho Chehab
2021-09-16 10:57       ` Quentin Monnet
2021-09-16 11:30         ` Mauro Carvalho Chehab
2021-09-16 12:12           ` Quentin Monnet [this message]
2021-09-16  9:14 ` [PATCH 09/24] tools: bpftool: update bpftool-map.rst reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 10/24] bpftool: update bpftool-cgroup.rst reference Mauro Carvalho Chehab

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=8d5eaebb-29ac-5ee6-20ec-09d30d33dd73@isovalent.com \
    --to=quentin@isovalent.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=david.beckett@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox