diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-12 22:12:32 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-12 22:12:32 +0300 |
| commit | 8a4cb57703845c1d8ffbc9318a4125818a72a545 (patch) | |
| tree | 5bd9dbc8f77b99de7dced2e867c36ccbf653e533 /internal/ior_bpfsetup.go | |
| parent | a256cbf9f54ab89aeae0aa9408c1c2b25622fa9d (diff) | |
invert dependency: internal no longer imports internal/tui
Introduce internal/runtime as a neutral contract package that both the
core engine (internal) and the TUI layer (internal/tui) depend on.
- internal/runtime: defines TraceStarter, StreamSource, EventSink,
LiveTrieSource, SnapshotSource, ProbeManager, RuntimePublisher,
RuntimeState, TraceRuntimeBindings, and all context key/helper
functions (RuntimeBindingsFromContext, RuntimePublisherFromContext,
ContextWithRuntimeBindings, ContextWithTraceFilters,
TraceFiltersFromContext). These were previously defined in
internal/tui, forcing the core package to import the TUI layer.
- internal/streamrow: add RingBuffer (moved from internal/tui/eventstream)
so the core tracing engine can use the ring buffer without importing
the TUI layer.
- internal/tui/eventstream/ringbuffer.go: change to a thin re-export of
streamrow.RingBuffer via a type alias, preserving the existing API for
all callers within the TUI layer.
- internal/tui/tui.go: replace locally-defined interface declarations
(TraceStarter, SnapshotSource, ProbeManager, RuntimePublisher,
RuntimeState, TraceRuntimeBindings) with type aliases from
internal/runtime. Delegate all context helper functions to runtime.
- internal/ior.go, internal/ior_bpfsetup.go: remove imports of
internal/tui and internal/tui/eventstream; use internal/runtime and
internal/streamrow instead. Add SetTUIRunners injection point so the
concrete TUI runner functions are wired in by cmd/ior/main.go.
- cmd/ior/main.go: call internal.SetTUIRunners with the concrete TUI
runner functions before internal.Run, completing the wiring without
creating a cycle.
- Test files (internal/ior_mode_test.go, internal/bench_pipeline_test.go):
updated to use runtime.* and streamrow.* types in place of tui.* and
eventstream.* types.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/ior_bpfsetup.go')
| -rw-r--r-- | internal/ior_bpfsetup.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/ior_bpfsetup.go b/internal/ior_bpfsetup.go index 9ab9186..d5f3be8 100644 --- a/internal/ior_bpfsetup.go +++ b/internal/ior_bpfsetup.go @@ -8,8 +8,8 @@ import ( appconfig "ior/internal/config" "ior/internal/flags" "ior/internal/probemanager" + "ior/internal/runtime" "ior/internal/tracepoints" - "ior/internal/tui" bpf "github.com/aquasecurity/libbpfgo" ) @@ -80,7 +80,7 @@ func setupBPFModule(parentCtx context.Context, cfg flags.Config) (*bpf.Module, * } // 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 { + if bindings, ok := runtime.RuntimePublisherFromContext(parentCtx); ok { bindings.SetProbeManager(mgr) releaseBindings = func() { bindings.SetProbeManager(nil) } } |
