Differences between revisions 3 and 4
Revision 3 as of 2013-02-25 18:44:35
Size: 2807
Editor: proxy3
Comment:
Revision 4 as of 2014-10-11 14:49:22
Size: 0
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= SystemTap for Android =

This tutorial describes howto build SystemTap for Android. Further more it is explained howto configure the your workspace to be able to compile your own stap scripts for Android and to start them.
It is possible that you have to do some shaky things with your Android device during this manual. Make sure you have backuped all your important data!

== Requirements ==
 * A rooted android device with a self-built kernel - for further information on how to built your own kernel für android have a look at [[SystemTapOnAndroidARM/BuildingKernel|self-build Android kernel]]
 * All requirements are met to build systemtap
 * Get a copy of the systemtap-android repo:

        `git clone https://github.com/flipreverse/systemtap-android.git`

 * Before you can start, you have to clone the submodules. Just run two commands:

 `git submodule init`

 `git submodule update`

== Building SystemTap ==

To be able to compile your systemtap scripts for android, just start the buildscript:

 `./build.sh`

It automatically configures, build and installs systemtap for you.
You can find this installation in the `installed` directory. It is independet from any other installation on your system.
The script builds the arm binaries as well. There are located at `src/android_binaries`.

== Setting up a device config ==

Before you can compile your stap script into a kernelmodule. You have to create a configuration for the target platform.
So far a configuration consists of a path to the kernel sourcetree.

To create such a configuration write the path in a textfile named `<device>.conf` and place it under the `config` directory.
Here is an example for the `Samsung Galaxy Nexus`:

 omap.conf, contents: /path/to/my/kernel/omap
 
== Compile a script for android ==

Ensure that you have created a configuration for your device under `conf/` and the kernel tree is prepared for compiling modules.
Your script should be located in the `scripts` directory.
To start the compilation:
 `./build_module.sh <script> <devicename>`

Where `<devicename` specifies the configuration to be used and `<script>` the systemtap script.
Important: Omit the filename extension from both parameters.

The compiled script is located in `modules/<devicename>/`.

== Run a compiled script (aka kernelmodule) on android ==

First you need to install the SystemTap Android Application located in `android-app` on your device. It is a Eclipse project. So import it to Eclipse and install it on your device.

Now place the compiled script on the sdcard under the `/sdcard/systemtap/modules/ directory.
Just start the android app, select the module and start it. :-)

NOTICE: The Android application is a pre-release(!!!). So be patient with it. :-)