Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Nexus One and oprofile
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mike Playle  
View profile  
 More options Jul 6 2010, 11:06 am
From: Mike Playle <mike.pla...@realvnc.com>
Date: Tue, 06 Jul 2010 16:06:37 +0100
Local: Tues, Jul 6 2010 11:06 am
Subject: Nexus One and oprofile
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.

5- Configure and start oprofile:

# opcontrol --setup
# cat /dev/oprofile/cpu_type
arm/armv7#
# opcontrol --event=CPU_CYCLES:100000
Using 2.6+ OProfile kernel interface.
Using log file /data/oprofile/samples/oprofiled.log
# opcontrol --start
# opcontrol --status
Driver directory: /dev/oprofile
Session directory: /data/oprofile
Counter 0:
    name: CPU_CYCLES
    count: 100000
Counter 1 disabled
Counter 2 disabled
Counter 3 disabled
Counter 4 disabled
oprofiled pid: 373
profiler is running
          0 samples received
          0 samples lost overflow

So it looks like oprofile is available and enabled in the kernel, but
no samples are being collected.

After using the phone for a while "opcontrol --status" still reports
no samples:

# opcontrol --status
Driver directory: /dev/oprofile
Session directory: /data/oprofile
Counter 0:
    name: CPU_CYCLES
    count: 100000
Counter 1 disabled
Counter 2 disabled
Counter 3 disabled
Counter 4 disabled
oprofiled pid: 373
profiler is running
          0 samples received
          0 samples lost overflow

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Cheng  
View profile  
 More options Jul 7 2010, 12:48 am
From: Ben Cheng <bcch...@android.com>
Date: Tue, 6 Jul 2010 21:48:31 -0700
Local: Wed, Jul 7 2010 12:48 am
Subject: Re: Nexus One and oprofile

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.

-Ben


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Playle  
View profile  
 More options Jul 7 2010, 4:23 am
From: Mike Playle <mike.pla...@realvnc.com>
Date: Wed, 07 Jul 2010 09:23:47 +0100
Local: Wed, Jul 7 2010 4:23 am
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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tomasz Mloduchowski  
View profile  
 More options Jul 7 2010, 7:35 am
From: "Tomasz Mloduchowski" <qdot...@gmail.com>
Date: Wed, 7 Jul 2010 13:35:57 +0200
Local: Wed, Jul 7 2010 7:35 am
Subject: RE: Nexus One and oprofile

-----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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Nexus One and oprofile - Fixed!" by Mike Playle
Mike Playle  
View profile  
 More options Jul 9 2010, 12:04 pm
From: Mike Playle <mike.pla...@realvnc.com>
Date: Fri, 09 Jul 2010 17:04:10 +0100
Local: Fri, Jul 9 2010 12:04 pm
Subject: Re: Nexus One and oprofile - Fixed!

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:

   https://review.source.android.com/15707

I've also made a fix to the 'opcontrol' tool so that it creates its
directories with sensible permissions:

   https://review.source.android.com/15709

Anyway with these two patches oprofile appears to be working fine
for me under Froyo on the Nexus One.

Hope this helps,

Mike Playle
RealVNC


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jack  
View profile  
 More options Jul 19 2010, 3:05 am
From: Jack <jackjer...@rocketmail.com>
Date: Mon, 19 Jul 2010 00:05:47 -0700 (PDT)
Local: Mon, Jul 19 2010 3:05 am
Subject: Re: Nexus One and oprofile - Fixed!
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

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

CONFIG_OPROFILE_ARMV7=y
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_OPROFILE=y
CONFIG_HAVE_OPROFILE=y

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.

Thanks in advance
Jack


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Playle  
View profile  
 More options Jul 20 2010, 7:29 am
From: Mike Playle <mike.pla...@realvnc.com>
Date: Tue, 20 Jul 2010 12:29:18 +0100
Local: Tues, Jul 20 2010 7:29 am
Subject: Re: Nexus One and oprofile - Fixed!

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!

Hope this helps

Mike


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jack  
View profile  
 More options Jul 20 2010, 8:01 am
From: Jack <jackjer...@rocketmail.com>
Date: Tue, 20 Jul 2010 05:01:55 -0700 (PDT)
Local: Tues, Jul 20 2010 8:01 am
Subject: Re: Nexus One and oprofile - Fixed!
THANKS! It's working and I just collected my first samples.
This fix works for me just perfect :)

Jack

On 20 heinä, 14:29, Mike Playle <mike.pla...@realvnc.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Danke Xie  
View profile  
 More options Jul 21 2010, 6:23 pm
From: Danke Xie <danke....@gmail.com>
Date: Wed, 21 Jul 2010 15:23:16 -0700 (PDT)
Local: Wed, Jul 21 2010 6:23 pm
Subject: Re: Nexus One and oprofile - Fixed!
Adding the interrupt INT_ARM11_PM for performance monitoring seems
correct. I saw similar changes in op_model_v6.c and op_model_v7.c as
well.

For example,
http://webcache.googleusercontent.com/search?q=cache:RD6hBAR76wIJ:bal...

Thanks,
Danke

On Jul 9, 9:04 am, Mike Playle <mike.pla...@realvnc.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »