diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-11-19 10:35:03 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-11-21 09:22:22 +0100 |
| commit | a7ae31ed14a28ec2501e4113578ef3cee6020a75 (patch) | |
| tree | 020af01db93db651225cbbc41227b8a71d7b2100 /vm/gvisor/gvisor.go | |
| parent | 0dbb024b2d566651cf10f3b5fbb531eb6de37b5a (diff) | |
vm: pass Report to Diagnose
The way to diagnose generally depends on the issue.
E.g. do we need register dump to debug this issue?
Do we need host dmesg dump? Some diagnosis may be
directly specific to a particular problem (e.g. dumping
a particular debugfs/procfs file).
Pass Report to Diagnose to make this possible.
Diffstat (limited to 'vm/gvisor/gvisor.go')
| -rw-r--r-- | vm/gvisor/gvisor.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vm/gvisor/gvisor.go b/vm/gvisor/gvisor.go index 8d8454e25..4365c22f9 100644 --- a/vm/gvisor/gvisor.go +++ b/vm/gvisor/gvisor.go @@ -20,6 +20,7 @@ import ( "github.com/google/syzkaller/pkg/config" "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/pkg/osutil" + "github.com/google/syzkaller/pkg/report" "github.com/google/syzkaller/vm/vmimpl" ) @@ -352,7 +353,8 @@ func (inst *instance) guestProxy() (*os.File, error) { return guestSock, nil } -func (inst *instance) Diagnose() ([]byte, bool) { +func (inst *instance) Diagnose(rep *report.Report) ([]byte, bool) { + // TODO: stacks and dmesg are mostly useful for hangs/stalls, so we could do this only sometimes based on rep. b, err := osutil.Run(time.Minute, inst.runscCmd("debug", "-stacks", "--ps", inst.name)) if err != nil { b = append(b, fmt.Sprintf("\n\nError collecting stacks: %v", err)...) |
