Live CPU profiling with perf top
See in real time which functions and kernel paths are consuming CPU across the whole system.
01Command
$ sudo perf top02What it does
perf top samples CPU instruction pointers several thousand times a second and shows a live, sorted list of the functions receiving the most samples — kernel code in square brackets, user code with its library. It answers 'what is hot right now' instantly, unlike htop which only shows the process level. For a deeper saved analysis, perf record -g command then perf report adds call graphs.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- perf-top(1) - profile a system in realtimeEvidence: perf top live-profiles the whole system or a single process (-p PID) and displays the hottest functions by CPU samples.
- Linux perf Examples — Brendan GreggEvidence: perf top shows live CPU functions; perf record/report for saved profiles; perf_event_paranoid governs unprivileged access.
Last verified: 2026-09-18 · Category: Developer
06Related solutions
lscpu prints the CPU model, socket/core/thread layout, base frequency, and supported instruction flags in a clean summary.
vmstat gives a compact one-line-per-interval view of CPU usage, swap activity, and I/O waits that top doesn't summarize as clearly.