EnabledControllers returns the list of all not nil resource controllers
()
| 121 | |
| 122 | // EnabledControllers returns the list of all not nil resource controllers |
| 123 | func (r *Resources) EnabledControllers() (c []string) { |
| 124 | if r.CPU != nil { |
| 125 | c = append(c, "cpu") |
| 126 | if r.CPU.Cpus != "" || r.CPU.Mems != "" { |
| 127 | c = append(c, "cpuset") |
| 128 | } |
| 129 | } |
| 130 | if r.Memory != nil { |
| 131 | c = append(c, "memory") |
| 132 | } |
| 133 | if r.Pids != nil { |
| 134 | c = append(c, "pids") |
| 135 | } |
| 136 | if r.IO != nil { |
| 137 | c = append(c, "io") |
| 138 | } |
| 139 | if r.RDMA != nil { |
| 140 | c = append(c, "rdma") |
| 141 | } |
| 142 | if r.HugeTlb != nil { |
| 143 | c = append(c, "hugetlb") |
| 144 | } |
| 145 | return |
| 146 | } |
| 147 | |
| 148 | // Value of a cgroup setting |
| 149 | type Value struct { |
no outgoing calls
no test coverage detected