| 154 | } |
| 155 | |
| 156 | func (c *cgroup) subsystemsFilter(subsystems ...Name) []Subsystem { |
| 157 | if len(subsystems) == 0 { |
| 158 | return c.subsystems |
| 159 | } |
| 160 | |
| 161 | filteredSubsystems := []Subsystem{} |
| 162 | for _, s := range c.subsystems { |
| 163 | for _, f := range subsystems { |
| 164 | if s.Name() == f { |
| 165 | filteredSubsystems = append(filteredSubsystems, s) |
| 166 | break |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | return filteredSubsystems |
| 172 | } |
| 173 | |
| 174 | // Add moves the provided process into the new cgroup. |
| 175 | // Without additional arguments, the process is added to all the cgroup subsystems. |