summaryrefslogtreecommitdiff
path: root/internal/eventloop.go
AgeCommit message (Collapse)Author
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
2026-02-22Implement mmap/msync syscall support with unit and integration coveragePaul Buetow
2026-02-22Implement sync_file_range coverage and document mage world bootstrapPaul Buetow
2026-02-21fix: close_range path resolution - lookup fd before deleting from mapPaul Buetow
Move e.files[fd] lookup before the close_range fd cleanup loop in the FdEvent handler so the file path is resolved while the fd still exists in the map. Previously, close_range events always fell through to file.NewFdWithPid() which couldn't resolve the path since the fd was already closed. Also add unit test assertion verifying ep.File resolves to the correct filename for close_range events. Task: 349 Amp-Thread-ID: https://ampcode.com/threads/T-019c8180-1da4-7048-9200-ae93bdd90cab Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Add byte count tracking to event pairsPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c8012-eaeb-768d-a264-5a704f3939ef Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Enable name_to_handle_at and io_uring fd attributionPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7fec-eec9-706a-8338-3ce674802680 Co-authored-by: Amp <amp@ampcode.com>
2026-02-21Track io_uring setup fds in event loopPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c7fd9-5870-77b7-9909-3eb7550d17bb Co-authored-by: Amp <amp@ampcode.com>