mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add --traceback flag to customize GOTRACEBACK level
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
@@ -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"`
|
||||
|
||||
|
||||
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user