summaryrefslogtreecommitdiff
path: root/internal/flags/flags.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-23 20:04:06 +0300
committerPaul Buetow <paul@buetow.org>2026-05-23 20:04:06 +0300
commit4541ee21203f7c494530f142a6387244ac3a6c62 (patch)
tree3279dcafffcbcb22662f01fea1f9afb0e4039663 /internal/flags/flags.go
parentb4a172404be8b52ed62171dcbbd3e9f46e36ac67 (diff)
0c promote aggregate-only sampling defaults in raw output modes
Default aggregate-only sampling (rate 0) for futex* and clock_gettime causes BPF to suppress ring-buffer events. In -plain, -flamegraph, and headless -parquet modes there is no aggregate sink, so these probes would emit no rows even when explicitly selected. Promote those defaults to rate 1 during flag resolution; user-explicit overrides are preserved. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Diffstat (limited to 'internal/flags/flags.go')
-rw-r--r--internal/flags/flags.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/flags/flags.go b/internal/flags/flags.go
index cc39638..c20707b 100644
--- a/internal/flags/flags.go
+++ b/internal/flags/flags.go
@@ -85,6 +85,15 @@ type Config struct {
ShowVersion bool
}
+// IsRawOutputMode reports whether the config selects a headless output path
+// (-plain, -flamegraph, or headless -parquet) that lacks a TUI aggregate
+// sink. In these modes, aggregate-only sampling (rate 0) would silently
+// suppress ring-buffer events, so callers should promote default aggregate-
+// only rates to 1.
+func (f Config) IsRawOutputMode() bool {
+ return f.PlainMode || f.FlamegraphOutput || strings.TrimSpace(f.ParquetPath) != ""
+}
+
// DefaultResetTimer is the default cadence for the dashboard's auto-reset
// timer. It periodically clears aggregate state (live flamegraph trie and
// stats engine) — the same effect as pressing `r` — to prevent unbounded
@@ -266,6 +275,13 @@ func resolveSamplingRates(cfg *Config, familySampling, syscallSampling *string)
}
cfg.SyscallFamilySamplingRates = familyRates
cfg.SyscallSamplingRates = mergeSyscallSamplingRates(syscallRates)
+ // In raw output modes (-plain, -flamegraph, headless -parquet) there is
+ // no aggregate sink, so aggregate-only defaults (rate 0) would silently
+ // suppress ring-buffer events. Promote those defaults to rate 1 unless
+ // the user explicitly requested rate 0 via -syscall-sampling-syscalls.
+ if cfg.IsRawOutputMode() {
+ promoteAggregateOnlyForRawOutput(cfg.SyscallSamplingRates, syscallRates)
+ }
return nil
}