MCPcopy
hub / github.com/google/gvisor / ReadControlFiles

Method ReadControlFiles

pkg/sentry/control/cgroups.go:109–127  ·  view source on GitHub ↗

ReadControlFiles is an RPC stub for batch-reading cgroupfs control files.

(args *CgroupsReadArgs, out *CgroupsResults)

Source from the content-addressed store, hash-verified

107
108// ReadControlFiles is an RPC stub for batch-reading cgroupfs control files.
109func (c *Cgroups) ReadControlFiles(args *CgroupsReadArgs, out *CgroupsResults) error {
110 ctx := c.Kernel.SupervisorContext()
111 for _, arg := range args.Args {
112 cg, err := c.findCgroup(ctx, arg.File)
113 if err != nil {
114 out.appendError(err)
115 continue
116 }
117
118 val, err := cg.ReadControl(ctx, arg.File.Name)
119 if err != nil {
120 out.appendError(err)
121 } else {
122 out.appendValue(val)
123 }
124 }
125
126 return nil
127}
128
129// CgroupsWriteArg represents the arguments for a single write command.
130type CgroupsWriteArg struct {

Callers 1

getUsageFromCgroupsMethod · 0.95

Calls 5

findCgroupMethod · 0.95
SupervisorContextMethod · 0.80
appendErrorMethod · 0.80
appendValueMethod · 0.80
ReadControlMethod · 0.65

Tested by

no test coverage detected