Questions tagged [perf]

Perf is a profiler tool for Linux 2.6+ based systems.

Perf is a profiling tool for Linux 2.6+ based systems that uses the perf_events kernel interface to provide a command-line interface to underlying hardware, software and kernel performance counters. It abstracts away differences in performance counters implemented across different CPU architectures, allowing consistency across different hardware.

See also the perf wiki.

1032 questions
0
votes
1 answer

how do perf record store assembly code

I try to modify perf record to handle assembly code of target process/program. Therefore, I want to know where data structure does perf use to store assembly code and count position of target process/program? Generally, perf record will write a…
user6337351
0
votes
1 answer

use 'perf trace command' to a special thread with TSX abort

I try to use 'perf trace' command to trace tsx abort in a special thread. But I get errors with arguments. All command I think may be right and tried is below. perf trace --pid 24265 --event tx-abort perf trace --pid 24265 --event…
user6337351
0
votes
1 answer

linux perf report inconsistent behavior

I have an application I'm profiling using perf and I find the results when using perf report are not consistent, and I can't discern the pattern. I start the application and profile it by pid for 60 seconds: perf record -p -o sleep…
John S
  • 3,035
  • 2
  • 18
  • 29
0
votes
1 answer

How do I pass a loop to the command perf?

The following commands are valid. perf stat -I 500 -e cycles sleep 5 while true; do : ; done However, this command results in a syntax error. perf stat -I 500 -e cycles while true; do : ; done bash: syntax error near unexpected token `do' I tried…
merlin2011
  • 71,677
  • 44
  • 195
  • 329
0
votes
1 answer

Is it possible to measure the cycles consumed by a single process on a per-core basis?

I recently saw this comment, which asks whether it is possible to measure per-core CPU load for a process, but there has been no reply to it, so I am asking it as a question. Is there a mechanism for measuring the cycles used by a single process on…
merlin2011
  • 71,677
  • 44
  • 195
  • 329
0
votes
1 answer

Analyzing execution times with perf script

I'm trying to measure exact execution time/cycles for specific functions with oerf tool. I added events for entering and returning from each function by using perf probe. I can see the functions with perf script like so: perf script --header -F…
Tgilgul
  • 1,614
  • 1
  • 20
  • 35
0
votes
1 answer

Time Based Profiling with perf record

Would you inform me how can I get the value of event counters at each sample when using perf record? For example: perf record -F 100 -e instructions ./program With perf report, I only see overhead. But I want to know if there are ways to view the…
user3527764
  • 95
  • 11
0
votes
1 answer

How to know max event period of perf-record

does anyone know how to get the maximum event period value (or the value that kernel actually passes to PMU) of Perf event? I'm using perf to measure my program as follow: perf record -d -e cpu/event=0xd0,umask=0x81/ppu,cpu/event=0xd0,umask=0x82/ppu…
Kaniel Venson
  • 181
  • 2
  • 12
0
votes
0 answers

Compiling perf using buildroot

Buildroot fails, when building perf with the following error: >>> perf custom Building Your kernel version is too old and does not have the perf tool. At least kernel 2.6.31 must be used. package/pkg-generic.mk:184: recipe for target recipe for…
john s.
  • 476
  • 9
  • 21
0
votes
1 answer

perf: strange relation between software events

Okay, so this really bugs me. I'm using perf to record the cpu-clock event (a software event): $ > perf record -e cpu-clock srun -n 1 ./stream ... and the table produced by perf report is empty. I'm using perf to record all available software…
0
votes
2 answers

Recompile Linux Kernel not to use specific CPU register

I'm doing an experiment that write the index of loop into a CPU register R11, then building it with gcc -ffixed-r11 try to let compiler know do not use that reg, and finally using perf to measure it. But when I check the report (using perf script),…
Alex Will
  • 35
  • 5
0
votes
1 answer

perf tool output, magic values

I ran perf with the parameter -x to print in machine readable format. The output is as…
kimsay
  • 311
  • 3
  • 15
0
votes
1 answer

identify perf's PID using top/ps

I need to kill perf in a bash script using its PID. However, unable to identify perf's PID (using top). Any pointers appreciated. Ubuntu XX 16.04.2. Thanks.
iyogee
  • 3
  • 3
0
votes
1 answer

Off-CPU flame graphs with perf: what should the types of the output fields be?

I've been following these instructions for generating an off-CPU flame graph for my code. However, when I get to this step: perf script -f comm,pid,tid,cpu,time,period,event,ip,sym,dso,trace I get the following error: Invalid field requested. …
Koz Ross
  • 3,040
  • 2
  • 24
  • 44
0
votes
1 answer

Why does perf show that sleep takes all cores?

I am trying to familiarize myself with perf and run it against various programs I wrote. When I launch it against program that is 100% single threaded, perf shows that it takes two cores on machine (task-clock event). Here's the example output: perf…
mdrndv
  • 155
  • 1
  • 1
  • 6