badmad
badmad

Reputation: 2059

Linux perf record not generating any samples

I am trying to profile my userspace program on aria10 fpga board (with 2 ARM Cortex A9 CPUs) which has PMU support. I am running windriver linux version 9.x. I built my kernel with almost all of the CONFIG_ options people suggested over the internet. Also, my pgm is compiled with –fno-omit-frame-pointer and –g options.

What I see is that ‘perf record’ doesn’t generate any samples at all. ‘perf stat true’ output looks to be valid though (not sure what to make out of it). Does anyone have suggestion/ideas why I am not seeing any sample being generated?

~: perf record --call-graph dwarf --  my_app

^C
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.003 MB perf.data ]

~: perf report -g graph --no-children
Error:
The perf.data file has no samples!
 To display the perf.data header info, please use --header/--header-only options.

~: perf stat true

 Performance counter stats for 'true':

      1.095300      task-clock (msec)         #    0.526 CPUs utilized          
             0      context-switches          #    0.000 K/sec                  
             0      cpu-migrations            #    0.000 K/sec                  
            22      page-faults               #    0.020 M/sec                  
       1088056      cycles                    #    0.993 GHz                    
        312708      instructions              #    0.29  insn per cycle         
         29159      branches                  #   26.622 M/sec                  
         16386      branch-misses             #   56.20% of all branches        

   0.002082030 seconds time elapsed

I don't use a VM in this setup. Arria10 is intel FPGA with 2 ARM CPUs that supports PMU.


Edit: 1. I realize now that ARM CPU has HW PMU support (opposite to what I mentioned earlier). Even with HW PMU support, I am not able to do 'perf record' successfully.

Upvotes: 1

Views: 4253

Answers (1)

FelEnd
FelEnd

Reputation: 888

This is an old question, but for people who find this via search:

perf record -e cpu-clock <command>

works for me. The problem seems to be that th default event (cycles) is not available

Upvotes: 6

Related Questions