### Install agentpprof with cargo install Source: https://docs.rs/agentpprof Installs the agentpprof binary from crates.io. ```bash cargo install agentpprof ``` -------------------------------- ### Choose profile view with --view Source: https://docs.rs/agentpprof Selects the projection view for the profile: operations, tokens, files, network, or time. ```bash agentpprof -o operations.pb.gz --view operations agentpprof -o tokens.pb.gz --view tokens agentpprof -o files.pb.gz --view files agentpprof -o network.pb.gz --view network agentpprof -o time.pb.gz --view time ``` -------------------------------- ### Run agentpprof from repository with cargo run Source: https://docs.rs/agentpprof Runs agentpprof from the repository source using the manifest at ext/pprof/Cargo.toml. ```bash cargo run --manifest-path ext/pprof/Cargo.toml -- -o agent.pb.gz ``` -------------------------------- ### Select sessions with --session-file, --agent, --session-id, --session-tag, --prompt-tag Source: https://docs.rs/agentpprof Selects sessions by explicit file, agent, session ID, session tag, or prompt tag. ```bash agentpprof -o agent.pb.gz --session-file ~/.codex/sessions/.../session.jsonl agentpprof -o agent.pb.gz --agent codex agentpprof -o agent.pb.gz --session-id 019ec5 agentpprof -o agent.pb.gz --session-tag profile agentpprof -o agent.pb.gz --prompt-tag review ``` -------------------------------- ### Select output format by extension Source: https://docs.rs/agentpprof Selects output format by extension: .folded for folded stacks, .svg for a flamegraph, and .json for JSON output. ```bash agentpprof -o operations.folded --view operations agentpprof -o tokens.svg --view tokens agentpprof -o files.json --view files ``` -------------------------------- ### Open agentpprof profile with go tool pprof Source: https://docs.rs/agentpprof Opens the generated profile with standard Go pprof, either as a top list or an interactive HTTP interface. ```bash go tool pprof -top agent.pb.gz go tool pprof -http=:0 agent.pb.gz ``` -------------------------------- ### Generate semantic task profile with agentpprof Source: https://docs.rs/agentpprof Generates a semantic task profile for the current repository, writing to agent.pb.gz. ```bash agentpprof --project-root . -o agent.pb.gz ``` -------------------------------- ### Add custom tag rules with --tag-rule Source: https://docs.rs/agentpprof Adds project-specific deterministic tag rules using KIND:TAG=REGEX, tried in command-line order before built-in rules. ```bash agentpprof -o operations.svg \ --tagger regex \ --tag-rule prompt:review='(?i)review|diff|regression' \ --tag-rule prompt:test='(?i)cargo test|pytest|unit test' ``` -------------------------------- ### Use LLM tagger with llama-server Source: https://docs.rs/agentpprof Runs a llama.cpp-compatible server and uses it for model-produced one-word tags. ```bash llama-server -m /path/to/model.gguf --port 8080 agentpprof -o agent.pb.gz --tagger llm --llama-url http://127.0.0.1:8080 ``` -------------------------------- ### Run agentpprof tests with cargo test Source: https://docs.rs/agentpprof Runs the test suite for the agentpprof crate. ```bash cargo test --manifest-path ext/pprof/Cargo.toml ``` -------------------------------- ### Use regex tagger with --tagger regex Source: https://docs.rs/agentpprof Uses the deterministic regex tagger. ```bash agentpprof -o agent.pb.gz --tagger regex ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.