Configs :
1. Getting kernel source for Nexus S.
$mkdir ~/android
$cd android
$ git clone https://android.googlesource.com/kernel/samsung.git
2. Checkout the source.
$ git branch -r
origin/HEAD -> origin/master
origin/android-samsung-2.6.35-gingerbread
origin/android-samsung-3.0-ics-mr1
origin/android-samsung-3.0-jb
origin/master
$git checkout android-samsung-2.6.35-gingerbread origin/android-samsung-2.6.35-gingerbread
3. Export prebuild toolchanin & build vars...
$export PATH=<SDK_PATH>/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
$export ARCH=arm
$export SUBARCH=arm
$export CROSS_COMPILE=arm-eabi-
4. Compile kernel and gator module.
$ make herring_defconfig
arch/arm/configs/herring_defconfig:323:warning: override: reassigning to symbol LOCALVERSION_AUTO
arch/arm/configs/herring_defconfig:333:warning: override: reassigning to symbol NET_ACTIVITY_STATS
#
# configuration written to .config
#
#herring_defconfig is config for NEXUS S, use 'make help' to find out your device config
$nano .config
Ensure the parameters below is set.
- CONFIG_PROFILING=y
- CONFIG_FTRACE=y
- CONFIG_ENABLE_DEFAULT_TRACERS=y
$ make -j4 CROSS_COMPILT=arm-eabi- uImage
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
Kernel: arch/arm/boot/Image is ready
SHIPPED arch/arm/boot/compressed/lib1funcs.S
AS arch/arm/boot/compressed/lib1funcs.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
UIMAGE arch/arm/boot/uImage
Image Name: Linux-2.6.35.7-gf5f63ef
Created: Thu Sep 27 13:36:20 2012
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3017840 Bytes = 2947.11 kB = 2.88 MB
Load Address: 30008000
Entry Point: 30008000
Image arch/arm/boot/uImage is ready
5. Build Gator module
Install DS-5 module for Eclipse, detail please refer to
HERE.
or
Download DS-5 from http://www.arm.com/products/tools/software-tools/ds-5/index.php
6. After install.....go Eclipse Help-> ARM Extras, explore pop out.....
navigate to 'driver-src', extract 'gator-driver.tar.gz'.. to kernel dir.
$ cd gator-driver/
$ make -C path/to/kernel M=`pwd` modules
$ cd ..
$ adb pull /sdcard/init.rc /path/to/sdk/tools/
7. go Eclipse Help-> ARM Extras, explore pop out.....
navigate to 'daemon-src'.
$ mkdir /path/to/arm/gator/android
$ cp /path/to/arm/gator/daemon-src/gator-daemon/gator-daemon.tar.gz /path/to/arm/gator/android/
$ tar -zxvf gator-daemon.tar.gz
$ mv gator-daemon jni
$ ndk-build
Compile++ thumb : gatord <= CapturedXML.cpp
Compile++ thumb : gatord <= Child.cpp
Compile++ thumb : gatord <= Collector.cpp
Compile++ thumb : gatord <= ConfigurationXML.cpp
Compile++ thumb : gatord <= Fifo.cpp
Compile++ thumb : gatord <= LocalCapture.cpp
Compile++ thumb : gatord <= Logging.cpp
Compile++ thumb : gatord <= main.cpp
Compile++ thumb : gatord <= OlySocket.cpp
Compile++ thumb : gatord <= OlyUtility.cpp
Compile++ thumb : gatord <= Sender.cpp
Compile++ thumb : gatord <= SessionData.cpp
Compile++ thumb : gatord <= SessionXML.cpp
Compile++ thumb : gatord <= StreamlineSetup.cpp
Compile thumb : gatord <= mxml-attr.c
Compile thumb : gatord <= mxml-entity.c
Compile thumb : gatord <= mxml-file.c
Compile thumb : gatord <= mxml-get.c
Compile thumb : gatord <= mxml-index.c
Compile thumb : gatord <= mxml-node.c
Compile thumb : gatord <= mxml-private.c
Compile thumb : gatord <= mxml-search.c
Compile thumb : gatord <= mxml-set.c
Compile thumb : gatord <= mxml-string.c
StaticLibrary : libstdc++.a
Executable : gatord
Install : gatord => libs/armeabi/gatord
8. Copy gatord to device.
# adb push gatord /sdcard/
# adb push gator.ko /sdcard/
# adb shell
# su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
# mv /sdcard/gatord /system/xbin/
# mv /sdcard/gator.ko /system/xbin/
# mount -o ro,remount -t yaffs2 /dev/block/mtdblock4 /system
# sync
# reboot
9. After device boot up.
# adb shell
# su
# gatord &
10. Profiling Android phone with Streamline
Streamline supports connection to your target using Ethernet. Using the Android Debug Bridge (ADB) utility, it is possible to forward a TCP port from the target to your PC localhost over a USB connection. ADB can also be configured to work over Ethernet or Wi-Fi. For more information about the Android SDK and ADB setup, see the Android website. Once ADB is set up, forward the Streamline port to your localhost using the following command:
# adb forward tcp:8080 tcp:8080
Now run DS-5 on your PC and open the Streamline Data View. If it is not visible from the Window->Show View menu, select Window->Show View->Other; find “ARM Streamline” in the dialog box and open “ARM Streamline Data”. Enter the device’s Ethernet address in the Capture Options dialog box of the ARM Streamline Data view in Eclipse or DS-5. If you use the Android Debug Bridge (ADB) over USB to forward the port, enter localhost in the Address field.
[src] :
1. http://blogs.arm.com/software-enablement/682-setting-up-android-mobile-phone-to-use-arm-streamline-for-profiling/
2. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0482d/BABECIDJ.html
3. http://source.android.com/source/building-kernels.html