2015-05-14 06:42:16 +08:00
|
|
|
// +build linux
|
|
|
|
|
2014-05-15 06:21:44 +08:00
|
|
|
package fs
|
|
|
|
|
|
|
|
import (
|
2015-06-22 10:29:59 +08:00
|
|
|
"github.com/opencontainers/runc/libcontainer/cgroups"
|
|
|
|
"github.com/opencontainers/runc/libcontainer/configs"
|
2014-05-15 06:21:44 +08:00
|
|
|
)
|
|
|
|
|
2014-06-20 21:13:56 +08:00
|
|
|
type PerfEventGroup struct {
|
2014-05-15 06:21:44 +08:00
|
|
|
}
|
|
|
|
|
2015-10-16 06:19:23 +08:00
|
|
|
func (s *PerfEventGroup) Name() string {
|
|
|
|
return "perf_event"
|
|
|
|
}
|
|
|
|
|
2015-11-05 18:41:08 +08:00
|
|
|
func (s *PerfEventGroup) Apply(d *cgroupData) error {
|
2014-05-15 06:21:44 +08:00
|
|
|
// we just want to join this group even though we don't set anything
|
2014-08-21 01:32:01 +08:00
|
|
|
if _, err := d.join("perf_event"); err != nil && !cgroups.IsNotFound(err) {
|
2014-05-15 06:21:44 +08:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2015-02-25 17:20:01 +08:00
|
|
|
func (s *PerfEventGroup) Set(path string, cgroup *configs.Cgroup) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2015-11-05 18:41:08 +08:00
|
|
|
func (s *PerfEventGroup) Remove(d *cgroupData) error {
|
2014-05-15 06:21:44 +08:00
|
|
|
return removePath(d.path("perf_event"))
|
|
|
|
}
|
|
|
|
|
2014-06-20 21:13:56 +08:00
|
|
|
func (s *PerfEventGroup) GetStats(path string, stats *cgroups.Stats) error {
|
2014-05-28 08:01:08 +08:00
|
|
|
return nil
|
2014-05-15 06:21:44 +08:00
|
|
|
}
|