From a7ae31ed14a28ec2501e4113578ef3cee6020a75 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 19 Nov 2020 10:35:03 +0100 Subject: 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. --- vm/vmimpl/vmimpl.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'vm/vmimpl') 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() -- cgit mrf-deployment