You copied the Doc URL to your clipboard.

Setting up an ARM Linux target

These instructions are specific to targets running ARM Linux.

Note

You can locate all of the files provided by DS-5 by selecting Help → ARM Extras... from the main menu.

Prerequisites

You must have the following tools on your host to build the Linux kernel and the gator driver:

  • Linux kernel source code for the target platform. Streamline supports only Linux kernel versions 2.6.32 and above.

  • Either the cross compiler for building the Linux kernel or the ARM Linux GCC that comes with DS-5.

Note

Streamline only supports hardware targets, not Real Time System Models (RTSMs). Streamline can run on an RTSM, but an RTSM does not provide the cycle and timing information to make the samples-generated data in the reports meaningful.

Load the gator daemon

The gator daemon and driver collect target metrics and then send them to your host machine.

To enable profiling, you must build and load the gator daemon on your target. Follow these steps to build the gator daemon from the source archive:

  1. Move to the directory that contains the gator daemon source:

    cd .../gator/daemon-src

  2. Enter the following commands to unzip the archive:

    tar -xzf gator-daemon.tar.gz

    Note

    Make sure to untar this file in a directory in which you have write privileges.

  3. Change directories to the newly created gator-daemon:

    cd gator-daemon

  4. Issue the make command to build gatord:

    make

  5. Move the newly created gatord to your host.

Note

You must build the gator daemon on your gcc-enabled target or a Linux host. It is not possible to build the gator daemon on a Windows host.

Prepare and build your kernel

To prepare your kernel for use with Streamline, download one of the supported versions of the Linux kernel, configure it to your target platform, customize it, and then build it. To do so, follow these steps:

  1. Download one of the supported versions of the Linux kernel. For example:

    wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.35.7.tar.bz2

  2. Unzip the Linux kernel. For example, enter the following command:

    tar xjf linux-2.6.35.7.tar.bz2

  3. Navigate to the root source directory of the Linux kernel. For example, enter the following command:

    cd linux-2.6.35.7

  4. Enter the following command in your shell to export the cross compiler:

    export CROSS_COMPILE=${CROSS_TOOLS}/bin/arm-none-linux-gnueabi-

  5. To specify that this build is for an ARM architecture, enter the following command in your shell:

    export ARCH=arm

  6. Enter the following to build the configuration file specific to your platform:

    make platform_defconfig

    Replace platform_defconfig in the command with one of the configuration files located in the your_kernel/arch/arm/configs directory appropriate for your platform or with a configuration file provided by a vendor.

  7. To configure menus, enter the following in your shell:

    make menuconfig

    You must enable certain kernel configuration options to run Streamline. The location of some of these options depends on your kernel version:

    General Setup

    Enable the Profiling Support option.

    Kernel Hacking

    Enable the Trace process context switches option.

    Kernel Features

    Enable the High Resolution Timer Support option. Enable Use local timer interrupts if you are using a Symmetric MultiProcessing (SMP) target.

    Note

    The Trace context switches and events option is not be visible if you have other Tracers configuration options enabled. Enabling other Tracers configuration options is sufficient to turn on context switches and events and run Streamline.

    Note

    To enable the CPU Freq Timeline view chart, gator requires kernel version 2.6.38 or greater and that you define CONFIG_CPU_FREQ.

  8. Use the following command to build the image:

    make -j5 uImage

Build the gator module

To use Streamline with your ARM target, you must build the gator driver on a Linux host and place it in the same directory as the gator daemon, gatord, on the target file system.

DS-5 provides a gator-driver.tar.gz source archive. Assuming that you have unzipped the file and that you have all of the required tools for building kernel modules, enter the following command on your target to create the gator.ko module:

make -C kernel_build_dir M=`pwd` ARCH=arm CROSS_COMPILE=<...> modules

Note

You can build the gator module on your target. To do so, you do not need to include the ARCH or CROSS_COMPILE parameters. Enter the following command on your target: make -C kernel_build_dir M=`pwd`.

Run the gator daemon on your target

When all of the necessary files are in place, you can start the gator daemon.

To run gatord:

  1. Load the kernel onto the target

  2. Copy gatord and gator.ko into the file system on the target. If gatord is in a different directory than gator.ko on the target, you must include the path to gator.ko using the -m option of gatord. For example: ./gatord & -m home/gator/gator.ko.

  3. To ensure gatord has execute permission, enter the following command:

    chmod +x gatord

  4. After making sure that you have root privileges, enter the following to execute the gator daemon:

    ./gatord &

You can use the following options with gatord:

-c

Sets the location of the configuration.xml file that defines the capture options. Include the directory location and the file name. This option is useful when directory containing gatord is not writeable.

-e

Defines the location of the events.xml file to use with gatord. events.xml defines the counters that Streamline collects during the capture session. Include the directory location and the file name.

-h

Lists all of the available gatord command line options.

-p

Sets the port number that gatord uses to communicate with the host.

-s

Defines the location of the session.xml file. Include the directory location and the file name. This option is most useful when performing a local capture. For more information, see Capturing data on your target.

-v

Displays the version information for gatord.

Note

To unload the gator daemon, determine the process id of gatord using ps -d | grep gatord and enter the kill command: kill process_id.

By default, gatord uses port 8080 for communication with the host, but you can adjust this by launching gatord with the port number as a parameter and changing the Port option in the Capture Options dialog box. For example:

./gatord 5050 &

To open the Capture Options dialog box, click Change capture options in the ARM Streamline Data view.

Note

gatord requires the libstdc++.so.6 library. This file is usually supplied with the Linux distribution on your target. A copy of libstdc++.so.6 is available in the DS-5 Linux example distribution.

Was this page helpful? Yes No