summaryrefslogtreecommitdiff
path: root/internal/ior_bpfsetup.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-18 09:24:22 +0200
committerPaul Buetow <paul@buetow.org>2026-03-18 09:24:22 +0200
commitdbb98cd8dbd70dd92b8a541653e64c45b18348fa (patch)
treef2faa385564a4700c608bcf8f2ffc638c1c0bd27 /internal/ior_bpfsetup.go
parent630ea0ff27b8e9ff9287eaaf67660845406a19a6 (diff)
refactor: split TraceRuntimeBindings into RuntimePublisher and RuntimeState (task 427/ISP)
TraceRuntimeBindings mixed 4 setter methods (injecting data into TUI) with 4 getter methods (reading persistent TUI-owned state), violating ISP. Split into two focused interfaces: - RuntimePublisher: SetDashboardSnapshotSource, SetEventStreamSource, SetLiveTrie, SetProbeManager — the write/inject side - RuntimeState: StreamBuffer, Recorder, StreamSequencer, FilterEpoch — the read/persistent-state side TraceRuntimeBindings now embeds both, preserving all existing call sites. RuntimePublisherFromContext() added so callers that only inject data do not see the getter surface. Three such callers are narrowed: setupBPFModule, tuiTestFlamesStarter, tuiTestLiveFlamesStarter. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'internal/ior_bpfsetup.go')
-rw-r--r--internal/ior_bpfsetup.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/ior_bpfsetup.go b/internal/ior_bpfsetup.go
index cf0b112..3500106 100644
--- a/internal/ior_bpfsetup.go
+++ b/internal/ior_bpfsetup.go
@@ -70,7 +70,9 @@ func setupBPFModule(parentCtx context.Context, cfg flags.Config) (*bpf.Module, *
bpfModule.Close()
return nil, nil, releaseBindings, setupBPFModuleError("attach probes", err)
}
- if bindings, ok := tui.RuntimeBindingsFromContext(parentCtx); ok {
+ // setupBPFModule only injects the probe manager; it does not read TUI state,
+ // so RuntimePublisher is the correct narrower interface to use here.
+ if bindings, ok := tui.RuntimePublisherFromContext(parentCtx); ok {
bindings.SetProbeManager(mgr)
releaseBindings = func() { bindings.SetProbeManager(nil) }
}