diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-10-27 20:43:02 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-27 20:43:02 -0700 |
commit | 22ac9b07237f79e55b8af64cce02b4753e0c7cab (patch) | |
tree | 1aa4b07d47257ff3576fd9b9367da642f0fd3491 /runsc | |
parent | 93d2d37a93640328f01add7d4866bc107ff6a74e (diff) | |
parent | 3b8193e762c1cc37df42104f5abeb6fdc7b70c01 (diff) |
Merge pull request #4587 from lnsp:stacktrace
PiperOrigin-RevId: 339385609
Diffstat (limited to 'runsc')
-rw-r--r-- | runsc/cmd/boot.go | 6 | ||||
-rw-r--r-- | runsc/config/config.go | 3 | ||||
-rw-r--r-- | runsc/config/flags.go | 1 |
3 files changed, 7 insertions, 3 deletions
diff --git a/runsc/cmd/boot.go b/runsc/cmd/boot.go index cd419e1aa..2c92e3067 100644 --- a/runsc/cmd/boot.go +++ b/runsc/cmd/boot.go @@ -131,11 +131,11 @@ func (b *Boot) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) return subcommands.ExitUsageError } - // Ensure that if there is a panic, all goroutine stacks are printed. - debug.SetTraceback("system") - conf := args[0].(*config.Config) + // Set traceback level + debug.SetTraceback(conf.Traceback) + if b.attached { // Ensure this process is killed after parent process terminates when // attached mode is enabled. In the unfortunate event that the parent diff --git a/runsc/config/config.go b/runsc/config/config.go index f30f79f68..b02d8e2e1 100644 --- a/runsc/config/config.go +++ b/runsc/config/config.go @@ -37,6 +37,9 @@ type Config struct { // RootDir is the runtime root directory. RootDir string `flag:"root"` + // Traceback changes the Go runtime's traceback level. + Traceback string `flag:"traceback"` + // Debug indicates that debug logging should be enabled. Debug bool `flag:"debug"` diff --git a/runsc/config/flags.go b/runsc/config/flags.go index a5f25cfa2..d3203b565 100644 --- a/runsc/config/flags.go +++ b/runsc/config/flags.go @@ -49,6 +49,7 @@ func RegisterFlags() { flag.String("debug-log-format", "text", "log format: text (default), json, or json-k8s.") flag.Bool("alsologtostderr", false, "send log messages to stderr.") flag.Bool("allow-flag-override", false, "allow OCI annotations (dev.gvisor.flag.<name>) to override flags for debugging.") + flag.String("traceback", "system", "golang runtime's traceback level") // Debugging flags: strace related flag.Bool("strace", false, "enable strace.") |