Skip to content

Commit

Permalink
pkg:cgroups: prefix with Cgroupv1 for related log messages
Browse files Browse the repository at this point in the history
Signed-off-by: Djalal Harouni <[email protected]>
  • Loading branch information
tixxdz committed Oct 30, 2024
1 parent 0bc385d commit dfaf03d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/cgroups/cgroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func parseCgroupv1SubSysIds(filePath string) error {
/* We care only for the controllers that we want */
if idx >= CGROUP_SUBSYS_COUNT {
/* Maybe some cgroups are not upstream? */
return fmt.Errorf("Cgroup default subsystem '%s' is indexed at idx=%d higher than CGROUP_SUBSYS_COUNT=%d",
return fmt.Errorf("Cgroupv1 default subsystem '%s' is indexed at idx=%d higher than CGROUP_SUBSYS_COUNT=%d",
fields[0], idx, CGROUP_SUBSYS_COUNT)
}

Expand All @@ -229,7 +229,7 @@ func parseCgroupv1SubSysIds(filePath string) error {
logger.GetLogger().WithFields(logrus.Fields{
"cgroup.fs": cgroupFSPath,
"cgroup.controller.name": controller.Name,
}).WithError(err).Warnf("parsing controller line from '%s' failed", filePath)
}).WithError(err).Warnf("Cgroupv1 parsing controller line from '%s' failed", filePath)
}
}
}
Expand All @@ -239,14 +239,14 @@ func parseCgroupv1SubSysIds(filePath string) error {
logger.GetLogger().WithFields(logrus.Fields{
"cgroup.fs": cgroupFSPath,
"cgroup.controllers": fmt.Sprintf("[%s]", strings.Join(allcontrollers, " ")),
}).Debugf("Cgroup available controllers")
}).Debugf("Cgroupv1 available controllers")

// Could not find 'memory', 'pids' nor 'cpuset' controllers, are they compiled in?
if !fixed {
err = fmt.Errorf("detect cgroup controllers IDs from '%s' failed", filePath)
err = fmt.Errorf("detect cgroupv1 controllers IDs from '%s' failed", filePath)
logger.GetLogger().WithFields(logrus.Fields{
"cgroup.fs": cgroupFSPath,
}).WithError(err).Warnf("Cgroup controllers 'memory', 'pids' and 'cpuset' are missing")
}).WithError(err).Warnf("Cgroupv1 controllers 'memory', 'pids' and 'cpuset' are missing")
return err
}

Expand All @@ -258,11 +258,11 @@ func parseCgroupv1SubSysIds(filePath string) error {
"cgroup.controller.name": controller.Name,
"cgroup.controller.hierarchyID": controller.Id,
"cgroup.controller.index": controller.Idx,
}).Infof("Supported cgroup controller '%s' is active on the system", controller.Name)
}).Infof("Cgroupv1 supported controller '%s' is active on the system", controller.Name)
} else {
// Warn with error
err = fmt.Errorf("controller '%s' is not active", controller.Name)
logger.GetLogger().WithField("cgroup.fs", cgroupFSPath).WithError(err).Warnf("Supported cgroup controller '%s' is not active", controller.Name)
logger.GetLogger().WithField("cgroup.fs", cgroupFSPath).WithError(err).Warnf("Cgroupv1 supported controller is missing")
}
}

Expand Down

0 comments on commit dfaf03d

Please sign in to comment.