Installing Linux performance monitoring tools on Jetson TX2

How do I install perf monitoring tool on Jeston TX2?
It’s a Linux kernel tool, I tried installing linux-tools-4.4.15-tegra but the package isn’t available.

Hi ramuk_nitaj,

Which JetPack version are you installing on tx2?
Please share your steps and error log.
Thanks!

I’ve run into this as well with JetPack 3.2 on a TX2.

nvidia@tegra-ubuntu:~$ perf
WARNING: perf not found for kernel 4.4.38

  You may need to install the following packages for this specific kernel:
    linux-tools-4.4.38-tegra
    linux-cloud-tools-4.4.38-tegra

  You may also want to install one of the following packages to keep up to date:
    linux-tools-tegra
    linux-cloud-tools-tegra
nvidia@tegra-ubuntu:~$ sudo apt install linux-tools-4.4.38-tegra
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-tools-4.4.38-tegra
E: Couldn't find any package by glob 'linux-tools-4.4.38-tegra'
E: Couldn't find any package by regex 'linux-tools-4.4.38-tegra'

You can build perf for your kernel, if it has PERF support. You may check with:

gunzip -c /proc/config.gz | grep PERF

For building perf:
Not mandatory, but suggested:

sudo apt-get install libperl-dev
cd /usr/src/linux-headers-4.4.38-tegra/tools/perf
sudo make
./perf --version

Thanks, that worked.

hi this solution didnt work for me

perf --version
perf version 4.4.38-tegra
nvidia@tegra-ubuntu:/usr/src/linux-headers-4.4.38-tegra/tools/perf$ sudo apt-get install libperl-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
libperl-dev is already the newest version (5.22.1-9ubuntu0.6).
The following packages were automatically installed and are no longer required:
extra-xdg-menus libcppunit-1.13-0v5 libcppunit-dev libgsl-dev
libjna-java libjna-jni libqmi-glib1 librxtx-java
snapd-login-service
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.
nvidia@tegra-ubuntu:/usr/src/linux-headers-4.4.38-tegra/tools/perf$ cd /usr/src/linux-headers-4.4.38-tegra/tools/perf
nvidia@tegra-ubuntu:/usr/src/linux-headers-4.4.38-tegra/tools/perf$ sudo make
BUILD: Doing ‘make -j6’ parallel build
config/Makefile:251: No libelf found, disables ‘probe’ tool and BPF support in ‘perf record’, please install elfutils-libelf-devel/libelf-dev
config/Makefile:350: Disabling post unwind, no support found.
config/Makefile:391: No libaudit.h found, disables ‘trace’ tool, please install audit-libs-devel or libaudit-dev
config/Makefile:651: Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc
GEN perf-archive
GEN perf-with-kcore
CC perf.o
LD perf-in.o
LINK perf
nvidia@tegra-ubuntu:/usr/src/linux-headers-4.4.38-tegra/tools/perf$ ./perf --version
perf version 4.4.38-tegra

nvidia@tegra-ubuntu:/usr/src/linux-headers-4.4.38-tegra/tools/perf$ sudo apt install linux-tools-4.4.38-tegra
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package linux-tools-4.4.38-tegra
E: Couldn’t find any package by glob ‘linux-tools-4.4.38-tegra’
E: Couldn’t find any package by regex ‘linux-tools-4.4.38-tegra’