From 79910ad71b16dbf22e70717166c21361b5cf9bf0 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 23 Jan 2025 09:31:50 +0100 Subject: sys/syz-sysgen: serialize descriptions as gob and embed Instead of generating Go files with descriptions serialize them as gob and compress with flate. This significantly reduces build time, go vet time, and solves scalability problems with some static analysis tools. Reference times (all after rm -rf ~/.cache/go-build) before: TIME="%e %P %M" time go install ./syz-manager 48.29 577% 4824820 TIME="%e %P %M" time go test -c ./prog 56.28 380% 6973292 After: TIME="%e %P %M" time go install ./syz-manager 22.81 865% 859788 TIME="%e %P %M" time go test -c ./prog 12.74 565% 267760 syz-manager size before/after: 194712597 -> 83418407 -57% even provided we now embed all descriptions instead of just a single arch. Deflate/decoding time for a single Linux arch is ~330ms. Fixes #5542 --- sys/linux/gen/empty.go | 6 ------ sys/linux/init_test.go | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 sys/linux/gen/empty.go (limited to 'sys/linux') diff --git a/sys/linux/gen/empty.go b/sys/linux/gen/empty.go deleted file mode 100644 index 7884be456..000000000 --- a/sys/linux/gen/empty.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2021 syzkaller project authors. All rights reserved. -// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. - -package gen - -// Empty file to unbreak build while descriptions are not generated. diff --git a/sys/linux/init_test.go b/sys/linux/init_test.go index 74642f6c9..230593105 100644 --- a/sys/linux/init_test.go +++ b/sys/linux/init_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/google/syzkaller/prog" - _ "github.com/google/syzkaller/sys/linux/gen" + _ "github.com/google/syzkaller/sys" "github.com/google/syzkaller/sys/targets" ) -- cgit mrf-deployment