Hi,
I have had some success in getting oprofile to run on the ADP1 phone.
First update the ADP1 to 1.5 images. It makes things simpler...You can
get the images from (
http://www.htc.com/www/support/android/adp.html)
This is what I had to do :-
Sources
o Follow the instructions for building for the dream to update your master repo
o You need to build your own custom kernel which oprofile turned on.
For this I had to use the msm.git repo (git clone
git://
android.git.kernel.org/kernel/msm.git). This kernel has all the
required patches...
Building the Kernel
o Start with make msm_defconfig and then modify the config to enable oprofile
o Cross compile the kernel using 4.2.1 arm-eabi toolchain
o export ARCH=arm
o export CROSS_COMPILE=<path to 4.2.1 tool chain>/arm-eabi-
o make
Building the boot.img
o cd to your master repo
o In your
buildspec.mk, you need to add the following lines
TARGET_PRODUCT=htc_dream
TARGET_PREBUILT_KERNEL=<path to the built kernel> (e.g
..../kernel/arch/arm/boot/zImage)
o . build/envsetup.sh
o make
If all goes you should get a boot.img in out/target/product/dream/
which contains the kernel you built. You will also see the system.img,
userdata.img etc..
Flashing the phone
o fastboot flast boot boot.img (you can flash the other images if you
want as well)
Running oprofile
o The master repo has a oprofile directory in external/oprofile
o As part of the build process it builds oprofiled and opcontrol.
o Copy them to the phone( Although the phone contains versions in
/system/xbin, they seem to be the older versions)
o adb push opcontrol /data/local/ (the opcontrol in this case is not a
script, you can use the script version if you want, but then you need
to make sure you set the OPROFILE_EVENTS_DIR and session-dir to
something appropriate)
o adb push oprofiled /data/local/
o adb shell
o cd /data/local
o ./opcontrol --setup
o ./opcontrol --event=CPU_CYCLES:150000
o ./opcontrol --start
o ./opcontrol --status (make sure both the profiler and the daemon are running)
o profile your app
o opcontrol --stop
o If everything went well, you will see two directories {kern} and
{root} in your /data/oprofile/samples/current/
Post Processing
o Use the opimport_pull script in external/oprofile/ directory to pull
the sample and process them on the host.
Hope this helps.
- Vijay