(ctr *CgroupControl, name string)
| 29 | } |
| 30 | |
| 31 | func readAcctList(ctr *CgroupControl, name string) ([]uint64, error) { |
| 32 | p := filepath.Join(ctr.getCgroupv1Path(CPUAcct), name) |
| 33 | data, err := ioutil.ReadFile(p) |
| 34 | if err != nil { |
| 35 | return nil, errors.Wrapf(err, "reading %s", p) |
| 36 | } |
| 37 | r := []uint64{} |
| 38 | for _, s := range strings.Split(string(data), " ") { |
| 39 | s = cleanString(s) |
| 40 | if s == "" { |
| 41 | break |
| 42 | } |
| 43 | v, err := strconv.ParseUint(s, 10, 64) |
| 44 | if err != nil { |
| 45 | return nil, errors.Wrapf(err, "parsing %s", s) |
| 46 | } |
| 47 | r = append(r, v) |
| 48 | } |
| 49 | return r, nil |
| 50 | } |
| 51 | |
| 52 | // Apply set the specified constraints |
| 53 | func (c *cpuHandler) Apply(ctr *CgroupControl, res *spec.LinuxResources) error { |
no test coverage detected
searching dependent graphs…