From f86699a94bdde7d973ba5d6fa3e7ca4ab2f234fb Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 8 May 2026 19:43:33 +0300 Subject: add duration metric, tolerate missing tracepoints, ship el8 build - Bubbles, treemap, icicle, and the live flamegraph 'b' cycle now include syscall duration (sum) as a third metric alongside events and bytes. Statsengine snapshots expose TotalLatencyNs to support this. - AttachAll takes an optional warn callback. Production passes one so older kernels that lack newer tracepoints log a warning and keep going instead of aborting startup. - Dockerfile.el8 + scripts/build-with-docker-el8.sh + mage buildDockerEl8 produce ior.el8, a static binary built against Rocky Linux 8 glibc for RHEL/Rocky/Alma 8 hosts. - README.md documents installing mage and the new el8 target. --- internal/probemanager/manager.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'internal/probemanager/manager.go') diff --git a/internal/probemanager/manager.go b/internal/probemanager/manager.go index 288af41..677762b 100644 --- a/internal/probemanager/manager.go +++ b/internal/probemanager/manager.go @@ -79,7 +79,17 @@ func (m *Manager) Register(syscall string, pair TracepointPair) { } // AttachAll registers and attaches all tracepoint pairs selected by shouldAttach. -func (m *Manager) AttachAll(shouldAttach func(string) bool, tpNames []string) error { +// +// If onAttachError is non-nil, per-syscall attach failures are reported through +// the callback and AttachAll continues with the remaining tracepoints. This is +// the desired mode in production: when running a binary built on a newer kernel +// against an older one, some syscalls' tracepoints may be absent and the +// corresponding attach call returns ENOENT. The error is recorded on the +// probe entry (visible via States()) regardless of the callback. +// +// If onAttachError is nil, AttachAll preserves the strict legacy behavior and +// returns the first attach error to the caller. Tests rely on this mode. +func (m *Manager) AttachAll(shouldAttach func(string) bool, tpNames []string, onAttachError func(syscall string, err error)) error { if m == nil { return errors.New("probe manager is nil") } @@ -94,7 +104,10 @@ func (m *Manager) AttachAll(shouldAttach func(string) bool, tpNames []string) er continue } if err := m.Attach(syscall); err != nil { - return err + if onAttachError == nil { + return err + } + onAttachError(syscall, err) } } return nil -- cgit v1.2.3