bpftool: Show parameters of BPF task iterators.
authorKui-Feng Lee <kuifeng@fb.com>
Mon, 26 Sep 2022 18:49:57 +0000 (11:49 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 28 Sep 2022 23:30:08 +0000 (16:30 -0700)
commit6bdb6d6be019f697296f52c37865dd7b0ce80750
treed89a236e696c709e1798ced9fe215c7d6d74befb
parentb3e1331eb925a45df1cc5d02a725e5ea70da0e2e
bpftool: Show parameters of BPF task iterators.

Show tid or pid of iterators if giving an argument of tid or pid

For example, the command `bpftool link list` may list following
lines.

1: iter  prog 2  target_name bpf_map
2: iter  prog 3  target_name bpf_prog
33: iter  prog 225  target_name task_file  tid 1644
        pids test_progs(1644)

Link 33 is a task_file iterator with tid 1644.  For now, only targets
of task, task_file and task_vma may be with tid or pid to filter out
tasks other than those belonging to a process (pid) or a thread (tid).

Signed-off-by: Kui-Feng Lee <kuifeng@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <quentin@isovalent.com>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/bpf/20220926184957.208194-6-kuifeng@fb.com
tools/bpf/bpftool/link.c