Re: [PATCH bpf-next v1] bpftool: Add support for querying cgroup_iter link

From: Yonghong Song
Date: Tue Aug 30 2022 - 12:41:44 EST




On 8/29/22 4:18 PM, Hao Luo wrote:
Support dumping info of a cgroup_iter link. This includes
showing the cgroup's id and the order for walking the cgroup
hierarchy. Example output is as follows:

bpftool link show
1: iter prog 2 target_name bpf_map
2: iter prog 3 target_name bpf_prog
3: iter prog 12 target_name cgroup cgroup_id 72 order self_only

bpftool -p link show
[{
"id": 1,
"type": "iter",
"prog_id": 2,
"target_name": "bpf_map"
},{
"id": 2,
"type": "iter",
"prog_id": 3,
"target_name": "bpf_prog"
},{
"id": 3,
"type": "iter",
"prog_id": 12,
"target_name": "cgroup",
"cgroup_id": 72,
"order": "self_only"
}
]

Signed-off-by: Hao Luo <haoluo@xxxxxxxxxx>

Acked-by: Yonghong Song <yhs@xxxxxx>