aboutsummaryrefslogtreecommitdiffstats
path: root/prog/decl_test.go
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2019-08-21 20:05:22 +0200
committerDmitry Vyukov <dvyukov@google.com>2019-08-30 12:51:28 -0700
commitbcd7bcc2968d1db4d4eb16c50afa76bdcffb6302 (patch)
tree4cea13908fbf66515279c53e21bdcb672d10e01e /prog/decl_test.go
parent9adfa8760f6ba6ed23dc7fe9eb900f8b684e0052 (diff)
prog: speed up resource ctors detection
When we build a list of resource constructors we over and over iterate through all types in a syscall to find resource types. Speed it up by iterating only once to build a list of constructors for each resource and then reuse it. This significantly speeds up syz-exeprog startup time on Raspberry Pi Zero.
Diffstat (limited to 'prog/decl_test.go')
-rw-r--r--prog/decl_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/prog/decl_test.go b/prog/decl_test.go
index bf6bec4d1..f999ae589 100644
--- a/prog/decl_test.go
+++ b/prog/decl_test.go
@@ -15,7 +15,7 @@ func TestResourceCtors(t *testing.T) {
testEachTarget(t, func(t *testing.T, target *Target) {
expectFail := false
for _, res := range target.Resources {
- if len(target.calcResourceCtors(res.Kind, true)) == 0 != expectFail {
+ if len(target.calcResourceCtors(res, true)) == 0 != expectFail {
t.Errorf("resource %v can't be created", res.Name)
}
}