* [PATCH bpf] bpf_doc: use silent mode when exec make cmd
@ 2024-03-15 2:34 Hangbin Liu
2024-03-15 10:31 ` Quentin Monnet
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Hangbin Liu @ 2024-03-15 2:34 UTC (permalink / raw)
To: bpf
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Quentin Monnet, Alejandro Colomar, Hangbin Liu, Michael Hofmann
When getting kernel version via make, the result may be polluted by other
output, like directory change info. e.g.
$ export MAKEFLAGS="-w"
$ make kernelversion
make: Entering directory '/home/net'
6.8.0
make: Leaving directory '/home/net'
This will distort the reStructuredText output and make latter rst2man
failed like:
bpf-helpers.rst:20: (WARNING/2) Field list ends without a blank line; unexpected unindent.
Using silent mode would help. e.g.
$ make -s --no-print-directory kernelversion
6.8.0
Fixes: fd0a38f9c37d ("scripts/bpf: Set version attribute for bpf-helpers(7) man page")
Signed-off-by: Michael Hofmann <mhofmann@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
scripts/bpf_doc.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/bpf_doc.py b/scripts/bpf_doc.py
index 4606944984ee..c55878bddfdd 100755
--- a/scripts/bpf_doc.py
+++ b/scripts/bpf_doc.py
@@ -414,8 +414,8 @@ class PrinterRST(Printer):
version = version.stdout.decode().rstrip()
except:
try:
- version = subprocess.run(['make', 'kernelversion'], cwd=linuxRoot,
- capture_output=True, check=True)
+ version = subprocess.run(['make', '-s', '--no-print-directory', 'kernelversion'],
+ cwd=linuxRoot, capture_output=True, check=True)
version = version.stdout.decode().rstrip()
except:
return 'Linux'
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH bpf] bpf_doc: use silent mode when exec make cmd
2024-03-15 2:34 [PATCH bpf] bpf_doc: use silent mode when exec make cmd Hangbin Liu
@ 2024-03-15 10:31 ` Quentin Monnet
2024-03-15 11:21 ` Alejandro Colomar
2024-03-15 13:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Quentin Monnet @ 2024-03-15 10:31 UTC (permalink / raw)
To: Hangbin Liu, bpf
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Alejandro Colomar, Michael Hofmann
2024-03-15 02:34 UTC+0000 ~ Hangbin Liu <liuhangbin@gmail.com>
> When getting kernel version via make, the result may be polluted by other
> output, like directory change info. e.g.
> $ export MAKEFLAGS="-w"
> $ make kernelversion
> make: Entering directory '/home/net'
> 6.8.0
> make: Leaving directory '/home/net'
>
> This will distort the reStructuredText output and make latter rst2man
> failed like:
> bpf-helpers.rst:20: (WARNING/2) Field list ends without a blank line; unexpected unindent.
>
> Using silent mode would help. e.g.
> $ make -s --no-print-directory kernelversion
> 6.8.0
>
> Fixes: fd0a38f9c37d ("scripts/bpf: Set version attribute for bpf-helpers(7) man page")
> Signed-off-by: Michael Hofmann <mhofmann@redhat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
> scripts/bpf_doc.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/bpf_doc.py b/scripts/bpf_doc.py
> index 4606944984ee..c55878bddfdd 100755
> --- a/scripts/bpf_doc.py
> +++ b/scripts/bpf_doc.py
> @@ -414,8 +414,8 @@ class PrinterRST(Printer):
> version = version.stdout.decode().rstrip()
> except:
> try:
> - version = subprocess.run(['make', 'kernelversion'], cwd=linuxRoot,
> - capture_output=True, check=True)
> + version = subprocess.run(['make', '-s', '--no-print-directory', 'kernelversion'],
> + cwd=linuxRoot, capture_output=True, check=True)
> version = version.stdout.decode().rstrip()
> except:
> return 'Linux'
Reviewed-by: Quentin Monnet <qmo@kernel.org>
This can probably go through bpf-next, though.
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH bpf] bpf_doc: use silent mode when exec make cmd
2024-03-15 2:34 [PATCH bpf] bpf_doc: use silent mode when exec make cmd Hangbin Liu
2024-03-15 10:31 ` Quentin Monnet
@ 2024-03-15 11:21 ` Alejandro Colomar
2024-03-15 13:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2024-03-15 11:21 UTC (permalink / raw)
To: Hangbin Liu
Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Quentin Monnet, Alejandro Colomar, Michael Hofmann
[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]
Hi!
On Fri, Mar 15, 2024 at 10:34:43AM +0800, Hangbin Liu wrote:
> When getting kernel version via make, the result may be polluted by other
> output, like directory change info. e.g.
> $ export MAKEFLAGS="-w"
> $ make kernelversion
> make: Entering directory '/home/net'
> 6.8.0
> make: Leaving directory '/home/net'
>
> This will distort the reStructuredText output and make latter rst2man
> failed like:
> bpf-helpers.rst:20: (WARNING/2) Field list ends without a blank line; unexpected unindent.
>
> Using silent mode would help. e.g.
> $ make -s --no-print-directory kernelversion
Acked-by: Alejandro Colomar <alx@kernel.org>
Thanks!
Alex
> 6.8.0
>
> Fixes: fd0a38f9c37d ("scripts/bpf: Set version attribute for bpf-helpers(7) man page")
> Signed-off-by: Michael Hofmann <mhofmann@redhat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
> scripts/bpf_doc.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/bpf_doc.py b/scripts/bpf_doc.py
> index 4606944984ee..c55878bddfdd 100755
> --- a/scripts/bpf_doc.py
> +++ b/scripts/bpf_doc.py
> @@ -414,8 +414,8 @@ class PrinterRST(Printer):
> version = version.stdout.decode().rstrip()
> except:
> try:
> - version = subprocess.run(['make', 'kernelversion'], cwd=linuxRoot,
> - capture_output=True, check=True)
> + version = subprocess.run(['make', '-s', '--no-print-directory', 'kernelversion'],
> + cwd=linuxRoot, capture_output=True, check=True)
> version = version.stdout.decode().rstrip()
> except:
> return 'Linux'
> --
> 2.43.0
>
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH bpf] bpf_doc: use silent mode when exec make cmd
2024-03-15 2:34 [PATCH bpf] bpf_doc: use silent mode when exec make cmd Hangbin Liu
2024-03-15 10:31 ` Quentin Monnet
2024-03-15 11:21 ` Alejandro Colomar
@ 2024-03-15 13:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-15 13:50 UTC (permalink / raw)
To: Hangbin Liu
Cc: bpf, ast, daniel, andrii, martin.lau, eddyz87, song,
yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa,
quentin, alx.manpages, mhofmann
Hello:
This patch was applied to bpf/bpf.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:
On Fri, 15 Mar 2024 10:34:43 +0800 you wrote:
> When getting kernel version via make, the result may be polluted by other
> output, like directory change info. e.g.
> $ export MAKEFLAGS="-w"
> $ make kernelversion
> make: Entering directory '/home/net'
> 6.8.0
> make: Leaving directory '/home/net'
>
> [...]
Here is the summary with links:
- [bpf] bpf_doc: use silent mode when exec make cmd
https://git.kernel.org/bpf/bpf/c/5384cc0d1a88
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-15 13:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-15 2:34 [PATCH bpf] bpf_doc: use silent mode when exec make cmd Hangbin Liu
2024-03-15 10:31 ` Quentin Monnet
2024-03-15 11:21 ` Alejandro Colomar
2024-03-15 13:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox