Questo contenuto non è disponibile nella lingua selezionata.
Chapter 10. Getting started with perf
As a system administrator, you can use the perf tool to collect and analyze performance data of your system. The perf user-space tool interfaces with the kernel-based subsystem Performance Counters for Linux (PCL).
perf uses the Performance Monitoring Unit (PMU) to measure, record, and monitor a variety of hardware and software events. perf also supports tracepoints, kprobes, and uprobes.
10.1. Installing perf Copia collegamentoCollegamento copiato negli appunti!
You must install the perf user-space tool to start using the perf tool.
Procedure
Install the perf tool:
# dnf install perf
10.2. Common perf commands Copia collegamentoCollegamento copiato negli appunti!
You can use the following commonly used perf commands to collect and analyze performance data.
- perf stat
- Provides overall statistics for common performance events, including instructions run and clock cycles used. Options allow for selection of events other than the default measurement events.
- perf record
-
Records performance data into a file,
perf.data, which can be later analyzed by using theperf reportcommand. - perf report
-
Reads and displays the performance data from the
perf.datafile created by theperf recordcommand. - perf list
- Lists the events available on a particular machine. These events vary based on performance monitoring hardware and software configuration of the system.
- perf top
- Performs a similar function to the top utility. It generates and displays a performance counter profile in real time.
- perf trace
-
Performs a similar function to the
stracetool. It monitors the system calls used by a specified thread or process and all signals received by that application. - perf help
-
Displays a complete list of the
perfcommands.