You've already forked runc
mirror of
https://github.com/opencontainers/runc.git
synced 2025-08-05 14:35:47 +03:00
'parent' function is confusing with parent cgroup, it's actually parent path, so rename it to parentPath. The name 'data' is too common to be identified, rename it to cgroupData which is exactly what it is. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
36 lines
759 B
Go
36 lines
759 B
Go
// +build linux
|
|
|
|
package fs
|
|
|
|
import (
|
|
"github.com/opencontainers/runc/libcontainer/cgroups"
|
|
"github.com/opencontainers/runc/libcontainer/configs"
|
|
)
|
|
|
|
type PerfEventGroup struct {
|
|
}
|
|
|
|
func (s *PerfEventGroup) Name() string {
|
|
return "perf_event"
|
|
}
|
|
|
|
func (s *PerfEventGroup) Apply(d *cgroupData) error {
|
|
// we just want to join this group even though we don't set anything
|
|
if _, err := d.join("perf_event"); err != nil && !cgroups.IsNotFound(err) {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (s *PerfEventGroup) Set(path string, cgroup *configs.Cgroup) error {
|
|
return nil
|
|
}
|
|
|
|
func (s *PerfEventGroup) Remove(d *cgroupData) error {
|
|
return removePath(d.path("perf_event"))
|
|
}
|
|
|
|
func (s *PerfEventGroup) GetStats(path string, stats *cgroups.Stats) error {
|
|
return nil
|
|
}
|