perf

Performance measurement and analysis is an enormous topic; the identification, analysis, and determination of the root cause for performance issues is no trivial task. In recent years, the perf(1) and htop(1) utility has emerged as the fundamental tool for performance measurement and analysis on the Linux platform.

Sometimes, all you need is to see what is consuming the most CPU; traditionally, we use the well-known top(1) utility to do so. Try, instead, the very useful perf variant, like so: sudo perf top.

Also, you can exploit some of the features with the following:

sudo perf top -r 90 --sort pid,comm,dso,symbol (-r 90 => collect data with SCHED_FIFO RT scheduling class and priority 90 [1-99]).

Essentially, this is the perf workflow: ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.