MCPcopy Create free account
hub / github.com/containerd/cgroups / RegisterMemoryEvent

Method RegisterMemoryEvent

cgroup1/cgroup.go:488–503  ·  view source on GitHub ↗

RegisterMemoryEvent allows the ability to register for all v1 memory cgroups notifications.

(event MemoryEvent)

Source from the content-addressed store, hash-verified

486// RegisterMemoryEvent allows the ability to register for all v1 memory cgroups
487// notifications.
488func (c *cgroup) RegisterMemoryEvent(event MemoryEvent) (uintptr, error) {
489 c.mu.Lock()
490 defer c.mu.Unlock()
491 if c.err != nil {
492 return 0, c.err
493 }
494 s := c.getSubsystem(Memory)
495 if s == nil {
496 return 0, ErrMemoryNotSupported
497 }
498 sp, err := c.path(Memory)
499 if err != nil {
500 return 0, err
501 }
502 return s.(*memoryController).memoryEvent(sp, event)
503}
504
505// State returns the state of the cgroup and its processes
506func (c *cgroup) State() State {

Callers

nothing calls this directly

Calls 2

getSubsystemMethod · 0.95
memoryEventMethod · 0.80

Tested by

no test coverage detected