On Sun, Sep 10, 2023 at 11:17:48AM +0800, Yafang Shao wrote: > To acquire the cgroup_id, we can resort to open coding, as exemplified below: > > task = bpf_get_current_task_btf(); > cgroups = task->cgroups; > cgroup = cgroups->subsys[cpu_cgrp_id]->cgroup; > key = cgroup->kn->id; You can't hardcode it to a specific controller tree like that. You either stick with fd based interface or need also add something to identify the specifc cgroup1 tree. Thanks. -- tejun