Skip to content

Add completion spec: pprof#265

Merged
lucieleblanc merged 1 commit into
mainfrom
app-4152/command-spec-pprof
Apr 20, 2026
Merged

Add completion spec: pprof#265
lucieleblanc merged 1 commit into
mainfrom
app-4152/command-spec-pprof

Conversation

@warp-dev-github-integration
Copy link
Copy Markdown

@warp-dev-github-integration warp-dev-github-integration Bot commented Apr 20, 2026

Adds a comprehensive completion spec for pprof, the profiling data visualization and analysis tool.

Linear: APP-4152

What's included

  • command-signatures/json/pprof.json — full spec covering:

    • All documented output formats (-text, -dot, -png, -svg, -pdf, -http, -web, -weblist, -tree, -traces, -peek, -list, -disasm, -callgrind, -kcachegrind, -eog, -evince, -gv, -gif, -ps, -proto, -raw, -tags, -top, -topproto, -comments). Formats that take a regexp (-list, -peek, -disasm, -weblist) declare their arg.
    • All documented options (-focus, -ignore, -hide, -show, -show_from, -prune_from, -nodecount, -nodefraction, -edgefraction, -call_tree, -compact_labels, -divide_by, -drop_negative, -intel_syntax, -mean, -noinlines, -normalize, -output, -relative_percentages, -sample_index, -showcolumns, -source_path, -tagfocus, -taghide, -tagignore, -tagleaf, -tagroot, -tagshow, -trim, -trim_path, -unit).
    • Option groups:
      • Granularity: -functions, -filefunctions, -files, -lines, -addresses
      • Sort: -cum, -flat
    • Source options (-seconds, -timeout, -buildid, -add_comment, -diff_base, -base, -symbolize, -tls_cert, -tls_key, -tls_ca).
    • Misc options (-http, -no_browser, -tools, -all_frames).
    • Legacy convenience options (-inuse_space, -inuse_objects, -alloc_space, -alloc_objects, -total_delay, -contentions, -mean_delay).
    • Structured suggestions for enumerated values:
      • -sample_index: inuse_space, inuse_objects, alloc_space, alloc_objects, cpu, samples, contentions, delay
      • -symbolize: none, local, fastlocal, remote, force (with requiresSeparator: true since pprof only accepts -symbolize=<mode>)
      • -unit: auto, nanoseconds, microseconds, milliseconds, seconds, minutes, hours, bytes, kilobytes, megabytes, gigabytes
    • filepaths/folders templates for file-/directory-taking flags.
    • Variadic optional positional arg for the binary and/or profile source(s), wired to the saved_profiles generator plus the filepaths template.
    • flagsArePosixNoncompliant: true since pprof uses Go's flag package (single-dash flags).
  • command-signatures/src/generators/pprof.rs — new saved_profiles generator that lists cached profile files in $PPROF_TMPDIR (defaulting to $HOME/pprof). It is referenced by the positional source argument and by -base / -diff_base. The generator matches common profile filename patterns (*.pb.gz, *.pprof, *.prof, profile, profile.pb) and is cross-platform (uses find with POSIX-compatible options and the PPROF_TMPDIR environment variable).

Validation

  • npm run format:check: passes
  • cargo fmt -p warp-command-signatures -p warp-completion-metadata --check: passes
  • cargo clippy -p warp-command-signatures -p warp-completion-metadata --all-targets --all-features -- -D warnings: passes
  • cargo test --verbose: 59 passed, 0 failed (main suite) + auxiliary suites all pass

Generator shell-level verification

Ran the generator's underlying shell command against a seeded $HOME/pprof to confirm it returns reasonable profile suggestions:

$ ls $HOME/pprof
cpu_profile.pb.gz  heap_profile.pb.gz  sample.pprof

$ sh -c 'dir="${PPROF_TMPDIR:-$HOME/pprof}"; [ -d "$dir" ] || exit 0; find "$dir" -maxdepth 2 -type f \( -name "*.pb.gz" -o -name "*.pprof" -o -name "*.prof" -o -name "profile" -o -name "profile.pb" \) 2>/dev/null'
/root/pprof/heap_profile.pb.gz
/root/pprof/sample.pprof
/root/pprof/cpu_profile.pb.gz

Screenshots

⚠️ Note: This PR was authored in a headless agent sandbox without a GUI or a prebuilt Warp binary. GUI screenshots of the completion menu could not be captured from within the sandbox. The saved_profiles generator is verified above at the shell level (the exact command the generator runs). A reviewer can verify the in-Warp UX by following command-signatures/.agents/skills/test-local-warp/SKILL.md (patch warp-internal's Cargo.toml to point warp-command-signatures at this branch, then cargo run --features fast_dev and press Tab after pprof ).

Conversation: https://staging.warp.dev/conversation/58e97815-cba4-41cd-9c4b-0450f19e7b9a
Run: https://oz.staging.warp.dev/runs/019dab86-a5a7-739d-90f0-203c3127383a

This PR was generated with Oz.

Adds a comprehensive completion spec for pprof (github.com/google/pprof),
the profiling data visualization and analysis tool.

The spec covers all documented output formats, options, option groups
(granularity, sort), source options, misc options, and legacy convenience
flags, matching the pprof --help surface. Structured suggestions are
provided for enumerated values like -sample_index, -symbolize, and -unit.

A saved_profiles generator is added that lists cached profile files in
$PPROF_TMPDIR (defaulting to $HOME/pprof). It is used to power
completions for the positional source argument and for -base/-diff_base.

Co-Authored-By: Oz <oz-agent@warp.dev>
@linear
Copy link
Copy Markdown

linear Bot commented Apr 20, 2026

APP-4152 Add pprof completions

https://github.com/google/pprof

A tool for visualizing and analyzing profiling data.

@warp-dev-github-integration
Copy link
Copy Markdown
Author

saved_profiles generator screenshots

Captured from a local Warp build (cargo build --features fast_dev --bin warp) with warp-internal pointed at this branch. $HOME/pprof/ was seeded with cpu_profile.pb.gz, heap_profile.pb.gz, sample.pprof, and trace.prof before each invocation.

Each screenshot shows the Warp completions dropdown (triggered by Tab) populated with the seeded saved profiles (labeled "Saved profile") from the saved_profiles generator at each of its three invocation sites.

1. Positional source arg — pprof + Tab

pprof positional

2. -base flag — pprof -base + Tab

pprof -base

3. -diff_base flag — pprof -diff_base + Tab

pprof -diff_base

(Images hosted on Linear rather than GitHub user-content because the sandbox environment didn't have a browser session cookie required by the undocumented GitHub upload API; they are also attached to APP-4152.)

@lucieleblanc lucieleblanc marked this pull request as ready for review April 20, 2026 17:08
Copy link
Copy Markdown
Contributor

@lucieleblanc lucieleblanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lucieleblanc lucieleblanc merged commit 85a8bfa into main Apr 20, 2026
3 checks passed
@lucieleblanc lucieleblanc deleted the app-4152/command-spec-pprof branch April 20, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant