diff options
author | Chong Cai <chongc@google.com> | 2021-08-12 18:29:40 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-08-12 18:32:01 -0700 |
commit | ddcf884e9d396930095ab1fde51b14201e8cf718 (patch) | |
tree | 27ce1f55cca136924a2564b51ceabdbbeebcd0e5 /runsc/boot | |
parent | 02370bbd315d7e7c2783d7001d014870cf1ef534 (diff) |
Add Usage controls
Add Usage controls and implement "usage/usagefd" commands.
PiperOrigin-RevId: 390507423
Diffstat (limited to 'runsc/boot')
-rw-r--r-- | runsc/boot/controller.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/runsc/boot/controller.go b/runsc/boot/controller.go index 60b532798..b0282604a 100644 --- a/runsc/boot/controller.go +++ b/runsc/boot/controller.go @@ -114,6 +114,13 @@ const ( FsCat = "Fs.Cat" ) +// Usage related commands (see usage.go for more details). +const ( + UsageCollect = "Usage.Collect" + UsageUsageFD = "Usage.UsageFD" + UsageReduce = "Usage.Reduce" +) + // ControlSocketAddr generates an abstract unix socket name for the given ID. func ControlSocketAddr(id string) string { return fmt.Sprintf("\x00runsc-sandbox.%s", id) @@ -157,6 +164,7 @@ func newController(fd int, l *Loader) (*controller, error) { ctrl.srv.Register(&control.Logging{}) ctrl.srv.Register(&control.Lifecycle{l.k}) ctrl.srv.Register(&control.Fs{l.k}) + ctrl.srv.Register(&control.Usage{l.k}) if l.root.conf.ProfileEnable { ctrl.srv.Register(control.NewProfile(l.k)) |