Analyzer rust-on-cpu
Name
rust-on-cpu - Rust-Land on-CPU Flame Graph
This analyzer profiles on-CPU execution time in Rust applications by capturing stack traces during active CPU usage. It performs periodic sampling of running threads to identify which Rust functions consume the most CPU cycles. The analyzer generates flame graphs that visualize the CPU time distribution across the call stack hierarchy, making it easy to pinpoint performance hotspots and optimize CPU-intensive code paths in Rust applications.
Resource Category
CPU.
Application Type & Technical Stack
- Rust
Command Line Syntax
The analyzer can be invoked directly on the command-line via the orxray
utility from the openresty-xray-cli software package.
Alternatively, the analyzer can also be invoked manually or automatically on the web console UI of OpenResty XRay (like on the Advanced web page).
# PID is the target process PID.
orxray analyzer run rust-on-cpu -p PID
# trace a shell command directly
orxray analyzer run rust-on-cpu -c SHELL_CMD
# PGID is the process group ID or any process's PID within the target process
# group.
orxray analyzer run rust-on-cpu -p -PGID
# trace any processes started from the specified executable path.
orxray analyzer run rust-on-cpu --exe /path/to/exe/file
Tracing Multiple Processes
Supported.
Output Formats
- Flame Graphs
Author
The OpenResty Inc. Team.
Copyright
Copyright (C) by OpenResty Inc. All rights reserved.