mirror of
https://github.com/genuinetools/reg.git
synced 2024-08-21 06:10:23 -04:00
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
|
|
}
|