Android Performance Analysis (Streamline) Tutorial
DS-5 CE Android Streamline
To analyze the performance of your native application or system you need to install Arm Development Studio 5 Community Edition plug-ins and its prerequisite packages. If you haven't done so, see installation instructions.
You will need to have Streamline's kernel module and daemon running on your device. Whilst mass market Android devices tend not to ship these software components in their production software images, some popular development platforms do. Find out which ones on the DS-5 Supported Platforms web page. If your device is not listed there, you can still build Streamline's kernel module against the version of the Linux kernel on your device and install it onto the target yourself, provided you have enough access privileges and the kernel source code. For details on how to achieve this please see Arm DS-5 Using Arm Streamline.
For the scope of this document we will use a pre-configured distribution provided by Linaro which is Arm Streamline enabled. See www.linaro.org/downloads for details and installation instructions of Linaro builds.
Once you have all required components installed on your target, you might need to manually start the gator daemon to allow Streamline to connect to the device to collect performance data.
- On your target execute “gatord &” to start the gator daemon.
- The Streamline gator daemon communicates over a TCP/IP connection to send the data to your host PC. Using Android we can use the adb connection to forward a port over USB to the host.
- On your host execute “adb forward tcp:8080 tcp:8080”.
- In Eclipse, open the Arm Streamline View by selecting Window > Show View > Other > Arm Streamline > Arm Streamline Data.
- Next we need to setup Streamline settings. In the Arm Streamline Data View open the capture options by clicking on the gear lever button.
- In the Connection Address box type the IP address to your target or “localhost” if you used adb to forward the TCP port.
- In the Program Images box select the Image (or shared library) that you want to profile. Alternatively, you can select none and add the Images after you have gathered the data. Click Save once you finished with the Capture Options.
Capturing Data and Viewing the Arm Streamline Report
- In the Arm Streamline Data View click the Start Capture button to start collecting the profiling information from the target. A spinning wheel will appear in the Data view indicating you are collecting data from the target.
- Next run the application which you wish to profile on your target.
- When you are finished executing the application click stop in the Arm Streamline Data View. The remainder of the data will be analyzed and you will be presented with a report once it is finished.
- The Timeline View displays a list of pre-configured performance counters measuring activity on the Arm core. In the bottom of the view a list of processes and threads are displayed along with a heat map showing where in your code the most time was spent.
- Click on the functions tab to display a list of the functions which took the most time in your profile run. The top functions for which you have loaded shared libraries for in the Capture Options will be displayed, along with a list of the other shared libraries that was used by the application during the run. TIP: You can add more shared libraries by double clicking on the Streamline Data in the Arm Streamline Data View. From the view below “fir_filter_c” is taking up a lot of time, and would be a good candidate to optimize.
The DS-5 Community Edition does not include all features of DS-5 Streamline. See Streamline features for available options.