aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/mgrconfig
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-09-04 17:24:25 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-09-06 12:51:13 +0000
commita72ab0ee0af4b1d0d401c09436e1e9ff04bc46e6 (patch)
tree0177e2de1f90116dd2328a7b5867ca945060731f /pkg/mgrconfig
parentece8ad6a2850d003b371a4b4e16c7d5647720992 (diff)
pkg/manager: move coverage filter code out of syz-manager
This will enable the reuse of the functionality elsewhere.
Diffstat (limited to 'pkg/mgrconfig')
-rw-r--r--pkg/mgrconfig/config.go4
-rw-r--r--pkg/mgrconfig/load.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/mgrconfig/config.go b/pkg/mgrconfig/config.go
index 2ea0d8ad9..f4857e613 100644
--- a/pkg/mgrconfig/config.go
+++ b/pkg/mgrconfig/config.go
@@ -152,7 +152,7 @@ type Config struct {
// "pcs": specify raw PC table files name.
// Each line of the file should be: "64-bit-pc:32-bit-weight\n".
// eg. "0xffffffff81000000:0x10\n"
- CovFilter covFilterCfg `json:"cover_filter,omitempty"`
+ CovFilter CovFilterCfg `json:"cover_filter,omitempty"`
// For each prog in the corpus, remember the raw array of PCs obtained from the kernel.
// It can be useful for debugging syzkaller descriptions and syzkaller itself.
@@ -242,7 +242,7 @@ type Subsystem struct {
Paths []string `json:"path"`
}
-type covFilterCfg struct {
+type CovFilterCfg struct {
Files []string `json:"files,omitempty"`
Functions []string `json:"functions,omitempty"`
RawPCs []string `json:"pcs,omitempty"`
diff --git a/pkg/mgrconfig/load.go b/pkg/mgrconfig/load.go
index aa22b3ea8..76a0bcf14 100644
--- a/pkg/mgrconfig/load.go
+++ b/pkg/mgrconfig/load.go
@@ -260,8 +260,8 @@ 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 (cov *CovFilterCfg) Empty() bool {
+ return len(cov.Functions)+len(cov.Files)+len(cov.RawPCs) == 0
}
func (cfg *Config) CompleteKernelDirs() {