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/vmimpl | |
| 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/vmimpl')
| -rw-r--r-- | vm/vmimpl/vmimpl.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/vm/vmimpl/vmimpl.go b/vm/vmimpl/vmimpl.go index f83d39d57..0ef8636ee 100644 --- a/vm/vmimpl/vmimpl.go +++ b/vm/vmimpl/vmimpl.go @@ -18,6 +18,7 @@ import ( "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/pkg/osutil" + "github.com/google/syzkaller/pkg/report" ) // Pool represents a set of test machines (VMs, physical devices, etc) of particular type. @@ -44,13 +45,14 @@ type Instance interface { // Command is terminated after timeout. Send on the stop chan can be used to terminate it earlier. Run(timeout time.Duration, stop <-chan bool, command string) (outc <-chan []byte, errc <-chan error, err error) - // Diagnose retrieves additional debugging info from the VM (e.g. by - // sending some sys-rq's or SIGABORT'ing a Go program). + // Diagnose retrieves additional debugging info from the VM + // (e.g. by sending some sys-rq's or SIGABORT'ing a Go program). // - // Optionally returns (some or all) of the info directly. If wait == - // true, the caller must wait for the VM to output info directly to its - // log. - Diagnose() (diagnosis []byte, wait bool) + // Optionally returns (some or all) of the info directly. If wait == true, + // the caller must wait for the VM to output info directly to its log. + // + // rep describes the reason why Diagnose was called. + Diagnose(rep *report.Report) (diagnosis []byte, wait bool) // Close stops and destroys the VM. Close() |
