CPU Profiling¶
Thread-level CPU utilization analysis, hotspot detection, and contention analysis.
Overview¶
CPU analysis helps identify which threads are consuming resources, what code is running during performance-critical sections, and where thread contention is causing delays.
Commands¶
cpu utilization¶
Per-thread CPU utilization breakdown.
Options:
| Option | Description | Default |
|---|---|---|
--include-frequency |
Include CPU frequency (DVFS) information | Off |
cpu hotspots¶
Identify the top time-consuming slices on the main thread.
Options:
| Option | Description | Default |
|---|---|---|
--limit <n> |
Maximum number of hotspot slices to show | 20 |
cpu contention¶
Analyze thread contention β lock waits and scheduling delays.
Workflow¶
- Run
cpu utilizationto see which threads are busy - Run
cpu hotspotsto find the most expensive operations on the main thread - If you see scheduling delays, run
cpu contentionto identify lock holders
Tips¶
- Use
--include-frequencyto check if CPU throttling is affecting performance - Hotspots are sorted by total duration β look for unexpected entries
- Contention analysis reveals deadlock-prone patterns