From 8db6c2cdce6b716eae80719382d82be911c2bc02 Mon Sep 17 00:00:00 2001 From: Dean Deng Date: Thu, 21 Jan 2021 10:52:04 -0800 Subject: pkg/build: exclude gvisor pkg/coverage from coverage instrumentation Instrumenting this package is too slow--every time the Sentry switches to the application, task work will iterate through all of the coverage counters. Instrumenting this code path will add many atomic operations on race builds, drastically degrading performance. --- pkg/build/gvisor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/build/gvisor.go b/pkg/build/gvisor.go index 3369e6f16..b8ef1781c 100644 --- a/pkg/build/gvisor.go +++ b/pkg/build/gvisor.go @@ -33,7 +33,8 @@ func (gvisor gvisor) build(params *Params) error { if coverageEnabled(config) { coverageFiles := "//pkg/..." exclusions := []string{ - "//pkg/sentry/platform", // Breaks kvm. + "//pkg/sentry/platform", // Breaks kvm. + "//pkg/coverage:coverage", // Too slow. } if race { // These targets use go:norace, which is not -- cgit mrf-deployment