summaryrefslogtreecommitdiff
path: root/internal/ior.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-02 07:39:13 +0200
committerPaul Buetow <paul@buetow.org>2026-03-02 07:39:13 +0200
commit73652016579518ddc3524d42b345e7c566a7f5fc (patch)
treef8d23ff5088802452e1f304d3be053124611f2d3 /internal/ior.go
parent52cc7dc6ccdf2d97ea49d361299701cf6b76e898 (diff)
Replace TUI service-locator globals with runtime bindings
Diffstat (limited to 'internal/ior.go')
-rw-r--r--internal/ior.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/internal/ior.go b/internal/ior.go
index c43ad45..39d09b5 100644
--- a/internal/ior.go
+++ b/internal/ior.go
@@ -170,8 +170,10 @@ func tuiTraceStarterFromRunTrace(
engine := statsengine.NewEngine(64)
streamBuf := eventstream.NewRingBuffer()
- tui.SetDashboardSnapshotSource(engine)
- tui.SetEventStreamSource(streamBuf)
+ if bindings, ok := tui.RuntimeBindingsFromContext(ctx); ok {
+ bindings.SetDashboardSnapshotSource(engine)
+ bindings.SetEventStreamSource(streamBuf)
+ }
streamEvents := make(chan eventstream.StreamEvent, 4096)
go func() {
@@ -271,8 +273,10 @@ func runTraceWithContext(parentCtx context.Context, started chan<- struct{}, con
if err := mgr.AttachAll(cfg.ShouldIAttachTracepoint, tracepoints.List); err != nil {
return err
}
- tui.SetProbeManager(mgr)
- defer tui.SetProbeManager(nil)
+ if bindings, ok := tui.RuntimeBindingsFromContext(parentCtx); ok {
+ bindings.SetProbeManager(mgr)
+ defer bindings.SetProbeManager(nil)
+ }
// 4096 channel size, minimises event drops
ch := make(chan []byte, 4096)