Development
Ian Rogers (Talk | contribs) (Created page with "=Development= == Maintainer Trees == === Kernel === [https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=perf/core tip.git perf/core] === Tool === [https:/...") |
James Clark (Talk | contribs) (→Development) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
=Development= | =Development= | ||
+ | |||
+ | == Installation Guide == | ||
+ | |||
+ | You'll need to install 'perf' in your system. 'perf' uses CPU performance counters( Performance Monitoring Counters or PMCs). | ||
+ | |||
+ | 1) Install Required Packages like ''libelf-dev'' ''libdw-dev'' ''binutils-dev'' | ||
+ | ''libaudit-dev'' by using the following command | ||
+ | sudo apt-get install build-essential libelf-dev libdw-dev binutils-dev | ||
+ | libaudit-dev libtraceevent-dev systemtap-sdt-dev libunwind-dev libslang2-dev libperl-dev libzstd-dev libbabeltrace-ctf-dev flex bison | ||
+ | |||
+ | 2) Download the Source code for perf-tools v6.3 using the following command | ||
+ | git clone https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/ | ||
+ | |||
+ | 3) Install perf. Perf command is available in packages ''linux-tools-common'', ''linux-intel-iotg-tools-common'', etc. Hence, install any of these. | ||
+ | |||
+ | 4) Run 'make' command to build the project | ||
+ | |||
+ | 4.1) It may show an error since the config file is not set and has to be changed. Run the following command. | ||
+ | ''make xconfig'' | ||
+ | |||
+ | 4.2) We will also need to install qt5 for this. | ||
+ | Install it using ''sudo apt-get install qtbase5-dev'' OR ''sudo apt install qt5*'' and set the path using | ||
+ | ''export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig'' | ||
+ | |||
+ | 4.3) Check if qt5 has been installed properly using ''qmake --version'' | ||
+ | |||
+ | 4.4) You might need to set "kernel.perf_event_paranoid = -1" because the "perf record" command may fail due to restricted access to performance monitoring features on your system. | ||
+ | |||
+ | ''sudo sysctl -w kernel.perf_event_paranoid=-1'' | ||
+ | |||
+ | Note: this should not be done in production environment | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | 4.4) Now, Finally run ''make xconfig'' and it will work properly. | ||
+ | |||
+ | 5) Go to the root directory of the kernel and run ''perf test''. You will see tests | ||
+ | passing, skipping, or failing. | ||
== Maintainer Trees == | == Maintainer Trees == | ||
Line 21: | Line 60: | ||
[https://mirrors.edge.kernel.org/pub/linux/kernel/tools/perf/ mirror] | [https://mirrors.edge.kernel.org/pub/linux/kernel/tools/perf/ mirror] | ||
+ | |||
+ | == Cross Compilation == | ||
+ | |||
+ | [[Arm64 cross-compilation Dockerfile|Arm64 cross-compilation Dockerfile]] for an example of how to cross-compile for Arm on x86 |
Latest revision as of 13:56, 13 June 2024
Contents |
[edit] Development
[edit] Installation Guide
You'll need to install 'perf' in your system. 'perf' uses CPU performance counters( Performance Monitoring Counters or PMCs).
1) Install Required Packages like libelf-dev libdw-dev binutils-dev libaudit-dev by using the following command
sudo apt-get install build-essential libelf-dev libdw-dev binutils-dev libaudit-dev libtraceevent-dev systemtap-sdt-dev libunwind-dev libslang2-dev libperl-dev libzstd-dev libbabeltrace-ctf-dev flex bison
2) Download the Source code for perf-tools v6.3 using the following command
git clone https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/
3) Install perf. Perf command is available in packages linux-tools-common, linux-intel-iotg-tools-common, etc. Hence, install any of these.
4) Run 'make' command to build the project
4.1) It may show an error since the config file is not set and has to be changed. Run the following command.
make xconfig
4.2) We will also need to install qt5 for this. Install it using sudo apt-get install qtbase5-dev OR sudo apt install qt5* and set the path using
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig
4.3) Check if qt5 has been installed properly using qmake --version
4.4) You might need to set "kernel.perf_event_paranoid = -1" because the "perf record" command may fail due to restricted access to performance monitoring features on your system.
sudo sysctl -w kernel.perf_event_paranoid=-1
Note: this should not be done in production environment
4.4) Now, Finally run make xconfig and it will work properly.
5) Go to the root directory of the kernel and run perf test. You will see tests passing, skipping, or failing.
[edit] Maintainer Trees
[edit] Kernel
[edit] Tool
perf-tools for the current release. Merged to linux-next.
perf-tools-next staging for the next release.
[edit] Design
[edit] Latest source tar balls
[edit] Cross Compilation
Arm64 cross-compilation Dockerfile for an example of how to cross-compile for Arm on x86