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