一、linux内核源码安装
如果你的内核是通过源码安装
的,则在内核源码的tools
下会有perf
工具。安装如下:
cd linux-xxx-xxxx-xxx //你的内核源码目录
sudo make -C tools/ perf_install prefix=/usr
等待编译安装完即可。
另外,tools目录下还有以下工具:
$ make -C tools/
make: Entering directory '/home/xxx/xenomai/linux-xxx-lts-5.10-dovetail-xenomai/tools'
Possible targets:
acpi - ACPI tools
bpf - misc BPF tools
cgroup - cgroup tools
cpupower - a tool for all things x86 CPU power
debugging - tools for debugging
firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer
firmware - Firmware tools
freefall - laptop accelerometer program for disk protection
gpio - GPIO tools
hv - tools used when in Hyper-V clients
iio - IIO tools
xxx-speed-select - xxx Speed Select tool
kvm_stat - top-like utility for displaying kvm statistics
leds - LEDs tools
liblockdep - user-space wrapper for kernel locking-validator
objtool - an ELF object analysis tool
pci - PCI tools
perf - Linux performance measurement and analysis tool
rpmb - Replay protected memory block access tool
selftests - various kernel selftests
bootconfig - boot config tool
spi - spi tools
tmon - thermal monitoring and tuning tool
turbostat - xxx CPU idle stats and freq reporting tool
usb - USB testing tools
virtio - vhost test module
vm - misc vm tools
wmi - WMI interface examples
x86_energy_perf_policy - xxx energy policy tool
You can do:
$ make -C tools/ <tool>_install
from the kernel command line to build and install one of
the tools above
$ make tools/all
builds all tools.
$ make tools/install
installs all tools.
Cleaning targets:
all of the above with the "_clean" string appended cleans
the respective build directory.
clean: a summary clean target to clean _all_ folders
二、apt安装
这个网上有教程,可以去搜索