Re: [PATCH bpf-next v2 3/3] bpftool: implement link_query for bpf iterators

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

 



On Thu, Aug 20, 2020 at 3:50 PM Yonghong Song <yhs@xxxxxx> wrote:
>
> The link query for bpf iterators is implemented.
> Besides being shown to the user what bpf iterator
> the link represents, the target_name is also used
> to filter out what additional information should be
> printed out, e.g., whether map_id should be shown or not.
> The following is an example of bpf_iter link dump,
> plain output or pretty output.
>
>   $ bpftool link show
>   11: iter  prog 59  target_name task
>           pids test_progs(1749)
>   34: iter  prog 173  target_name bpf_map_elem  map_id 127
>           pids test_progs_1(1753)
>   $ bpftool -p link show
>   [{
>           "id": 11,
>           "type": "iter",
>           "prog_id": 59,
>           "target_name": "task",
>           "pids": [{
>                   "pid": 1749,
>                   "comm": "test_progs"
>               }
>           ]
>       },{
>           "id": 34,
>           "type": "iter",
>           "prog_id": 173,
>           "target_name": "bpf_map_elem",
>           "map_id": 127,
>           "pids": [{
>                   "pid": 1753,
>                   "comm": "test_progs_1"
>               }
>           ]
>       }
>   ]
>
> Signed-off-by: Yonghong Song <yhs@xxxxxx>
> ---

LGTM.

Acked-by: Andrii Nakryiko <andriin@xxxxxx>

>  tools/bpf/bpftool/link.c | 44 +++++++++++++++++++++++++++++++++++++---
>  1 file changed, 41 insertions(+), 3 deletions(-)
>

[...]



[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