vm/gvisor: use runsc debug --stacks to diagnose

This feature has been around longer than -trace-signal. It returns the
stacks directly, which we then append to the kernel log.
This commit is contained in:
Michael Pratt 2018-12-21 07:59:31 -08:00 committed by Dmitry Vyukov
parent 2fc01104d0
commit 603b512405

View File

@ -190,7 +190,6 @@ func (inst *instance) runscCmd(add ...string) *exec.Cmd {
args := []string{
"-root", inst.rootDir,
"-watchdog-action=panic",
"-trace-signal=12",
"-network=none",
"-debug",
}
@ -328,8 +327,11 @@ func (inst *instance) guestProxy() (*os.File, error) {
}
func (inst *instance) Diagnose() ([]byte, bool) {
osutil.Run(time.Minute, inst.runscCmd("debug", "-signal=12", inst.name))
return nil, true
b, err := osutil.Run(time.Minute, inst.runscCmd("debug", "-stacks", inst.name))
if err != nil {
b = append(b, []byte(fmt.Sprintf("\n\nError collecting stacks: %v", err))...)
}
return b, false
}
func init() {