Issue with oprofile and perf on android 4.2.2 sabresd_6dq imx6

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Issue with oprofile and perf on android 4.2.2 sabresd_6dq imx6

跳至解决方案
1,733 次查看
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?

标签 (3)
0 项奖励
回复
1 解答
979 次查看
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 项奖励
回复
1 回复
980 次查看
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 项奖励
回复