Issue with oprofile and perf on android 4.2.2 sabresd_6dq imx6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue with oprofile and perf on android 4.2.2 sabresd_6dq imx6

Jump to solution
1,398 Views
floriang
Contributor III

Hello,

I would like to use oprofile and perf tools that come with android 4.2.2.

Actually I managed to use them, but in order to do this I have to kill all CPU cores on my quad iMX6 SABRE SD board.

But in the end, I need at least one additional CPU to run my application so that the profiling results are meaningful, so how can I make it work with 2 cpus???

Here are some details:

Board: iMX6 SABRE SD quad/dual

OS: Android 4.2.2 with freescale BSP, compiled in engineering build, lunch target: sabresd_6dq

--> compiled with the instructions in Android_User_Guide.pdf from this document:

https://www.freescale.com/webapp/Download?colCode=IMX6_JB422_100_ANDROID_DOCS&location=null&fpsp=1&W...

The oprofile & perf tools are present, and they run, but if I have more than 1 CPU active, they report no activity!

And if I leave only one CPU active, they work fine!

It seems like a bug somewhere in freescale code but I don't know enough to find out...

Any ideas?

Labels (3)
0 Kudos
1 Solution
644 Views
floriang
Contributor III

Ok, so finally I got it working, so I'll share if it can help anyone:

Basically the problem seems to be that android ships with an old oprofile version (0.9.1) that doesn't support well cortex-a9 CPU counters.

The solution is either to update to a more recent version (0.9.7), or to use timer events.

In the end I activated timer events following the instructions from this post:

http://ssvb.github.io/2011/08/23/yet-another-oprofile-tutorial.html

you just need to pass "oprofile.timer=1" to the kernel at boot and you're good to go.

About perf, it is possible to specify which events to listen to with the -e option, so I did:

"perf top -ecpu-clock" and got expected results.

View solution in original post

0 Kudos
1 Reply
645 Views
floriang
Contributor III

Ok, so finally I got it working, so I'll share if it can help anyone:

Basically the problem seems to be that android ships with an old oprofile version (0.9.1) that doesn't support well cortex-a9 CPU counters.

The solution is either to update to a more recent version (0.9.7), or to use timer events.

In the end I activated timer events following the instructions from this post:

http://ssvb.github.io/2011/08/23/yet-another-oprofile-tutorial.html

you just need to pass "oprofile.timer=1" to the kernel at boot and you're good to go.

About perf, it is possible to specify which events to listen to with the -e option, so I did:

"perf top -ecpu-clock" and got expected results.

0 Kudos