summaryrefslogtreecommitdiff
path: root/internal/flags
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-12 23:26:02 +0200
committerPaul Buetow <paul@buetow.org>2026-03-12 23:26:02 +0200
commit28338f46461c684f1448878a5d9dcd7f2121f7d2 (patch)
treedc367c25c342c557100670c962b0e8deceb7dae7 /internal/flags
parentf28dab3d42c6e4a33642b990f60f69abc2d89f07 (diff)
fix: restore legacy flamegraph trace output mode
Diffstat (limited to 'internal/flags')
-rw-r--r--internal/flags/flags.go20
-rw-r--r--internal/flags/flags_test.go13
2 files changed, 25 insertions, 8 deletions
diff --git a/internal/flags/flags.go b/internal/flags/flags.go
index df4187c..9161378 100644
--- a/internal/flags/flags.go
+++ b/internal/flags/flags.go
@@ -42,14 +42,16 @@ type Config struct {
TracepointsToExclude []*regexp.Regexp
// Output/runtime flags
- PlainMode bool
- TestFlames bool
- TestLiveFlames bool
- LiveInterval time.Duration
- TUIExportEnable bool
- CollapsedFields []string
- CountField string
- GlobalFilter globalfilter.Filter
+ PlainMode bool
+ FlamegraphOutput bool
+ OutputName string
+ TestFlames bool
+ TestLiveFlames bool
+ LiveInterval time.Duration
+ TUIExportEnable bool
+ CollapsedFields []string
+ CountField string
+ GlobalFilter globalfilter.Filter
}
// NewFlags returns a configuration instance initialized with project defaults.
@@ -167,6 +169,8 @@ func parse() error {
tracepointsToExclude := flag.String("tpsExclude", "", "Comma separated list regexes for tracepoints to exclude")
flag.BoolVar(&cfg.PlainMode, "plain", false, "Enable plain CSV output mode (disable TUI)")
+ flag.BoolVar(&cfg.FlamegraphOutput, "flamegraph", false, "Write aggregated .ior.zst output for trace/integration workflows")
+ flag.StringVar(&cfg.OutputName, "name", cfg.OutputName, "Base name for .ior.zst trace output files")
flag.BoolVar(&cfg.TestFlames, "testflames", false, "Run TUI with static synthetic flamegraph data for keyboard-navigation testing")
flag.BoolVar(&cfg.TestLiveFlames, "testliveflames", false, "Run TUI with continuously-updating synthetic flamegraph data for live keyboard-navigation testing")
flag.DurationVar(&cfg.LiveInterval, "live-interval", cfg.LiveInterval, "Synthetic live flamegraph refresh interval for --testliveflames")
diff --git a/internal/flags/flags_test.go b/internal/flags/flags_test.go
index 2469068..4485f34 100644
--- a/internal/flags/flags_test.go
+++ b/internal/flags/flags_test.go
@@ -102,6 +102,19 @@ func TestParseTestLiveFlamesFlag(t *testing.T) {
}
}
+func TestParseFlamegraphOutputFlags(t *testing.T) {
+ cfg, err := parseForTest(t, "--flamegraph", "--name", "scenario-run")
+ if err != nil {
+ t.Fatalf("parse returned error: %v", err)
+ }
+ if !cfg.FlamegraphOutput {
+ t.Fatalf("expected --flamegraph to enable .ior.zst output mode")
+ }
+ if got, want := cfg.OutputName, "scenario-run"; got != want {
+ t.Fatalf("output name = %q, want %q", got, want)
+ }
+}
+
func TestParseDefaultCollapsedFieldsOrder(t *testing.T) {
cfg, err := parseForTest(t)
if err != nil {