File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -373,8 +373,15 @@ func readProcsFile(file string) ([]int, error) {
373373 return out , nil
374374}
375375
376- // ParseCgroupFile parses the given cgroup file, typically from
377- // /proc/<pid>/cgroup, into a map of subgroups to cgroup names.
376+ // ParseCgroupFile parses the given cgroup file, typically /proc/self/cgroup
377+ // or /proc/<pid>/cgroup, into a map of subsystems to cgroup paths, e.g.
378+ // "cpu": "/user.slice/user-1000.slice"
379+ // "pids": "/user.slice/user-1000.slice"
380+ // etc.
381+ //
382+ // Note that for cgroup v2 unified hierarchy, there are no per-controller
383+ // cgroup paths, so the resulting map will have a single element where the key
384+ // is empty string ("") and the value is the cgroup path the <pid> is in.
378385func ParseCgroupFile (path string ) (map [string ]string , error ) {
379386 f , err := os .Open (path )
380387 if err != nil {
You can’t perform that action at this time.
0 commit comments