diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-04-18 11:34:25 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-04-29 14:53:56 +0000 |
| commit | 337657e0d5b5c120b163c09fbcfc49ae5897cb39 (patch) | |
| tree | a2bdadb6f1b18fe9b8dbbc50f6b90cc6fffa8f9a | |
| parent | 941b178ab29efd12da4f3df83e5a6b78088a689c (diff) | |
pkg/mgrconfig: add HasCovFilter helper
To reduce diff in the next change.
| -rw-r--r-- | pkg/mgrconfig/load.go | 4 | ||||
| -rw-r--r-- | syz-manager/covfilter.go | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/pkg/mgrconfig/load.go b/pkg/mgrconfig/load.go index 4a5febf79..cfe26c573 100644 --- a/pkg/mgrconfig/load.go +++ b/pkg/mgrconfig/load.go @@ -220,6 +220,10 @@ func checkNonEmpty(fields ...string) error { return nil } +func (cfg *Config) HasCovFilter() bool { + return len(cfg.CovFilter.Functions)+len(cfg.CovFilter.Files)+len(cfg.CovFilter.RawPCs) != 0 +} + func (cfg *Config) CompleteKernelDirs() { cfg.KernelObj = osutil.Abs(cfg.KernelObj) if cfg.KernelSrc == "" { diff --git a/syz-manager/covfilter.go b/syz-manager/covfilter.go index 5844c4bc3..06f941e3d 100644 --- a/syz-manager/covfilter.go +++ b/syz-manager/covfilter.go @@ -18,7 +18,7 @@ import ( ) func (mgr *Manager) createCoverageFilter() (map[uint32]uint32, map[uint32]uint32, error) { - if len(mgr.cfg.CovFilter.Functions)+len(mgr.cfg.CovFilter.Files)+len(mgr.cfg.CovFilter.RawPCs) == 0 { + if !mgr.cfg.HasCovFilter() { return nil, nil, nil } // Always initialize ReportGenerator because RPCServer.NewInput will need it to filter coverage. |
