Skip to content

Commit f470f43

Browse files
committed
debug tests
1 parent 044a434 commit f470f43

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

metric/system/cgroup/reader.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"time"
2828

2929
"github.com/elastic/elastic-agent-libs/logp"
30+
3031
"github.com/elastic/elastic-agent-system-metrics/metric/system/cgroup/cgv1"
3132
"github.com/elastic/elastic-agent-system-metrics/metric/system/cgroup/cgv2"
3233
"github.com/elastic/elastic-agent-system-metrics/metric/system/resolve"
@@ -361,6 +362,7 @@ func (r *Reader) readControllerList(cgroupsFile string) ([]string, error) {
361362
controllers := strings.Split(cgroupsFile, "\n")
362363
var cgpath string
363364
for _, controller := range controllers {
365+
logp.L().Infof("controller: %s", controller)
364366
if strings.Contains(controller, "0::/") {
365367
fields := strings.Split(controller, ":")
366368
cgpath = fields[2]
@@ -372,7 +374,10 @@ func (r *Reader) readControllerList(cgroupsFile string) ([]string, error) {
372374
}
373375
cgFilePath := filepath.Join(r.cgroupMountpoints.V2Loc, cgpath, "cgroup.controllers")
374376
if cgroupNSStateFetch() && r.rootfsMountpoint.IsSet() {
377+
logp.L().Infof("V2Loc: %s, ContainerizedRootMount %s", r.cgroupMountpoints.V2Loc, r.cgroupMountpoints.ContainerizedRootMount)
375378
cgFilePath = filepath.Join(r.cgroupMountpoints.V2Loc, r.cgroupMountpoints.ContainerizedRootMount, cgpath, "cgroup.controllers")
379+
} else {
380+
logp.L().Infof("V2Loc: %s, ContainerizedRootMount %s", r.cgroupMountpoints.V2Loc)
376381
}
377382

378383
controllersRaw, err := os.ReadFile(cgFilePath)

0 commit comments

Comments
 (0)