diff options
| author | Paul Buetow <paul@buetow.org> | 2025-10-09 10:44:27 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-10-09 10:44:27 +0300 |
| commit | 82f3c50dce5a26d828b9e9fd71bdf3c05adae968 (patch) | |
| tree | d75439d32485c6586e0631d49d3e3d3b36a577e0 /internal/flags/flags.go | |
| parent | 91632ae9e2f49cb046b5899f190890b9d139ed89 (diff) | |
fix unit tests, initial hard exclude of not working yet syscalls
Diffstat (limited to 'internal/flags/flags.go')
| -rw-r--r-- | internal/flags/flags.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/internal/flags/flags.go b/internal/flags/flags.go index fda921d..512697c 100644 --- a/internal/flags/flags.go +++ b/internal/flags/flags.go @@ -12,8 +12,10 @@ import ( bpf "github.com/aquasecurity/libbpfgo" ) -var singleton Flags -var once sync.Once +var ( + singleton Flags + once sync.Once +) var validCollapsedFields = []string{ "path", @@ -105,6 +107,15 @@ func parse() { singleton.TracepointsToAttach = extractTracepointFlags(*tracepointsToAttach) singleton.TracepointsToExclude = extractTracepointFlags(*tracepointsToExclude) + // disabledTracepoints is a list of tracepoints that should not be attached due to wider isses. + // Here, the BPF programs wouldn't load otherwise due to CO-RE issues. + // TODO: Try out once in a while whether it works again with newer kernel versions. + furtherExcludes := []string{".*_name_to_handle_at", ".*_open_by_handle_at"} + for _, exclude := range furtherExcludes { + fmt.Println("WARNING: Hard-excluding ", exclude) + singleton.TracepointsToExclude = append(singleton.TracepointsToExclude, regexp.MustCompile(exclude)) + } + if *fields == "" { singleton.CollapsedFields = []string{"pid", "path", "tracepoint"} } else { @@ -140,6 +151,7 @@ func extractTracepointFlags(tracepoints string) (regexes []*regexp.Regexp) { } func (flags Flags) ShouldIAttachTracepoint(tracepointName string) bool { + fmt.Println("ShouldIAttachTracepoint called with", tracepointName) for _, re := range flags.TracepointsToExclude { if re.MatchString(tracepointName) { fmt.Println("Not attaching", tracepointName, "as excluded") |
