linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Quentin Monnet <quentin@isovalent.com>
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:30:36 +0200	[thread overview]
Message-ID: <20210916133036.37c50383@coco.lan> (raw)
In-Reply-To: <33d66a49-2fc0-57a1-c1e5-34e932bcc237@isovalent.com>

Em Thu, 16 Sep 2021 11:57:51 +0100
Quentin Monnet <quentin@isovalent.com> escreveu:

> 2021-09-16 12:49 UTC+0200 ~ Mauro Carvalho Chehab
> <mchehab+huawei@kernel.org>
> > Hi Quentin,
> > 
> > Em Thu, 16 Sep 2021 10:43:45 +0100
> > Quentin Monnet <quentin@isovalent.com> escreveu:
> >   
> >> 2021-09-16 11:14 UTC+0200 ~ Mauro Carvalho Chehab
> >> <mchehab+huawei@kernel.org>  
> >>> The file name: Documentation/bpftool-prog.rst
> >>> should be, instead: tools/bpf/bpftool/Documentation/bpftool-prog.rst.
> >>>
> >>> Update its cross-reference accordingly.
> >>>
> >>> Fixes: a2b5944fb4e0 ("selftests/bpf: Check consistency between bpftool source, doc, completion")
> >>> Fixes: ff69c21a85a4 ("tools: bpftool: add documentation")    
> >>
> >> Hi,
> >> How is this a fix for the commit that added the documentation in bpftool?
> >>  
> >>> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> >>> ---
> >>>  tools/testing/selftests/bpf/test_bpftool_synctypes.py | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/tools/testing/selftests/bpf/test_bpftool_synctypes.py b/tools/testing/selftests/bpf/test_bpftool_synctypes.py
> >>> index be54b7335a76..27a2c369a798 100755
> >>> --- a/tools/testing/selftests/bpf/test_bpftool_synctypes.py
> >>> +++ b/tools/testing/selftests/bpf/test_bpftool_synctypes.py
> >>> @@ -374,7 +374,7 @@ class ManProgExtractor(ManPageExtractor):
> >>>      """
> >>>      An extractor for bpftool-prog.rst.
> >>>      """
> >>> -    filename = os.path.join(BPFTOOL_DIR, 'Documentation/bpftool-prog.rst')
> >>> +    filename = os.path.join(BPFTOOL_DIR, 'tools/bpf/bpftool/Documentation/bpftool-prog.rst')
> >>>  
> >>>      def get_attach_types(self):
> >>>          return self.get_rst_list('ATTACH_TYPE')
> >>>     
> >>
> >> No I don't believe it should. BPFTOOL_DIR already contains
> >> 'tools/bpf/bpftool' and the os.path.join() concatenates the two path
> >> fragments.
> >>
> >> Where is this suggestion coming from? Did you face an issue with the script?  
> > 
> > No, I didn't face any issues with this script.
> > 
> > The suggestion cames from the script at:
> > 
> > 	./scripts/documentation-file-ref-check
> > 
> > which is meant to discover broken doc references. 
> > 
> > Such script has already a rule to handle stuff under tools/:
> > 
> > 		# Accept relative Documentation patches for tools/
> > 		if ($f =~ m/tools/) {
> > 			my $path = $f;
> > 			$path =~ s,(.*)/.*,$1,;
> > 			next if (grep -e, glob("$path/$ref $path/../$ref $path/$fulref"));
> > 		}
> > 
> > but it seems it needs a fixup in order for it to stop reporting issues
> > at test_bpftool_synctypes.py:
> > 
> > 	$ ./scripts/documentation-file-ref-check 
> > 	...
> > 	tools/testing/selftests/bpf/test_bpftool_synctypes.py: Documentation/bpftool-prog.rst
> > 	tools/testing/selftests/bpf/test_bpftool_synctypes.py: Documentation/bpftool-map.rst
> > 	tools/testing/selftests/bpf/test_bpftool_synctypes.py: Documentation/bpftool-cgroup.rst  
> 
> Oh, I see, thanks for explaining. I didn't know this script would catch
> the paths in bpftool's test file.
> 
> > 
> > I'll drop the patches touching it for a next version, probably
> > adding a fix for such script.
> > 
> > Thanks,
> > Mauro
> >   
> 
> Sounds good to me, thanks a lot!

The enclosed patch should do the trick.

> Quentin

Thanks,
Mauro

[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"));
 		}
 




  reply	other threads:[~2021-09-16 11:30 UTC|newest]

Thread overview: 35+ 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 01/24] visorbus: fix a copyright symbol that was bad encoded Mauro Carvalho Chehab
2021-09-16  9:13 ` [PATCH 02/24] dt-bindings: net: dsa: sja1105: update nxp,sja1105.yaml reference Mauro Carvalho Chehab
2021-09-16  9:13 ` [PATCH 03/24] dt-bindings: arm: mediatek: mmsys: update mediatek,mmsys.yaml reference Mauro Carvalho Chehab
2021-09-16  9:13 ` [PATCH 04/24] dt-bindings: w1: update w1-gpio.yaml reference Mauro Carvalho Chehab
2021-09-16  9:13 ` [PATCH 05/24] dt-bindings: mmc: update mmc-card.yaml reference 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 07/24] docs: accounting: update delay-accounting.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 [this message]
2021-09-16 12:12           ` Quentin Monnet
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
2021-09-16  9:14 ` [PATCH 11/24] MAINTAINERS: update mtd-physmap.yaml reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 12/24] MAINTAINERS: update arm,vic.yaml reference Mauro Carvalho Chehab
2021-09-16  9:18   ` Sudeep Holla
2021-09-16  9:49     ` Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 13/24] MAINTAINERS: update aspeed,i2c.yaml reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 14/24] MAINTAINERS: update faraday,ftrtc010.yaml reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 15/24] MAINTAINERS: update fsl,fec.yaml reference Mauro Carvalho Chehab
2021-09-16  9:17   ` Joakim Zhang
2021-09-16  9:14 ` [PATCH 16/24] MAINTAINERS: update mtd-physmap.yaml reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 17/24] MAINTAINERS: update ti,am654-hbmc.yaml reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 18/24] MAINTAINERS: update ti,sci.yaml reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 19/24] MAINTAINERS: update intel,ixp46x-rng.yaml reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 20/24] MAINTAINERS: update nxp,imx8-jpeg.yaml reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 21/24] MAINTAINERS: update gemini.yaml reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 22/24] MAINTAINERS: update brcm,unimac-mdio.yaml reference Mauro Carvalho Chehab
2021-09-16  9:34   ` Rafał Miłecki
2021-09-16  9:14 ` [PATCH 23/24] MAINTAINERS: update chipone,icn8318.yaml reference Mauro Carvalho Chehab
2021-09-16  9:14 ` [PATCH 24/24] MAINTAINERS: update silergy,sy8106a.yaml reference Mauro Carvalho Chehab
2021-09-16 11:23   ` Mark Brown

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=20210916133036.37c50383@coco.lan \
    --to=mchehab+huawei@kernel.org \
    --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=netdev@vger.kernel.org \
    --cc=quentin@isovalent.com \
    --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;
as well as URLs for NNTP newsgroup(s).