6

I'd like to use the perf tool on my 2016-02-09 Raspbian Jessie operating system. For that, I have installed the linux-tools package (which contains perf). The kernel version in use on that image is 4.1.17+.

The Linux kernel and it's tools need to have the same version:

root@raspberrypi:/home/pi# perf
/usr/bin/perf: line 24: exec: perf_4.1: not found
E: linux-tools-4.1 is not installed.

Unfortunately there is no 4.1 version for the linux-tools:

root@raspberrypi:/home/pi# aptitude search linux-tools
i   linux-tools                     - Performance analysis tools for Linux (meta
p   linux-tools-3.10                - Performance analysis tools for Linux 3.10 
p   linux-tools-3.12                - Performance analysis tools for Linux 3.12 
i A linux-tools-3.16                - Performance analysis tools for Linux 3.16 
p   linux-tools-3.18                - Performance analysis tools for Linux 3.18 
p   linux-tools-3.6                 - Performance analysis tools for Linux 3.6

Does anyone know how this is supposed to work?

  • See this thread: raspberrypi.org/forums/viewtopic.php?f=29&t=117547 It looks that there's no package for the new kernel yet, but in the thread you can find a link for the perf utility built by one of the users. – nsilent22 Feb 28 '16 at 18:48
  • Dropbox link is now dead, and any guides I can find online don't seem to work for actually compiling perf. – onaclov2000 Nov 15 '17 at 9:31
2

I was able to install the perf package using sudo apt-get install linux-perf-4.9. Use uname-r to find your kernel version, and apt-cache search linux-tools to find the proper package name.

  • 1
    That's cool, but there is no perf package built for the current kernel. – Matthias Urlichs Nov 15 '18 at 19:45
  • @MatthiasUrlichs: maybe try to update it to the latest kernel via sudo rpi-update. – jojek Feb 26 at 16:55
1

I couldn't find good answer, this works for me and now

#sudo nano /usr/bin/perf

then change

#exec "perf_$version" "$@"
exec "perf_4.9" "$@"
  • 1
    There is a reason why perf enforces the version check, so one must understand the implications of faking the version number. For one, don't forget to mention this when asking about such problems as nobody will be able to reproduce them otherwise. – Dmitry Grigoryev Sep 26 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.