Skip to content

Commit 93490ee

Browse files
committed
test
1 parent 56645e1 commit 93490ee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

metric/system/cgroup/reader.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,13 @@ func (r *Reader) readControllerList(cgroupsFile string) ([]string, error) {
372372
if cgpath == "" {
373373
return []string{}, nil
374374
}
375+
cgpath = filepath.Join(cgpath) // The path may have a relative prefix like "/../..`, which effectively is "/".
375376
cgFilePath := filepath.Join(r.cgroupMountpoints.V2Loc, cgpath, "cgroup.controllers")
376377
if cgroupNSStateFetch() && r.rootfsMountpoint.IsSet() {
377-
logp.L().Infof("V2Loc: %s, ContainerizedRootMount %s", r.cgroupMountpoints.V2Loc, r.cgroupMountpoints.ContainerizedRootMount)
378+
logp.L().Infof("a) V2Loc: %s, ContainerizedRootMount %s", r.cgroupMountpoints.V2Loc, r.cgroupMountpoints.ContainerizedRootMount)
378379
cgFilePath = filepath.Join(r.cgroupMountpoints.V2Loc, r.cgroupMountpoints.ContainerizedRootMount, cgpath, "cgroup.controllers")
379380
} else {
380-
logp.L().Infof("V2Loc: %s, ContainerizedRootMount %s", r.cgroupMountpoints.V2Loc, r.cgroupMountpoints.ContainerizedRootMount)
381+
logp.L().Infof("b) V2Loc: %s, ContainerizedRootMount %s", r.cgroupMountpoints.V2Loc, r.cgroupMountpoints.ContainerizedRootMount)
381382
}
382383

383384
logp.L().Infof("reading %s", cgFilePath)

0 commit comments

Comments
 (0)