From: Tao Chen <chen.dylane@linux.dev>
To: Quentin Monnet <qmo@kernel.org>,
ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
yonghong.song@linux.dev, john.fastabend@gmail.com,
kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com,
jolsa@kernel.org, davem@davemloft.net, kuba@kernel.org,
hawk@kernel.org
Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH bpf-next 2/2] bpftool: Add bpftool-token manpage
Date: Tue, 22 Jul 2025 14:06:51 +0800 [thread overview]
Message-ID: <629f59b1-9760-4233-bb17-6be12c0965ba@linux.dev> (raw)
In-Reply-To: <ab308d9e-a0dc-4b57-b498-93a0f56771c4@kernel.org>
在 2025/7/22 00:23, Quentin Monnet 写道:
> 2025-07-21 01:33 UTC+0800 ~ Tao Chen <chen.dylane@linux.dev>
>> Add bpftool-token manpage with information and examples of token-related
>> commands.
>>
>> Signed-off-by: Tao Chen <chen.dylane@linux.dev>
>> ---
>> .../bpftool/Documentation/bpftool-token.rst | 68 +++++++++++++++++++
>> 1 file changed, 68 insertions(+)
>> create mode 100644 tools/bpf/bpftool/Documentation/bpftool-token.rst
>>
>> diff --git a/tools/bpf/bpftool/Documentation/bpftool-token.rst b/tools/bpf/bpftool/Documentation/bpftool-token.rst
>> new file mode 100644
>> index 00000000000..177f93c0bc7
>> --- /dev/null
>> +++ b/tools/bpf/bpftool/Documentation/bpftool-token.rst
>> @@ -0,0 +1,68 @@
>> +.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +
>> +================
>> +bpftool-token
>> +================
>> +-------------------------------------------------------------------------------
>> +tool for inspection and simple manipulation of eBPF progs
>
>
> Copy-pasted from bpftool-prog.rst, please update.
>
will update it in v2, thanks.
>
>> +-------------------------------------------------------------------------------
>> +
>> +:Manual section: 8
>> +
>> +.. include:: substitutions.rst
>> +
>> +SYNOPSIS
>> +========
>> +
>> +**bpftool** [*OPTIONS*] **token** *COMMAND*
>> +
>> +*OPTIONS* := { |COMMON_OPTIONS| }
>> +
>> +*COMMANDS* := { **show** | **list** | **help** }
>> +
>> +TOKEN COMMANDS
>> +===============
>> +
>> +| **bpftool** **token** { **show** | **list** }
>> +| **bpftool** **token help**
>> +|
>> +
>> +DESCRIPTION
>> +===========
>> +bpftool token { show | list }
>> + List all the concrete allowed_types for cmds maps progs attachs
>> + and the bpffs mount_point used to set the token info.
>
>
> This is not a summary, please let's use a more verbose description and
> avoid abbreviations:
>
> List all the concrete allowed types for **bpf**\ () system call
> commands, maps, programs, and attach types, as well as the
> *bpffs* mount point used to set the token information.
>
> What is a "concrete" allowed_type?
>
Uh... I wanted to say speciafic allowed_type, sorry for the poor english.
> >> +
>> +bpftool prog help
>> + Print short help message.
>> +
>> +OPTIONS
>> +========
>> +.. include:: common_options.rst
>> +
>> +EXAMPLES
>> +========
>> +|
>> +| **# mkdir -p /sys/fs/bpf/token**
>> +| **# mount -t bpf bpffs /sys/fs/bpf/token** \
>> +| **-o delegate_cmds=prog_load:map_create** \
>> +| **-o delegate_progs=kprobe** \
>> +| **-o delegate_attachs=xdp**
>> +| **# bpftool token list**
>> +
>> +::
>> +
>> + token_info:
>> + /sys/fs/bpf/token
>> +
>> + allowed_cmds:
>> + map_create prog_load
>> +
>> + allowed_maps:
>> +
>> + allowed_progs:
>> + kprobe
>> +
>> + allowed_attachs:
>> + xdp
>> +
>
>
> Please also update bpftool's bash completion file. I think it should be:
>
will add it in v2.
> diff --git i/tools/bpf/bpftool/bash-completion/bpftool w/tools/bpf/bpftool/bash-completion/bpftool
> index a759ba24471d..3f119d7eae96 100644
> --- i/tools/bpf/bpftool/bash-completion/bpftool
> +++ w/tools/bpf/bpftool/bash-completion/bpftool
> @@ -1215,6 +1215,17 @@ _bpftool()
> ;;
> esac
> ;;
> + token)
> + case $command in
> + show|list)
> + return 0
> + ;;
> + *)
> + [[ $prev == $object ]] && \
> + COMPREPLY=( $( compgen -W 'help show list' -- "$cur" ) )
> + ;;
> + esac
> + ;;
> esac
> } &&
> complete -F _bpftool bpftool
>
--
Best Regards
Tao Chen
next prev parent reply other threads:[~2025-07-22 6:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-20 17:33 [PATCH bpf-next 1/2] bpftool: Add bpf_token show Tao Chen
2025-07-20 17:33 ` [PATCH bpf-next 2/2] bpftool: Add bpftool-token manpage Tao Chen
2025-07-21 16:23 ` Quentin Monnet
2025-07-22 6:06 ` Tao Chen [this message]
2025-07-21 16:23 ` [PATCH bpf-next 1/2] bpftool: Add bpf_token show Quentin Monnet
2025-07-22 5:48 ` Tao Chen
2025-07-22 9:23 ` Quentin Monnet
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=629f59b1-9760-4233-bb17-6be12c0965ba@linux.dev \
--to=chen.dylane@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=qmo@kernel.org \
--cc=sdf@fomichev.me \
--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
all inboxes | Powered by JetHome®