diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-12-11 19:17:59 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-12-11 19:17:59 +0000 |
commit | 5e52268a830df52518e54e89375e248eab6a0121 (patch) | |
tree | d74ba9f2eb1c221cb2f3a263c9382f08738d4d80 /runsc | |
parent | 9564bc38b725b5f8c01ce7b5017197f7060313d4 (diff) | |
parent | f8c5ad061bb529e0314bde17f4f1b4ddc82c0120 (diff) |
Merge release-20191129.0-45-gf8c5ad0 (automated)
Diffstat (limited to 'runsc')
-rw-r--r-- | runsc/cmd/debug.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/runsc/cmd/debug.go b/runsc/cmd/debug.go index 38da7ee02..f37415810 100644 --- a/runsc/cmd/debug.go +++ b/runsc/cmd/debug.go @@ -42,6 +42,7 @@ type Debug struct { logLevel string logPackets string duration time.Duration + ps bool } // Name implements subcommands.Command. @@ -71,6 +72,7 @@ func (d *Debug) SetFlags(f *flag.FlagSet) { f.StringVar(&d.strace, "strace", "", `A comma separated list of syscalls to trace. "all" enables all traces, "off" disables all`) f.StringVar(&d.logLevel, "log-level", "", "The log level to set: warning (0), info (1), or debug (2).") f.StringVar(&d.logPackets, "log-packets", "", "A boolean value to enable or disable packet logging: true or false.") + f.BoolVar(&d.ps, "ps", false, "lists processes") } // Execute implements subcommands.Command.Execute. @@ -240,6 +242,17 @@ func (d *Debug) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) } log.Infof("Logging options changed") } + if d.ps { + pList, err := c.Processes() + if err != nil { + Fatalf("getting processes for container: %v", err) + } + o, err := control.ProcessListToJSON(pList) + if err != nil { + Fatalf("generating JSON: %v", err) + } + log.Infof(o) + } if delay { time.Sleep(d.duration) |