perf_event.go 759 B

123456789101112131415161718192021222324252627282930313233343536
  1. // +build linux
  2. package fs
  3. import (
  4. "github.com/opencontainers/runc/libcontainer/cgroups"
  5. "github.com/opencontainers/runc/libcontainer/configs"
  6. )
  7. type PerfEventGroup struct {
  8. }
  9. func (s *PerfEventGroup) Name() string {
  10. return "perf_event"
  11. }
  12. func (s *PerfEventGroup) Apply(d *cgroupData) error {
  13. // we just want to join this group even though we don't set anything
  14. if _, err := d.join("perf_event"); err != nil && !cgroups.IsNotFound(err) {
  15. return err
  16. }
  17. return nil
  18. }
  19. func (s *PerfEventGroup) Set(path string, cgroup *configs.Cgroup) error {
  20. return nil
  21. }
  22. func (s *PerfEventGroup) Remove(d *cgroupData) error {
  23. return removePath(d.path("perf_event"))
  24. }
  25. func (s *PerfEventGroup) GetStats(path string, stats *cgroups.Stats) error {
  26. return nil
  27. }