aboutsummaryrefslogtreecommitdiffstats
path: root/syz-manager/hub.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-03-27 14:36:01 +0100
committerDmitry Vyukov <dvyukov@google.com>2024-04-03 11:26:05 +0000
commitfed899ed4a625d124a881a2da67430be5d15325c (patch)
tree9138f5c2f506b22efb1a84af5a1d21063f9b3dfd /syz-manager/hub.go
parentafbcc4a93d840f52b2579530d638654a4a1e5447 (diff)
pkg/rpctype: make RPC compression optional
RPC compression take up to 10% of CPU time in profiles, but it's unlikely to be beneficial for local VM runs (we are mostly copying memory in this case). Enable RPC compression based on the VM type (local VM don't use it, remove machines use it).
Diffstat (limited to 'syz-manager/hub.go')
-rw-r--r--syz-manager/hub.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/syz-manager/hub.go b/syz-manager/hub.go
index 7a38310d5..04904664d 100644
--- a/syz-manager/hub.go
+++ b/syz-manager/hub.go
@@ -114,6 +114,10 @@ func (hc *HubConnector) connect(corpus [][]byte) (*rpctype.RPCClient, error) {
if err != nil {
return nil, err
}
+ hub, err := rpctype.NewRPCClient(hc.cfg.HubAddr, 1, true)
+ if err != nil {
+ return nil, err
+ }
a := &rpctype.HubConnectArgs{
Client: hc.cfg.HubClient,
Key: key,
@@ -136,12 +140,14 @@ func (hc *HubConnector) connect(corpus [][]byte) (*rpctype.RPCClient, error) {
if len(a.Corpus) > max {
a.Corpus = a.Corpus[:max]
}
+ err = hub.Call("Hub.Connect", a, nil)
// Hub.Connect request can be very large, so do it on a transient connection
// (rpc connection buffers never shrink).
- if err := rpctype.RPCCall(hc.cfg.HubAddr, 1, "Hub.Connect", a, nil); err != nil {
+ hub.Close()
+ if err != nil {
return nil, err
}
- hub, err := rpctype.NewRPCClient(hc.cfg.HubAddr, 1)
+ hub, err = rpctype.NewRPCClient(hc.cfg.HubAddr, 1, true)
if err != nil {
return nil, err
}