aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/rpcserver/runner.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-07-05 15:41:55 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-07-11 09:03:37 +0000
commit6ca1eb5a578bb1421ad0f3dbde675eb34647e6d7 (patch)
tree935c35d1225bcd55b0d413796168c758734af0f9 /pkg/rpcserver/runner.go
parentfc2b083017012b4afbd9324fc6525e34a19aa0b3 (diff)
all: transition to instance.Pool
Rely on instance.Pool to perform fuzzing and do bug reproductions. Extract the reproduction queue logic to separate testable class.
Diffstat (limited to 'pkg/rpcserver/runner.go')
-rw-r--r--pkg/rpcserver/runner.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/rpcserver/runner.go b/pkg/rpcserver/runner.go
index 06fa6a581..c45598b9c 100644
--- a/pkg/rpcserver/runner.go
+++ b/pkg/rpcserver/runner.go
@@ -20,6 +20,7 @@ import (
"github.com/google/syzkaller/pkg/stats"
"github.com/google/syzkaller/prog"
"github.com/google/syzkaller/sys/targets"
+ "github.com/google/syzkaller/vm/dispatcher"
)
type Runner struct {
@@ -40,6 +41,7 @@ type Runner struct {
executing map[int64]bool
lastExec *LastExecuting
rnd *rand.Rand
+ updInfo dispatcher.UpdateInfo
// The mutex protects all the fields below.
mu sync.Mutex
@@ -78,6 +80,12 @@ type handshakeResult struct {
}
func (runner *Runner) Handshake(conn *flatrpc.Conn, cfg *handshakeConfig) error {
+ if runner.updInfo != nil {
+ runner.updInfo(func(info *dispatcher.Info) {
+ info.Status = "handshake"
+ })
+ }
+
connectReply := &flatrpc.ConnectReply{
Debug: runner.debug,
Cover: runner.cover,
@@ -115,10 +123,23 @@ func (runner *Runner) Handshake(conn *flatrpc.Conn, cfg *handshakeConfig) error
runner.machineInfo = ret.MachineInfo
runner.canonicalizer = ret.Canonicalizer
runner.mu.Unlock()
+
+ if runner.updInfo != nil {
+ runner.updInfo(func(info *dispatcher.Info) {
+ info.MachineInfo = runner.MachineInfo
+ info.DetailedStatus = runner.QueryStatus
+ })
+ }
return nil
}
func (runner *Runner) ConnectionLoop() error {
+ if runner.updInfo != nil {
+ runner.updInfo(func(info *dispatcher.Info) {
+ info.Status = "executing"
+ })
+ }
+
runner.mu.Lock()
stopped := runner.stopped
if !stopped {