user2301277
user2301277

Reputation: 61

Linux perf stat tool returns zero instructions count. What am I missing here?

I am trying to get some basic performance data on my new Galaxy S4 phone. I've already compiled a custom kernel and managed to flash it onto the device using Odin. These are the kernel modules related to perf tool that I have enabled:

CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_USE_VMALLOC=y
CONFIG_PERF_EVENTS=y
CONFIG_PERF_COUNTERS=y

I've also cross-compiled the perf tool. The problem is that when I run the following command:

perf stat ls 

The output does not seem to be quite right:

Performance counter stats for 'ls':
10887392 cycles    # 0.000 Ghz
       0 instructions # 0.00 insns per cycle
0.012448321 seconds time elapsed

I've set the cpu policies to 'userspace' and did:

cpufreq-set -f 1600000

in order to make sure that all the cores are always working at max frequency.

I would appreciate any help.

Here are links to similar cases without a solution: http://lists.linaro.org/pipermail/linaro-kernel/2012-December/002611.html http://forums.arm.com/index.php?/topic/15020-pmu-in-cortex-a8-omap-3530-what-am-i-doing-wrong/

Relevant stackoverflow topic: How to measure program execution time in ARM Cortex-A8 processor?

Upvotes: 6

Views: 1929

Answers (1)

Milind Dumbare
Milind Dumbare

Reputation: 3244

Can you see other HW events like "CPU cycles" or "cache misses"?

perf stat -e cache-misses,cycles ls

You might want to set CONFIG_HW_PERF_EVENTS as well.

Upvotes: 2

Related Questions