0

The only source code related to perf I could find is in the kernel source, so am not sure what I need to do to get the latest perf.

If I upgrade the kernel version (leavin the rest of my distro unchanged), will I now get the latest version of perf or is there a user space library that I also need to rebuild?

Edit - I see that the perf source is not actually in the kernel source but in a separate tools directory and I can just build this directory.

MK.
  • 3,907
  • 5
  • 34
  • 46
  • What is your current perf version (your kernel version)? What version of perf do you want and why? – osgx Mar 03 '14 at 00:25

1 Answers1

0

In deb based distribution perf is usually provided by a package with a name starting with linux-tools and yes, the version X of perf it's not designed to run on the kernel number Y, it's a program that is strictly tied to the kernel.

For example on Debian/Ubuntu you can write

sudo apt-get install linux-tools-$(uname -r)
user2485710
  • 9,451
  • 13
  • 58
  • 102
  • How strictly is perf tied to the kernel? I have successful runs of more recent `perf` on older linux kernels, and some new features of perf worked. – osgx Mar 03 '14 at 00:26
  • @osgx maybe with closely related releases like a 3.06 or a 3.07 it will probably work, but with 2.6 and 3.x it's probably gonna fail, anyway it's not advisable to use `perf` like that. – user2485710 Mar 03 '14 at 00:28
  • There are some version fields (like `__u32 version` and ` __u32 compat_version` in `perf_event_mmap_page `) described in the [manpage of `perf_event_open()`](http://web.eece.maine.edu/~vweaver/projects/perf_events/perf_event_open.html). I think, this was designed to allow newer versions of perf to parse output from older kernel or older perf - from newer kernels. – osgx Mar 03 '14 at 00:33
  • `sudo apt-get install linux-tools-$(uname -r) Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package linux-tools-5.10.0-14-amd64 E: Couldn't find any package by glob 'linux-tools-5.10.0-14-amd64' E: Couldn't find any package by regex 'linux-tools-5.10.0-14-amd64'` Not really working on my machine. – BitTickler May 12 '22 at 13:25