| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Split 22 production files across the codebase — event loop, TUI models,
probe manager, dashboard, export, flag parsing, code generation, and
ioworkload scenarios — so that no function body exceeds 50 lines. Each
extracted helper carries its own comment explaining its role.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
The printCb and warningCb function fields on eventLoop bundled two
distinct concerns (pair emission and warning delivery) directly on the
event-processing struct. This commit extracts them into a dedicated
outputFormatter type that owns these callbacks plus emit() and
notifyWarning() helper methods.
outputFormatter is embedded (not pointed-to) in eventLoop so that
existing call sites — including tests that write el.printCb = ... and
el.warningCb = ... directly — require no changes beyond the three
struct-literal sites in eventloop_filter_test.go that used field
initialiser syntax.
fdTracker and commResolver were already proper collaborator types; only
the output concern needed extraction.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Wrap processRawEvent calls in a new processRawEventSafe() helper that
uses defer/recover to catch any panic from a callback and convert it into
a warning notification via warningCb, preventing a single bad event from
crashing the whole process. Added TestEventsPanicInCallbackIsRecoveredAndNotified
to verify the recovery behaviour end-to-end.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Changing the global filter used to call stopTrace + beginTraceCmd, which
detached and re-attached every tracepoint and re-loaded the BPF object.
On heavily loaded I/O systems that took several seconds and showed an
'Attaching tracepoints...' overlay each time. The probe set never depends
on the global filter (ShouldIAttachTracepoint only reads CLI regex flags),
so the restart was gratuitous.
Now the eventloop holds its filter behind atomic.Pointer with SetFilter /
Filter accessors, and the trace starter registers el.SetFilter via the
runtime bindings as a SetLiveFilterSetter callback. applyGlobalFilter
and undoGlobalFilter call runtime.applyLiveFilter first; only if no
trace is running do they fall back to the full restart path.
|
|
responsibilities (task 428)
The eventLoop struct held 20+ fields across 5+ responsibilities (SRP violation).
Extract two cohesive sub-structs:
- pairTracker: enter/exit pair matching, age-based LRU pruning, and
DurationToPrev tracking. Replaces enterEvs/enterEvAges/prevPairTimes/
maxPendingEnterEvs/cacheAge fields with a single embedded value.
- fdTracker (extended): absorbs procFdCache/procFdAges/maxProcFdCacheSize,
moving all procfs-resolution cache logic (resolve, cache, prune, delete)
off eventLoop and onto the tracker that already owns the fd table.
eventLoop drops from 20 fields to 12. All methods that previously reached
into eventLoop fields now live on the struct that owns the data.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
|
|