Questions tagged [perf]

perf is Linux profiling tool for both Linux kernel and underlying hardware (hardware counters).

81 questions
14
votes
2 answers

How to make linux 'perf record' work for libc and libstdc++ symbols?

I'm using perf record -g on x86-64 Linux to profile a program. Several symbols in libc or libstdc++ have 0 as a parent: __GI___strcmp_ssse3 (libc) and strcmp@plt (libstdc++) for example. (I can actually break on these symbols in the debugger and…
12
votes
1 answer

Security implications of changing “perf_event_paranoid”

I'd like to use the perf utility to gather measurements for my program. It runs on a shared cluster machine with Debian 9 where by default the /proc/sys/kernel/perf_event_paranoid is set to 3, therefore disallowing me to gather measurements. Before…
Martin Ueding
  • 2,682
  • 3
  • 31
  • 45
10
votes
3 answers

perf interrupt took too long but perf not being installed

I just now checked my dmesg because my server starts to crash now and then. There I read the following line: perf interrupt took too long (2528 > 2500), lowering kernel.perf_event_max_sample_rate to 50000 which appears a couple of times. I…
Martin B.
  • 235
  • 1
  • 2
  • 10
8
votes
1 answer

How to run linux perf without root

I want to benchmark an application of mine. Up to now I used gnu time, but perf yields much better stats. As a matter of principle I would like to go the route of a decicated perf user instead of allowing all users some security-related things, not…
Eike
  • 191
  • 1
  • 4
7
votes
3 answers

How do I generate the /sys/kernel/debug/tracing folder in kernel with yocto project?

I was tying to use perf on Renesas target and I configured the yocto "local.conf" as showed in this link. #avoid stripping binaries INHIBIT_PACKAGE_STRIP = "1" #add the debug information EXTRA_IMAGE_FEATURES= "debug-tweaks tools-debug dbg-pkgs…
gemad
  • 83
  • 1
  • 5
6
votes
1 answer

How long time does a context switch take in Linux (ubuntu 18.04)

I'm interessted in getting the number of context switches a two processes in a KVM vm takes on a singel CPU over some time. Earlier i have used perf, is this best practice? And how much time is used on a context switch per CPU?
emilrn
  • 103
  • 2
  • 9
6
votes
0 answers

perf cycles not supported

I am trying to use perf for profiling in a Linux virtual machine. However, I am receiving the following output: [vagrant@localhost ~]$ perf stat -d ls / bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv …
r.v
  • 347
  • 3
  • 11
5
votes
2 answers

Building .deb package for Linux perf?

There is a convenient Linux kernel makefile target "make deb-pkg" to build kernel, modules, headers as .deb. Then I can install/remove via dpkg command. However, for perf compilation, there is only build source package option. I wonder if there is…
Patrick
  • 259
  • 1
  • 5
5
votes
1 answer

perf fails to work on really large process

I use perf quite often to profile my applications. Recently I got a few new machine with ~750G RAM each. I am trying to profile a process that uses about 400G of ram on one of them. This works fine on all the new machines but one. They were all…
Shlomi
  • 151
  • 1
  • 4
5
votes
0 answers

How to interpret perf -e cache-misses:pp?

I find the behavior of perf top -e cache-misses:pp -p quite confusing. I own an Intel i5-3230M, running kernel 4.4.5 64 bit. If I just run that commmand, I get basically no samples from my application (a numerical simulation with large…
Lorenzo Pistone
  • 708
  • 1
  • 8
  • 20
5
votes
1 answer

Understanding Linux Perf sched-switch and context-switches

I've been trying to enable context switch events on perf and use perf script's dump from perf.data to investigate thread blocked time. So far the only two recording options that seem to be helpful are context switch and all the sched events. Here's…
user6256
  • 53
  • 1
  • 3
4
votes
2 answers

What stream does perf use?

What stream does the perf command use!? I've been trying to capture it with (perf stat -x, -ecache-misses ./a.out>/dev/null) 2> results following https://stackoverflow.com/q/13232889/50305, but to no avail. Why can I not capture the input... it's…
Dervin Thunk
  • 3,429
  • 4
  • 23
  • 21
4
votes
0 answers

Does `perf trace -p ` trace all threads?

strace -f -p traces system calls in all threads of a multi-threaded process. (This also follows forks, there is an option -b execve that tries to address that). Does perf trace -p trace all threads of the process? It looks like it…
sourcejedi
  • 48,311
  • 17
  • 143
  • 296
4
votes
1 answer

How to resolve problem in perf tool?

perf stat -d ./sample.out Output is: Performance counter stats for './sample.out': 0.586266 task-clock (msec) # 0.007 CPUs utilized 2 context-switches # 0.003 M/sec …
ANTHONY
  • 63
  • 2
  • 4
4
votes
1 answer

Getting correct perf version

I'm trying to run perf on my Ubuntu Precise box, which I recently upgraded to kernel 3.11.10-03111002 (manual install). The problem is that perf and kernel versions must match, and the requested version is not available in the repositories…
iomartin
  • 163
  • 5
1
2 3 4 5 6