I've been trying to get oprofile working on a Nexus One handset, but I'm running into difficulties. I think I'm configuring it correctly but it doesn't collect any samples.
Here's the process I've been following:
1- Rebuild the kernel (the android-msm-2.6.32-nexusonec branch from git://android.git.kernel.org/kernel/msm.git) with profiling support turned on. (Initially the new kernel was too large. I fixed this by turning off the camera driver and the EXT2/EXT3 file systems.)
2- Rebuild Froyo using the new kernel (by adding a suitable definition of TARGET_PREBUILT_KERNEL to .../passion-common/passion.mk).
3- Flash new image onto the device. Verify that it's using the kernel I just built by checking Settings -> About phone -> Kernel version.
4- Connect to the device using "adb shell" and enter "su" to get a root prompt.
Using Eclair on a HTC Magic, and using "--event=INSN_EXECUTED:500000" instead of "CPU_CYCLES" I've been able to collect meaningful profile results, however I'm specifically interested in getting results on a Nexus One, and nothing I've tried so far has worked.
I've also tried using the Cyanogenmod Eclair release but that fails to work too, in exactly the same way.
Has anyone had any success getting oprofile to work with Froyo on a Nexus One? Can anyone suggest anything I should try?
It looks like you are really close of getting profile samples collected, but it is not clearly to me what prevented it from happening. Could you add "adb remount" between step 4 and 5 to see if it fixed the issue?
BTW, if CPU_CYCLES is the only event type you care about, you can also try to combine the --setup and --event options with a single "opcontrol --quick" step.
On Tue, Jul 6, 2010 at 8:06 AM, Mike Playle <mike.pla...@realvnc.com> wrote: > Hello all,
> I've been trying to get oprofile working on a Nexus One handset, but > I'm running into difficulties. I think I'm configuring it correctly > but it doesn't collect any samples.
> Here's the process I've been following:
> 1- Rebuild the kernel (the android-msm-2.6.32-nexusonec branch from > git://android.git.kernel.org/kernel/msm.git) with profiling support > turned on. (Initially the new kernel was too large. I fixed this by > turning off the camera driver and the EXT2/EXT3 file systems.)
> 2- Rebuild Froyo using the new kernel (by adding a suitable definition > of TARGET_PREBUILT_KERNEL to .../passion-common/passion.mk).
> 3- Flash new image onto the device. Verify that it's using the kernel > I just built by checking Settings -> About phone -> Kernel version.
> 4- Connect to the device using "adb shell" and enter "su" to get a > root prompt.
> Using Eclair on a HTC Magic, and using "--event=INSN_EXECUTED:500000" > instead of "CPU_CYCLES" I've been able to collect meaningful profile > results, however I'm specifically interested in getting results on a > Nexus One, and nothing I've tried so far has worked.
> I've also tried using the Cyanogenmod Eclair release but that fails to > work too, in exactly the same way.
> Has anyone had any success getting oprofile to work with Froyo on a > Nexus One? Can anyone suggest anything I should try?
> Regards
> Mike Playle > RealVNC
> -- > You received this message because you are subscribed to the Google Groups > "android-platform" group. > To post to this group, send email to android-platform@googlegroups.com. > To unsubscribe from this group, send email to > android-platform+unsubscribe@googlegroups.com<android-platform%2Bunsubscrib e@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/android-platform?hl=en.
On Tue, 2010-07-06 at 21:48 -0700, Ben Cheng wrote: > It looks like you are really close of getting profile samples > collected, but it is not clearly to me what prevented it from > happening. Could you add "adb remount" between step 4 and 5 to see if > it fixed the issue?
It fails with a "remount failed: Operation not permitted" error.
I tried doing the remount from the device's shell - as I understand it this should be equivalent to "adb remount":
# mount -o remount,rw /dev/block/mtdblock3 /system
But this doesn't help. :(
> BTW, if CPU_CYCLES is the only event type you care about, you can also > try to combine the --setup and --event options with a single > "opcontrol --quick" step.
This has the same effect - it appears to start, but doesn't actually collect any samples.
-----Original Message----- From: Mike Playle <mike.pla...@realvnc.com> Sent: 07 July 2010 10:23 To: android-platform@googlegroups.com Subject: Re: Nexus One and oprofile
On Tue, 2010-07-06 at 21:48 -0700, Ben Cheng wrote: > It looks like you are really close of getting profile samples > collected, but it is not clearly to me what prevented it from > happening. Could you add "adb remount" between step 4 and 5 to see if > it fixed the issue?
It fails with a "remount failed: Operation not permitted" error.
I tried doing the remount from the device's shell - as I understand it this should be equivalent to "adb remount":
# mount -o remount,rw /dev/block/mtdblock3 /system
But this doesn't help. :(
> BTW, if CPU_CYCLES is the only event type you care about, you can also > try to combine the --setup and --event options with a single > "opcontrol --quick" step.
This has the same effect - it appears to start, but doesn't actually collect any samples.
Thanks for your help,
Mike
-- You received this message because you are subscribed to the Google Groups "android-platform" group. To post to this group, send email to android-platform@googlegroups.com. To unsubscribe from this group, send email to android-platform+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
On Tue, 2010-07-06 at 16:06 +0100, Mike Playle wrote: > I've been trying to get oprofile working on a Nexus One handset, but > I'm running into difficulties. I think I'm configuring it correctly > but it doesn't collect any samples.
I've got this working now.
The main problem was that the kernel driver wasn't registering an interrupt handler for the performance monitoring hardware. The fix for this is on Gerrit here:
I'm having problems with oprofile too. It won't collect any samples
even I have compiled my kernel and framework numerous of times.
I used git to get the kernel from android source
git clone git://android.git.kernel.org/kernel/msm.git
git branch -r and then selected origin/android-msm-2.6.32-nexusonec
from the branches list with command:
git checkout --track -b android-msm-2.6.32-nexusonec origin/android-
msm-2.6.32-nexusonec
then ran git branch to check that correct branch is selected, which it
was (* android-msm-2.6.32-nexusonec)
I pulled Mike Playle's oprofile interrupt fix from android source:
git pull git://android.git.kernel.org/kernel/msm refs/changes/
07/15707/1
Ensured it got downloaded by checking that arch/arm/oprofile/
op_model_v7.c file has the needed changes.
After that I pulled .config file from nexus one and executed
make ARCH=arm CROSS_COMPILE=$CCOMPILER oldconfig
make ARCH=arm CROSS_COMPILE=$CCOMPILER menuconfig
from menuconfig I enabled oprofiling support. Then I made sure
that .config file had following parameters
Then it was time to build the kernel image (CCOMPILER points to 'arm-
eabi-')
make ARCH=arm CROSS_COMPILE=$CCOMPILER zImage
After compiling finished, I ran 'fastboot boot /arch/arm/boot/zImage'
and after phone rebooted with new kernel I started oprofiling
opcontrol --setup
opcontrol --event=CPU_CYCLES:100000
opcontrol --start
At this point I run different apps and try to get some samples
No samples being collected
profiler is running
0 samples received
0 samples lost overflow
I've built couple of android frameworks(Eclair and Froyo) with
opcontrol patch using oprofiling kernel but still no samples.
After fighting this a week I decided to post this here. I really hope
someone could help me with this.
On Mon, 2010-07-19 at 00:05 -0700, Jack wrote: > Hi
> I'm having problems with oprofile too. It won't collect any samples > even I have compiled my kernel and framework numerous of times.
> I used git to get the kernel from android source [...]
I'm not sure what's changed in the last week and a half but interestingly it's not working for me now either.
>From a quick look it seems that something else is changing the
performance counter registers between armv7_setup_pmnc() and armv7_pmnc_start(). I've managed to get it collecting samples again by adding a call to armv7_setup_pmnc() at the end of armv7_pmnc_start(), just before it calls armv7_start_pmnc():
ret = armv7_request_interrupts(irqs, ARRAY_SIZE(irqs)); if (ret >= 0) { armv7_setup_pmnc(); armv7_start_pmnc(); }
Of course this isn't a real fix - the real fix is to find out what's changing the registers - but this quick hack is at least letting me collect samples, and unfortunately I don't have the time at the moment to look into it any more deeply.
I just wish I knew why I wasn't seeing this a week ago!
> On Mon, 2010-07-19 at 00:05 -0700, Jack wrote:
> > Hi
> > I'm having problems with oprofile too. It won't collect any samples
> > even I have compiled my kernel and framework numerous of times.
> > I used git to get the kernel from android source [...]
> I'm not sure what's changed in the last week and a half but
> interestingly it's not working for me now either.
> >From a quick look it seems that something else is changing the
> performance counter registers between armv7_setup_pmnc() and
> armv7_pmnc_start(). I've managed to get it collecting samples
> again by adding a call to armv7_setup_pmnc() at the end of
> armv7_pmnc_start(), just before it calls armv7_start_pmnc():
> ret = armv7_request_interrupts(irqs, ARRAY_SIZE(irqs));
> if (ret >= 0) {
> armv7_setup_pmnc();
> armv7_start_pmnc();
> }
> Of course this isn't a real fix - the real fix is to find out
> what's changing the registers - but this quick hack is at least
> letting me collect samples, and unfortunately I don't have the
> time at the moment to look into it any more deeply.
> I just wish I knew why I wasn't seeing this a week ago!
> On Tue, 2010-07-06 at 16:06 +0100, Mike Playle wrote:
> > I've been trying to getoprofileworking on a Nexus One handset, but
> > I'm running into difficulties. I think I'm configuring it correctly
> > but it doesn't collect any samples.
> I've got this working now.
> The main problem was that the kernel driver wasn't registering an
> interrupt handler for the performance monitoring hardware. The fix for
> this is on Gerrit here: