BPF List
 help / color / mirror / Atom feed
From: Quentin Monnet <qmo@kernel.org>
To: Hangbin Liu <liuhangbin@gmail.com>, bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Alejandro Colomar <alx.manpages@gmail.com>,
	Michael Hofmann <mhofmann@redhat.com>
Subject: Re: [PATCH bpf] bpf_doc: use silent mode when exec make cmd
Date: Fri, 15 Mar 2024 10:31:02 +0000	[thread overview]
Message-ID: <bccbfd38-3f1f-411e-aeab-70d256d896dd@kernel.org> (raw)
In-Reply-To: <20240315023443.2364442-1-liuhangbin@gmail.com>

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!

  reply	other threads:[~2024-03-15 10:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-03-15 11:21 ` Alejandro Colomar
2024-03-15 13:50 ` 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=bccbfd38-3f1f-411e-aeab-70d256d896dd@kernel.org \
    --to=qmo@kernel.org \
    --cc=alx.manpages@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=martin.lau@linux.dev \
    --cc=mhofmann@redhat.com \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox