using DS-5 on Galaxy Nexus running AOSP 4.0.4

Home / Linaro Blog / Android / using DS-5 on Galaxy Nexus running AOSP 4.0.4

Last week during connect there was a lot of buzz about DS-5. After using it on Origen and Snowball for profiling android performance, I found DS-5 Streamline extremely useful for profiling apps and libraries in Android . I realized that this tool is extremely useful to application developers in finding hotspot in their applications. But app developers wouldn’t want to use a development board to actually profile apps. I thought of integrating the gator(kernel module+ userspace daemon needed for DS-5 to work with the device) on an end device,which is easily available to developers. I thought of trying on Galaxy Nexus since it is the latest Google device (and that’s the one I have with me ;) ).

The gator module is hosted in Linaro’s git repository:
http://git.linaro.org/gitweb?p=arm/ds5/gator.git;a=summary

I have packaged a boot.img which is based on AOSP 4.0.4 release(android-4.0.4_r1.2). I won’t get into the details of compiling the module and binary.  You can look at linaro’s integration of DS-5 on the boards. It is very similar to that. Maybe I will post if someone needs the instructions.The boot image has the kernel compiled with necessary configs for gator and I have also included the gator daemon and module in the image. The init script takes care of loading and running the daemon.

Download the boot image from here:
http://people.linaro.org/~vishalbhoj/boot_gator.img

You will need  an unlocked galaxy nexus running AOSP 4.0.4.
Test the above boot image by soft booting it to see that it works with the build running on your device . To do that, reboot the device into fastboot mode and boot with above image:

#adb reboot bootloader                                // should get you to bootloader mode
#fastboot boot boot_gator.img                   // boots the image with gator module

You can then connect over adb and check that gatord daemon is running to confirm that device can work with DS-5.

If everything seems to be stable then flash the boot image:

#adb reboot bootloader
#fastboot flash  boot boot_gator.img

Here is a video on how to setup and use DS-5 Streamline for app developers:

One can connect to device by typing the IP address of  the phone in streamline configuration. DS-5  won’t be able to give GPU activity on Galaxy Nexus since GPU on OMAP4 is not supported by DS-5 .

Happy analyzing :) .

Recent Posts
Showing 7 comments
  • vikram pandita

    I would be interested to compile from sources for other omap platforms.
    Could u share please.

    • Vishal Bhoj

      Update the manifest to include gator in android source from linaro’s git repository .

      Update device.mk to compile gatord daemon.
      PRODUCT_PACKAGES := gatord

      The kernel module needs to be compiled manually from external/gator/driver/ and copied into the filesystem.

      The init..rc needs to be updated to start the gator daemon . Add these lines :

      # Gator configuration
      mkdir /data/misc/gatord 0700 root root
      # Load gator module
      insmod /system/modules/gator.ko
      # userspace daemon needed for gator
      service gatord /system/bin/gatord -c /data/misc/gatord/configuration.xml
      class main
      user root

      • vikram pandita

        yes figured that out by unpacking the boot.img
        and now i have my custom boot.img running well on Nexus phone – keeping gator kernel driver as builtin.

        gatord is what i am re-using from your image – i dont need to rebuild that for now.
        and init.rc has minimal change.

        Looks ADBD is getting much invoked to transfer the buffer to host – and that can lead to system load variance.

        Do you have the Paid version… wonder how much it is for !!

  • vikram pandita

    Could you share the sources as well:

    Kernel gives these errors:
    [ 6067.515686] hw perfevents: unable to reserve pmu
    [ 6067.520599] hw perfevents: unable to reserve pmu
    [ 6067.525421] hw perfevents: unable to reserve pmu
    [ 6067.530426] hw perfevents: unable to reserve pmu
    [ 6067.535339] hw perfevents: unable to reserve pmu
    [ 6067.540313] hw perfevents: unable to reserve pmu
    [ 6067.545043] hw perfevents: unable to reserve pmu
    [ 6067.549865] hw perfevents: unable to reserve pmu
    [ 6067.554687] hw perfevents: unable to reserve pmu
    [ 6067.559417] hw perfevents: unable to reserve pmu
    [ 6067.564239] hw perfevents: unable to reserve pmu
    [ 6067.569000] hw perfevents: unable to reserve pmu

    • Vishal Bhoj

      I am also getting the same errors. I have not dug into the issue with it .I would be interested if someone can help in this issue . Here is the kernel source which I have compiled :

      https://android.googlesource.com/kernel/omap remotes/origin/android-omap-tuna-3.0-ics-mr1

      I had to enable perf support in the kernel which is needed to compile gator module.

      • vikram pandita

        Right.

        diff –git a/arch/arm/configs/tuna_defconfig b/arch/arm/configs/tuna_defconfig
        index 22d33d5..936aca0 100644
        — a/arch/arm/configs/tuna_defconfig
        +++ b/arch/arm/configs/tuna_defconfig
        @@ -14,7 +14,6 @@ CONFIG_KALLSYMS_ALL=y
        CONFIG_ASHMEM=y
        # CONFIG_AIO is not set
        CONFIG_EMBEDDED=y
        -# CONFIG_PERF_EVENTS is not set
        CONFIG_PERF_COUNTERS=y
        # CONFIG_SLUB_DEBUG is not set
        CONFIG_PROFILING=y

      • vikram pandita

        diff –git a/arch/arm/configs/tuna_defconfig b/arch/arm/configs/tuna_defconfig
        index 22d33d5..936aca0 100644
        — a/arch/arm/configs/tuna_defconfig
        +++ b/arch/arm/configs/tuna_defconfig
        @@ -14,7 +14,6 @@ CONFIG_KALLSYMS_ALL=y
        CONFIG_ASHMEM=y
        # CONFIG_AIO is not set
        CONFIG_EMBEDDED=y
        -# CONFIG_PERF_EVENTS is not set
        CONFIG_PERF_COUNTERS=y
        # CONFIG_SLUB_DEBUG is not set
        CONFIG_PROFILING=y
        diff –git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
        index 3363433..c3cebb7 100644
        — a/arch/arm/mach-omap2/Kconfig
        +++ b/arch/arm/mach-omap2/Kconfig
        @@ -335,6 +335,7 @@ config MACH_TUNA
        select OMAP_TPS6236X
        select TRACING
        select TRACEPOINTS
        + select GATOR

        config OMAP3_EMU
        bool “OMAP3 debugging peripherals”