summaryrefslogtreecommitdiff
path: root/internal/eventloop.go
AgeCommit message (Collapse)Author
2026-05-224c extract event kind runtime registryPaul Buetow
2026-05-20fix(task-17): prevent aggregate double-count and flush on shutdownPaul Buetow
2026-05-20feat: add syscall aggregate sampling infrastructure (task 17)Paul Buetow
2026-05-13refactor: extract outputFormatter collaborator from eventLoopPaul Buetow
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>
2026-05-08swap global filter in place to skip BPF reattachPaul Buetow
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.
2026-04-18fix task 45: bound pending handle cleanupPaul Buetow
2026-03-18refactor: extract pairTracker and extend fdTracker to reduce eventLoop ↵Paul Buetow
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>
2026-03-18refactor: replace reflect.TypeOf dispatch in exit handlers with type switch ↵Paul Buetow
(task 432) The exitHandlers map keyed by reflect.Type was a reflection-based dispatch table that incurred allocation and reflection overhead on every event pair in the hot processing path. Replace it with a plain type switch in handleTracepointExit, which the compiler resolves statically. Removes: initExitHandlers, typeKey, mustBeType, newTypedExitHandler, exitHandlerRegistry, the exitHandlers struct field, and the tracepointExitHandler type alias — all dead after the switch. Fixes a pre-existing uint→uint64 mismatch in stats(). Updates tests to target the new default branch directly. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-13Handle procfs lookup errors in event loop (task 392)Paul Buetow
2026-03-13Refactor event loop into focused units (task 389)Paul Buetow
2026-03-11eventloop: factor malformed-event helpers (task 383)Paul Buetow
2026-03-10eventloop: avoid fmt.Sprintf in proc comm lookup (task 426)Paul Buetow
2026-03-10eventloop: bound pending enter and proc-fd caches (task 425)Paul Buetow
2026-03-10task 434: unify trace filter plumbingPaul Buetow
2026-03-08tui: restore global filter stack and anchored matchesPaul Buetow
2026-03-08tests: replace eventloop sleep synchronization with deterministic signalingPaul Buetow
2026-03-08eventloop: remove gosched by snapshotting emitted fd statePaul Buetow
2026-03-08task(ior): remove eventloop busy-wait polling (task 2b8f8f83)Paul Buetow
2026-03-08task(ior): add comm resolver shutdown lifecycle (task fcd866dd)Paul Buetow
2026-03-08task(ior): harden malformed raw-event decoding (task ed7a7a3f)Paul Buetow
2026-03-06refactor: use pointer receivers for FdFile consistently (task 382)Paul Buetow
2026-03-06refactor: make wrappers the only eventloop state maps (task 383)Paul Buetow
2026-03-06refactor: remove dot imports for internal types (task 382)Paul Buetow
2026-03-06refactor: bound comm resolver lookups with worker pool (task 384)Paul Buetow
2026-03-06refactor: inject eventloop deps and registry exit handlers (task 389)Paul Buetow
2026-03-06fix: return errors for invalid event filters (task 382)Paul Buetow
2026-03-06refactor: remove web flamegrapher and keep TUI-onlyPaul Buetow
2026-03-03Invalidate proc-fd cache on close_rangePaul Buetow
2026-03-03Use fast non-reflective event decoding on hot pathPaul Buetow
2026-03-03Cache procfs fd metadata for unknown descriptorsPaul Buetow
2026-03-02Launch live browser opener as invoking sudo userPaul Buetow
2026-03-02Make --open a command template with no defaultsPaul Buetow
2026-03-02Add --open support for live flamegraph browser launchPaul Buetow
2026-03-02Extract shared fd duplication helperPaul Buetow
2026-03-01Use print callback for all event loop output modesPaul Buetow
2026-03-01Extract fd and comm state helpers from eventLoopPaul Buetow
2026-03-01Thread runtime config instead of global flags readsPaul Buetow
2026-03-01Move comm procfs lookups off the hot pathPaul Buetow
2026-03-01Refactor tracepointExited into per-type handlersPaul Buetow
2026-03-01Route non-fatal event-loop warnings to TUIPaul Buetow
2026-03-01eventloop: replace raw-event switch with handler registry (task 314)Paul Buetow
2026-03-01eventloop: inject runtime config instead of flags singleton (task 315)Paul Buetow
2026-03-01eventloop: reuse comm resolver for pid seeding (task 317)Paul Buetow
2026-02-27eventloop: wire live trie ingestion and serverPaul Buetow
2026-02-26tui: revamp status keys and add pid/tid reselection flowPaul Buetow
2026-02-23Track pidfd_getfd returned fds in eventloopPaul Buetow
2026-02-23Add getcwd tracing support and stabilize comm propagation testPaul Buetow
2026-02-23Fix integration trace expectations and fd/open event handlingPaul Buetow
2026-02-22Fix event comm attribution and reduce integration log noisePaul Buetow
2026-02-22Add copy_file_range support and tracepoint attach testsPaul Buetow