From what I have checked it looks like kernel side of 'perf' subsystem is enabled on computer I work on.
Checking kernel configuration shows the following
$ zgrep "_PERF[_= ]" /proc/config.gz
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_EVENTS=y
# CONFIG_PERF_COUNTERS is not set
CONFIG_HAVE_PERF_EVENTS_NMI=y
I also did the check described in perf_events FAQ:
$ cat /proc/sys/kernel/perf_event_paranoid
1
But the perf
tool is not installed:
$ perf
-bash: perf: command not found
$ /sbin/perf
-bash: /sbin/perf: No such file or directory
$ /usr/sbin/perf
-bash: /usr/sbin/perf: No such file or directory
Is it possible to install perf userland as an ordinary user, to one's own home directory (for '2.6.36-gentoo-r4' kernel)?
Or do I need to ask administrator of machine in question to install it? More unfortunately dev-util/perf
package on Gentoo is masked (blocked) on amd64:
$ emerge --search perf
[...]
* dev-util/perf [ Masked ]
Latest version available: 2.6.35_rc4
Latest version installed: [ Not Installed ]
Size of files: 73,503 kB
Homepage: http://perf.wiki.kernel.org/
Description: Userland tools for Linux Performance Counters
License: GPL-2
Best Answer
How to install
perf
userland tool as non-rootGet/find sources for kernel-2.6.36-gentoo-r4 (in Gentoo Linux). The first check from this answer
was enough, though instead of copying whole kernel sources I just linked them:
Create directory where
perf
would be built, as I won't be able to write in~/build/linux-2.6.36-gentoo-r4
directory.Actually it was not what I did at first... error messages from
make
were entirely unhelpful at first.Go to
tools/perf
directory in kernel sourcesBuild
perf
, not forgetting about passingO=<destdir>
option to makefile as the directory is not writable (there would be no such problem if I copied rather than symlinked kernel sources).Google for "undefined reference to `Perl_push_scope'". Find Fail to install perf on slackware 13.1 on unix.stackexchange.com. Follow the advice in self answer, or to be more excat the diagnosis:
Note that it is workaround rather than a solution (I have
libperl.so
).Check Makefile for default install destination: its
$(HOME)
. Installperf
in one's own home directory:Check that
~/bin
is in PATHCheck that
perf
works correctly (don't forget to cd in writable directory):The output is a bit redacted, replacing my home directory with
~
.