aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/subsystem/entity
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-01-10 18:09:40 +0100
committerAleksandr Nogikh <wp32pw@gmail.com>2023-02-10 14:34:44 +0100
commit81d09d26268f7cb9a371b05c1abe07d581eb952a (patch)
tree7f33d502a5b6c0d08fa0c06c7adda723e931cde8 /pkg/subsystem/entity
parentf67b38c100fe027e65530ef702b7b4dc45b53ccd (diff)
pkg/subsystem: add the path matching code
Additionally, optimize the matching by joining the rules without exclusion (that is, almost all MAINTAINER records).
Diffstat (limited to 'pkg/subsystem/entity')
-rw-r--r--pkg/subsystem/entity/entities.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/subsystem/entity/entities.go b/pkg/subsystem/entity/entities.go
new file mode 100644
index 000000000..6d028e391
--- /dev/null
+++ b/pkg/subsystem/entity/entities.go
@@ -0,0 +1,15 @@
+// Copyright 2023 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 entity
+
+type Subsystem struct {
+ PathRules []PathRule
+}
+
+// PathRule describes the part of the directory tree belonging to a single subsystem.
+type PathRule struct {
+ IncludeRegexp string
+ // ExcludeRegexps are tested before IncludeRegexp.
+ ExcludeRegexp string
+}