How To Install perf on CentOS 8

perf is Performance monitoring for the Linux kernel

Introduction

In this tutorial we learn how to install perf on CentOS 8.

What is perf

This package contains the perf tool, which enables performance monitoring of the Linux kernel.

We can use yum or dnf to install perf on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install perf.

Install perf on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install perf using dnf by running the following command:

sudo dnf -y install perf

Install perf on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install perf using yum by running the following command:

sudo yum -y install perf

How To Uninstall perf on CentOS 8

To uninstall only the perf package we can use the following command:

sudo dnf remove perf

perf Package Contents on CentOS 8

/etc/bash_completion.d/perf
/usr/bin/perf
/usr/lib64/libperf-jvmti.so
/usr/lib64/traceevent/plugins
/usr/lib64/traceevent/plugins/plugin_cfg80211.so
/usr/lib64/traceevent/plugins/plugin_function.so
/usr/lib64/traceevent/plugins/plugin_futex.so
/usr/lib64/traceevent/plugins/plugin_hrtimer.so
/usr/lib64/traceevent/plugins/plugin_jbd2.so
/usr/lib64/traceevent/plugins/plugin_kmem.so
/usr/lib64/traceevent/plugins/plugin_kvm.so
/usr/lib64/traceevent/plugins/plugin_mac80211.so
/usr/lib64/traceevent/plugins/plugin_sched_switch.so
/usr/lib64/traceevent/plugins/plugin_scsi.so
/usr/lib64/traceevent/plugins/plugin_tlb.so
/usr/lib64/traceevent/plugins/plugin_xen.so
/usr/libexec/perf-core
/usr/libexec/perf-core/perf-archive
/usr/libexec/perf-core/perf-with-kcore
/usr/libexec/perf-core/scripts
/usr/libexec/perf-core/scripts/perl
/usr/libexec/perf-core/scripts/perl/Perf-Trace-Util
/usr/libexec/perf-core/scripts/perl/Perf-Trace-Util/lib
/usr/libexec/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf
/usr/libexec/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace
/usr/libexec/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Context.pm
/usr/libexec/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Core.pm
/usr/libexec/perf-core/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Util.pm
/usr/libexec/perf-core/scripts/perl/bin
/usr/libexec/perf-core/scripts/perl/bin/check-perf-trace-record
/usr/libexec/perf-core/scripts/perl/bin/failed-syscalls-record
/usr/libexec/perf-core/scripts/perl/bin/failed-syscalls-report
/usr/libexec/perf-core/scripts/perl/bin/rw-by-file-record
/usr/libexec/perf-core/scripts/perl/bin/rw-by-file-report
/usr/libexec/perf-core/scripts/perl/bin/rw-by-pid-record
/usr/libexec/perf-core/scripts/perl/bin/rw-by-pid-report
/usr/libexec/perf-core/scripts/perl/bin/rwtop-record
/usr/libexec/perf-core/scripts/perl/bin/rwtop-report
/usr/libexec/perf-core/scripts/perl/bin/wakeup-latency-record
/usr/libexec/perf-core/scripts/perl/bin/wakeup-latency-report
/usr/libexec/perf-core/scripts/perl/check-perf-trace.pl
/usr/libexec/perf-core/scripts/perl/failed-syscalls.pl
/usr/libexec/perf-core/scripts/perl/rw-by-file.pl
/usr/libexec/perf-core/scripts/perl/rw-by-pid.pl
/usr/libexec/perf-core/scripts/perl/rwtop.pl
/usr/libexec/perf-core/scripts/perl/wakeup-latency.pl
/usr/libexec/perf-core/scripts/python
/usr/libexec/perf-core/scripts/python/Perf-Trace-Util
/usr/libexec/perf-core/scripts/python/Perf-Trace-Util/lib
/usr/libexec/perf-core/scripts/python/Perf-Trace-Util/lib/Perf
/usr/libexec/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace
/usr/libexec/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
/usr/libexec/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
/usr/libexec/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
/usr/libexec/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
/usr/libexec/perf-core/scripts/python/bin
/usr/libexec/perf-core/scripts/python/bin/compaction-times-record
/usr/libexec/perf-core/scripts/python/bin/compaction-times-report
/usr/libexec/perf-core/scripts/python/bin/event_analyzing_sample-record
/usr/libexec/perf-core/scripts/python/bin/event_analyzing_sample-report
/usr/libexec/perf-core/scripts/python/bin/export-to-postgresql-record
/usr/libexec/perf-core/scripts/python/bin/export-to-postgresql-report
/usr/libexec/perf-core/scripts/python/bin/export-to-sqlite-record
/usr/libexec/perf-core/scripts/python/bin/export-to-sqlite-report
/usr/libexec/perf-core/scripts/python/bin/failed-syscalls-by-pid-record
/usr/libexec/perf-core/scripts/python/bin/failed-syscalls-by-pid-report
/usr/libexec/perf-core/scripts/python/bin/flamegraph-record
/usr/libexec/perf-core/scripts/python/bin/flamegraph-report
/usr/libexec/perf-core/scripts/python/bin/futex-contention-record
/usr/libexec/perf-core/scripts/python/bin/futex-contention-report
/usr/libexec/perf-core/scripts/python/bin/intel-pt-events-record
/usr/libexec/perf-core/scripts/python/bin/intel-pt-events-report
/usr/libexec/perf-core/scripts/python/bin/mem-phys-addr-record
/usr/libexec/perf-core/scripts/python/bin/mem-phys-addr-report
/usr/libexec/perf-core/scripts/python/bin/net_dropmonitor-record
/usr/libexec/perf-core/scripts/python/bin/net_dropmonitor-report
/usr/libexec/perf-core/scripts/python/bin/netdev-times-record
/usr/libexec/perf-core/scripts/python/bin/netdev-times-report
/usr/libexec/perf-core/scripts/python/bin/powerpc-hcalls-record
/usr/libexec/perf-core/scripts/python/bin/powerpc-hcalls-report
/usr/libexec/perf-core/scripts/python/bin/sched-migration-record
/usr/libexec/perf-core/scripts/python/bin/sched-migration-report
/usr/libexec/perf-core/scripts/python/bin/sctop-record
/usr/libexec/perf-core/scripts/python/bin/sctop-report
/usr/libexec/perf-core/scripts/python/bin/stackcollapse-record
/usr/libexec/perf-core/scripts/python/bin/stackcollapse-report
/usr/libexec/perf-core/scripts/python/bin/syscall-counts-by-pid-record
/usr/libexec/perf-core/scripts/python/bin/syscall-counts-by-pid-report
/usr/libexec/perf-core/scripts/python/bin/syscall-counts-record
/usr/libexec/perf-core/scripts/python/bin/syscall-counts-report
/usr/libexec/perf-core/scripts/python/check-perf-trace.py
/usr/libexec/perf-core/scripts/python/compaction-times.py
/usr/libexec/perf-core/scripts/python/event_analyzing_sample.py
/usr/libexec/perf-core/scripts/python/export-to-postgresql.py
/usr/libexec/perf-core/scripts/python/export-to-sqlite.py
/usr/libexec/perf-core/scripts/python/exported-sql-viewer.py
/usr/libexec/perf-core/scripts/python/failed-syscalls-by-pid.py
/usr/libexec/perf-core/scripts/python/flamegraph.py
/usr/libexec/perf-core/scripts/python/futex-contention.py
/usr/libexec/perf-core/scripts/python/intel-pt-events.py
/usr/libexec/perf-core/scripts/python/mem-phys-addr.py
/usr/libexec/perf-core/scripts/python/net_dropmonitor.py
/usr/libexec/perf-core/scripts/python/netdev-times.py
/usr/libexec/perf-core/scripts/python/powerpc-hcalls.py
/usr/libexec/perf-core/scripts/python/sched-migration.py
/usr/libexec/perf-core/scripts/python/sctop.py
/usr/libexec/perf-core/scripts/python/stackcollapse.py
/usr/libexec/perf-core/scripts/python/stat-cpi.py
/usr/libexec/perf-core/scripts/python/syscall-counts-by-pid.py
/usr/libexec/perf-core/scripts/python/syscall-counts.py
/usr/libexec/perf-core/tests
/usr/libexec/perf-core/tests/attr
/usr/libexec/perf-core/tests/attr.py
/usr/libexec/perf-core/tests/attr/README
/usr/libexec/perf-core/tests/attr/base-record
/usr/libexec/perf-core/tests/attr/base-stat
/usr/libexec/perf-core/tests/attr/system-wide-dummy
/usr/libexec/perf-core/tests/attr/test-record-C0
/usr/libexec/perf-core/tests/attr/test-record-basic
/usr/libexec/perf-core/tests/attr/test-record-branch-any
/usr/libexec/perf-core/tests/attr/test-record-branch-filter-any
/usr/libexec/perf-core/tests/attr/test-record-branch-filter-any_call
/usr/libexec/perf-core/tests/attr/test-record-branch-filter-any_ret
/usr/libexec/perf-core/tests/attr/test-record-branch-filter-hv
/usr/libexec/perf-core/tests/attr/test-record-branch-filter-ind_call
/usr/libexec/perf-core/tests/attr/test-record-branch-filter-k
/usr/libexec/perf-core/tests/attr/test-record-branch-filter-u
/usr/libexec/perf-core/tests/attr/test-record-count
/usr/libexec/perf-core/tests/attr/test-record-data
/usr/libexec/perf-core/tests/attr/test-record-freq
/usr/libexec/perf-core/tests/attr/test-record-graph-default
/usr/libexec/perf-core/tests/attr/test-record-graph-dwarf
/usr/libexec/perf-core/tests/attr/test-record-graph-fp
/usr/libexec/perf-core/tests/attr/test-record-group
/usr/libexec/perf-core/tests/attr/test-record-group-sampling
/usr/libexec/perf-core/tests/attr/test-record-group1
/usr/libexec/perf-core/tests/attr/test-record-group2
/usr/libexec/perf-core/tests/attr/test-record-no-buffering
/usr/libexec/perf-core/tests/attr/test-record-no-inherit
/usr/libexec/perf-core/tests/attr/test-record-no-samples
/usr/libexec/perf-core/tests/attr/test-record-period
/usr/libexec/perf-core/tests/attr/test-record-pfm-period
/usr/libexec/perf-core/tests/attr/test-record-raw
/usr/libexec/perf-core/tests/attr/test-stat-C0
/usr/libexec/perf-core/tests/attr/test-stat-basic
/usr/libexec/perf-core/tests/attr/test-stat-default
/usr/libexec/perf-core/tests/attr/test-stat-detailed-1
/usr/libexec/perf-core/tests/attr/test-stat-detailed-2
/usr/libexec/perf-core/tests/attr/test-stat-detailed-3
/usr/libexec/perf-core/tests/attr/test-stat-group
/usr/libexec/perf-core/tests/attr/test-stat-group1
/usr/libexec/perf-core/tests/attr/test-stat-no-inherit
/usr/libexec/perf-core/tests/pe-file.exe
/usr/libexec/perf-core/tests/pe-file.exe.debug
/usr/libexec/perf-core/tests/shell
/usr/libexec/perf-core/tests/shell/buildid.sh
/usr/libexec/perf-core/tests/shell/lib
/usr/libexec/perf-core/tests/shell/lib/probe.sh
/usr/libexec/perf-core/tests/shell/lib/probe_vfs_getname.sh
/usr/libexec/perf-core/tests/shell/probe_vfs_getname.sh
/usr/libexec/perf-core/tests/shell/record+probe_libc_inet_pton.sh
/usr/libexec/perf-core/tests/shell/record+script_probe_vfs_getname.sh
/usr/libexec/perf-core/tests/shell/record+zstd_comp_decomp.sh
/usr/libexec/perf-core/tests/shell/test_arm_coresight.sh
/usr/libexec/perf-core/tests/shell/trace+probe_vfs_getname.sh
/usr/share/doc/perf
/usr/share/doc/perf-tip/tips.txt
/usr/share/doc/perf/examples.txt
/usr/share/man/man1/perf-annotate.1.gz
/usr/share/man/man1/perf-archive.1.gz
/usr/share/man/man1/perf-bench.1.gz
/usr/share/man/man1/perf-buildid-cache.1.gz
/usr/share/man/man1/perf-buildid-list.1.gz
/usr/share/man/man1/perf-c2c.1.gz
/usr/share/man/man1/perf-config.1.gz
/usr/share/man/man1/perf-data.1.gz
/usr/share/man/man1/perf-diff.1.gz
/usr/share/man/man1/perf-evlist.1.gz
/usr/share/man/man1/perf-ftrace.1.gz
/usr/share/man/man1/perf-help.1.gz
/usr/share/man/man1/perf-inject.1.gz
/usr/share/man/man1/perf-intel-pt.1.gz
/usr/share/man/man1/perf-kallsyms.1.gz
/usr/share/man/man1/perf-kmem.1.gz
/usr/share/man/man1/perf-kvm.1.gz
/usr/share/man/man1/perf-list.1.gz
/usr/share/man/man1/perf-lock.1.gz
/usr/share/man/man1/perf-mem.1.gz
/usr/share/man/man1/perf-probe.1.gz
/usr/share/man/man1/perf-record.1.gz
/usr/share/man/man1/perf-report.1.gz
/usr/share/man/man1/perf-sched.1.gz
/usr/share/man/man1/perf-script-perl.1.gz
/usr/share/man/man1/perf-script-python.1.gz
/usr/share/man/man1/perf-script.1.gz
/usr/share/man/man1/perf-stat.1.gz
/usr/share/man/man1/perf-test.1.gz
/usr/share/man/man1/perf-timechart.1.gz
/usr/share/man/man1/perf-top.1.gz
/usr/share/man/man1/perf-trace.1.gz
/usr/share/man/man1/perf-version.1.gz
/usr/share/man/man1/perf.1.gz
/usr/share/perf-core/strace
/usr/share/perf-core/strace/groups
/usr/share/perf-core/strace/groups/file
/usr/share/perf-core/strace/groups/string

References

Summary

In this tutorial we learn how to install perf on CentOS 8 using yum and dnf.