Re: [PATCH bpf-next 9/9] tools/bpftool: add documentation and sample output for process info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2020-06-17 09:18 UTC-0700 ~ Andrii Nakryiko <andriin@xxxxxx>
> Add statements about bpftool being able to discover process info, holding
> reference to BPF map, prog, link, or BTF. Show example output as well.
> 
> Signed-off-by: Andrii Nakryiko <andriin@xxxxxx>
> ---
>  tools/bpf/bpftool/Documentation/bpftool-btf.rst  |  5 +++++
>  tools/bpf/bpftool/Documentation/bpftool-link.rst | 13 ++++++++++++-
>  tools/bpf/bpftool/Documentation/bpftool-map.rst  |  8 +++++++-
>  tools/bpf/bpftool/Documentation/bpftool-prog.rst | 11 +++++++++++
>  4 files changed, 35 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/bpf/bpftool/Documentation/bpftool-btf.rst b/tools/bpf/bpftool/Documentation/bpftool-btf.rst
> index ce3a724f50c1..85f7c82ebb28 100644
> --- a/tools/bpf/bpftool/Documentation/bpftool-btf.rst
> +++ b/tools/bpf/bpftool/Documentation/bpftool-btf.rst
> @@ -36,6 +36,11 @@ DESCRIPTION
>  		  otherwise list all BTF objects currently loaded on the
>  		  system.
>  
> +		  Since Linux 5.8 bpftool is able to discover information about
> +		  processes that hold open file descriptors (FDs) against BPF
> +		  links. On such kernels bpftool will automatically emit this

Copy-paste error: s/BPF links/BTF objects/

> +		  information as well.
> +
>  	**bpftool btf dump** *BTF_SRC*
>  		  Dump BTF entries from a given *BTF_SRC*.
>  
> diff --git a/tools/bpf/bpftool/Documentation/bpftool-link.rst b/tools/bpf/bpftool/Documentation/bpftool-link.rst
> index 0e43d7b06c11..1da7ef65b514 100644
> --- a/tools/bpf/bpftool/Documentation/bpftool-link.rst
> +++ b/tools/bpf/bpftool/Documentation/bpftool-link.rst
> @@ -37,6 +37,11 @@ DESCRIPTION
>  		  zero or more named attributes, some of which depend on type
>  		  of link.
>  
> +		  Since Linux 5.8 bpftool is able to discover information about
> +		  processes that hold open file descriptors (FDs) against BPF
> +		  links. On such kernels bpftool will automatically emit this
> +		  information as well.
> +
>  	**bpftool link pin** *LINK* *FILE*
>  		  Pin link *LINK* as *FILE*.
>  
> @@ -82,6 +87,7 @@ EXAMPLES
>  
>      10: cgroup  prog 25
>              cgroup_id 614  attach_type egress
> +            pids test_progs(2238417)

(That's a big PID. Maybe something below the default max pid (32768)
might be less confusing for users, but also maybe that's just me
nitpicking too much.)

>  
>  **# bpftool --json --pretty link show**
>  
> @@ -91,7 +97,12 @@ EXAMPLES
>              "type": "cgroup",
>              "prog_id": 25,
>              "cgroup_id": 614,
> -            "attach_type": "egress"
> +            "attach_type": "egress",
> +            "pids": [{
> +                    "pid": 2238417,
> +                    "comm": "test_progs"
> +                }
> +            ]
>          }
>      ]
>  



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux