How to Set up ARM Streamline Performance Analyzer on ODROID-XU4

Streamline is a graphical performance analysis tool that present report data in both visual and statistical forms.
It uses hardware performance counters with kernel metrics to provide an accurate representation of system resources.
This wiki page describes the way how to set-up and run Streamline on ODROID-XU4 system.

Summary

  • Install DS-5 Community Edition on Host PC
  • Building Kernel and Gator Module
  • Building Gator Daemon
  • Running Gator on Target and Streamline on Host PC

The release version , 4.14.37-130 (Apr 30, 2018) is available to run Streamline.

First, please download DS-5 and install on your Host PC.
If you don't have any license, you can try DS-5 Community Edition.
https://developer.arm.com/products/software-development-tools/ds-5-development-studio/editions/community-edition

To run Streamline, you must enable certain kernel configuration options.
Also you can use kernel space gator that provides more features than user space gator.
It requires you to build the kernel source code.

On ODROID-XU4, it's available to support Streamline with the following commit.
https://github.com/hardkernel/linux/commit/7d900f3f1f548ce50dab9b11120c51435cf0613e
https://github.com/hardkernel/linux/commit/7de04f6b76fa575b0143bc4132207840c6188fea

Also the version, 4.14.37-130 has been released that includes the commit,
so you don't need to build kernel source.

For more information about kernel configuration and gator module, please refer to the following links.
If you use the lower version, the following will be helpful to build up your environment.

Kernel Configuration

[1] https://static.docs.arm.com/dui0482/w/DUI0482W_streamline_user_guide.pdf

  • Section 1.3 Streamline prerequisites on page 1-18.
  • Section 1.6 Required kernel configuration menu options on page 1-23.

[2] https://github.com/ARM-software/gator#kernel-configuration

gator kernel module, gator.ko

To communicate with target device, Streamline requeires the gator daemon, gatord, to be running on the device.
Streamline includes a pre-built gatord binary and you can refer to the following link.
But a sysfs node to gather information are different on ODROID-XU4,
so it's needed to build gatord.

Download

You can download gator damon from this site.
https://github.com/ARM-software/gator

odroid@odroid:~$ sudo apt-get install git
odroid@odroid:~$ git clone https://github.com/ARM-software/gator.git

You need this commit to run gator daemon on ODROID-XU4
because the clock node of mali GPU is different from the existing one in ARM-software github.

https://github.com/JeonghwaCho/gator/commit/594d4c7ca43ed0af53afa890e382e2dfbceb6369

Build

Now you can build it.

odroid@odroid:~$ cd ${path_of_gator}
odroid@odroid:~$ cd daemon
odroid@odroid:~$ make

On target (ODROID-XU4)

You need root privileges to run gatord.

odroid@odroid:~$ su
root@odroid:~# ${gator_path}/gator/daemon/gatord  -m  /lib/modules/$(uname -r)/kernel/drivers/gator/gator.ko &

You can determine if gator is running as following.

root@odroid:~# lsmod | grep gator
gator                  90112  1

Mali Midgard GPU is defined in gator.ko, so you will get ARM_Mali-Midgard- and -T62X related events under the /dev/gator/events/

root@odroid:~# ls /dev/gator/events/
ARM_Mali-Midgard_Filmstrip_cnt0        ARM_Mali-T62x_LS_RESTARTS
ARM_Mali-Midgard_fragment              ARM_Mali-T62x_LS_TLB_HIT
ARM_Mali-Midgard_MMU_AS_0              ARM_Mali-T62x_LS_TLB_MISS
ARM_Mali-Midgard_MMU_AS_1              ARM_Mali-T62x_LS_WORDS
ARM_Mali-Midgard_MMU_AS_2              ARM_Mali-T62x_MESSAGES_RECEIVED
.....
.....

On host PC

Via Ethernet interface, you can connect ODROID-XU4 device to Streamline on your host PC.
Please set [Connection] - [Address].

If the connection is established successfully, all of available counters to fit XU4 system will be shown in this menu.

For more detailed information, please refer to the ARM developer site.

In the release version of ODROID-XU4, a defconfig, CONFIG_DEBUG_INFO is NOT included by default.
The option is only required for profiling the Linux kernel.
If you need the functionality, it's needed to build kernel.
Please refer to the following guide.