[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <629f59b1-9760-4233-bb17-6be12c0965ba@linux.dev>
Date: Tue, 22 Jul 2025 14:06:51 +0800
From: Tao Chen <chen.dylane@...ux.dev>
To: Quentin Monnet <qmo@...nel.org>, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, martin.lau@...ux.dev, eddyz87@...il.com, song@...nel.org,
yonghong.song@...ux.dev, john.fastabend@...il.com, kpsingh@...nel.org,
sdf@...ichev.me, haoluo@...gle.com, jolsa@...nel.org, davem@...emloft.net,
kuba@...nel.org, hawk@...nel.org
Cc: linux-kernel@...r.kernel.org, bpf@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH bpf-next 2/2] bpftool: Add bpftool-token manpage
在 2025/7/22 00:23, Quentin Monnet 写道:
> 2025-07-21 01:33 UTC+0800 ~ Tao Chen <chen.dylane@...ux.dev>
>> Add bpftool-token manpage with information and examples of token-related
>> commands.
>>
>> Signed-off-by: Tao Chen <chen.dylane@...ux.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
Powered by blists - more mailing lists