From 4ca34f040203c8e31603bbb39fd38632b68067d8 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 26 Feb 2026 23:33:55 +0200 Subject: tui: add paused stream CSV export and foreground editor open --- internal/ior.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'internal/ior.go') diff --git a/internal/ior.go b/internal/ior.go index a910fc0..a19d2f7 100644 --- a/internal/ior.go +++ b/internal/ior.go @@ -272,9 +272,17 @@ func runTraceWithContext(parentCtx context.Context, started chan<- struct{}, con origPrintCb(ep) } } - duration := time.Duration(flags.Get().Duration) * time.Second - logln("Probing for", duration) - ctx, cancel := context.WithTimeout(parentCtx, duration) + cfg := flags.Get() + ctx := parentCtx + cancel := func() {} + if shouldAutoStopByDuration(cfg) { + duration := time.Duration(cfg.Duration) * time.Second + logln("Probing for", duration) + ctx, cancel = context.WithTimeout(parentCtx, duration) + } else { + logln("Probing until stopped...") + ctx, cancel = context.WithCancel(parentCtx) + } defer cancel() signalCh := make(chan os.Signal, 1) @@ -318,3 +326,7 @@ func signalTraceStarted(started chan<- struct{}) { } close(started) } + +func shouldAutoStopByDuration(cfg flags.Flags) bool { + return cfg.PlainMode || cfg.FlamegraphEnable || cfg.PprofEnable +} -- cgit v1.2.3