diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-13 19:35:02 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-13 19:35:02 +0300 |
| commit | f4a814df4e39ff5547a88d4f5d37ae6fe159cc76 (patch) | |
| tree | 24410b41efdabbf037d0efc4ee8cb577252faf9c /internal/ior_bpfsetup.go | |
| parent | e6b85dd4222eb1660b591f5dbf6e2b58dfae3bfa (diff) | |
refactor: move TraceFilter and tracepoint selector logic out of flags.Config
- Add tracepoints.Selector type with ShouldAttach method and ParseSelector
constructor, replacing the raw TracepointsToAttach/TracepointsToExclude
regex slices on flags.Config.
- Add flags.BuildTraceFilter as a standalone function replacing the
Config.TraceFilter() method, keeping filter-building logic out of the
config struct.
- Remove stale ShouldIAttachTracepoint noise-filter entry from Magefile.
- Add selector_test.go with full coverage of ParseSelector and ShouldAttach.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/ior_bpfsetup.go')
| -rw-r--r-- | internal/ior_bpfsetup.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/ior_bpfsetup.go b/internal/ior_bpfsetup.go index 885d321..0d32d4c 100644 --- a/internal/ior_bpfsetup.go +++ b/internal/ior_bpfsetup.go @@ -73,7 +73,7 @@ func setupBPFModule(parentCtx context.Context, cfg flags.Config) (*bpf.Module, * warn := func(syscall string, err error) { fmt.Fprintf(os.Stderr, "ior: skipping tracepoint for %s: %v\n", syscall, err) } - if err := mgr.AttachAll(cfg.ShouldIAttachTracepoint, tracepoints.List, warn); err != nil { + if err := mgr.AttachAll(cfg.TracepointSelector.ShouldAttach, tracepoints.List, warn); err != nil { mgr.Close() bpfModule.Close() return nil, nil, releaseBindings, setupBPFModuleError("attach probes", err) |
