7

There are some tools in side the kernel,

<kernel source root directory>/tools

perf is one of them.

In ubuntu I think the tools inside this folder is available as package linux-tools

How can I compile it form source and install it and run it?

9

what's wrong with the following?

make -C <kernel source root directory>/tools/perf
4
  • 2
    make 0=/path/to/build/dir -C <kernel source root directory>/tools/perf – limovala Oct 1 '13 at 4:48
  • That builds the tools and allows me to use those but how to build a similar package as official linux-tools deb? – Mikko Rantalainen Sep 11 '18 at 6:53
  • @MikkoRantalainen the build-instructions for all official deb packages are available online – umläute Sep 11 '18 at 11:10
  • 1
    @umläute I mean, is it possible to build linux-tools deb package from vanilla kernel sources without applying extra patches or copying debian directories around similar to using distribution supported make-kpkg command to build vanilla kernel sources? – Mikko Rantalainen Sep 13 '18 at 7:52
1

Nowdays: make -C tools/ perf_install prefix=/usr/

1

I wanted to compile for a different architecture and this seems to work. I had hosttools from buildroot in the output/host/bin directory. Most people will have it there if using buildroot. I had to specify the LD and CC flag. So substitute with appropriate path and is the prefix for toolchain name.

make CC=<buildroot-dir>/output/host/bin/<arch>-gcc LD=<buildroot-dir>/output/host/bin/<arch>-ld -C tools/gpio/

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.