aboutsummaryrefslogtreecommitdiff
path: root/README_Streamline.txt
diff options
context:
space:
mode:
authorDrew Richardson <drew.richardson@arm.com>2012-10-13 12:00:00 -0700
committerDrew Richardson <drew.richardson@arm.com>2014-12-19 15:31:23 -0800
commitb04e8aefeed42f23955e88c7aa1611e49bdf5909 (patch)
treeeeee0f97880889c93457dfe96bdc96e487864506 /README_Streamline.txt
parent5f9955b9c65967a7a62f7860295d8ac187c9ec11 (diff)
gator: Version 5.125.12
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Diffstat (limited to 'README_Streamline.txt')
-rw-r--r--README_Streamline.txt68
1 files changed, 38 insertions, 30 deletions
diff --git a/README_Streamline.txt b/README_Streamline.txt
index c39b34c..f8309e1 100644
--- a/README_Streamline.txt
+++ b/README_Streamline.txt
@@ -9,37 +9,47 @@ The driver should be built as a module and the daemon must run with root permiss
A linux development environment with cross compiling tools is most likely required, depending on what is already created and provided.
-For users, the ideal environment is to be given a BSP with gatord and gator.ko already running on a properly configured kernel. In such a scenario, a development environment is not needed, root permission may or may not be needed (gatord must be executed with root permissions but can be automatically started, see below), and the user can run Streamline and profile the system without any setup.
--The ideal development environment has the kernel source code available to be rebuilt and executed on the target. This environment allows the greatest flexibility in configuring the kernel and building the gator driver module.
+-The ideal development environment has the kernel source code available to be rebuilt, usually by cross-compiling on a host machine. This environment allows the greatest flexibility in configuring the kernel and building the gator driver module.
-However, it is possible that a user/developer has a kernel but does not have the source code. In this scenario it may or may not be possible to obtain a valid profile.
- -First, check if the kernel has the proper configuration options (see below). Profiling cannot occur using a kernel that is not configured properly, a new kernel must be created.
- -Second, given a properly configured kernel, check if the filesystem contains the kernel source/headers, which can be used to re-create the gator driver.
+ -First, check if the kernel has the proper configuration options (see below). Profiling cannot occur using a kernel that is not configured properly, a new kernel must be created. See if /proc/config.gz exists on the target.
+ -Second, given a properly configured kernel, check if the filesystem contains the kernel source/headers, which can be used to re-create the gator driver. These files may be located in different areas, but common locations are /lib/modules/ and /usr/src.
-If the kernel is not properly configured or sources/headers are not available, the developer is on their own and kernel creation is beyond the scope of this document. Note: It is possible for a module to work when compiled against a similar kernel source code, though this is not guaranteed to work due to differences in kernel structures, exported symbols and incompatible configuration parameters.
-*** Preparing and building the kernel ***
+*** Kernel configuration ***
-cd into the root source dir of the linux kernel
-if your target has never been configured, choose the appropriate configuration for your target
- make ARCH=arm CROSS_COMPILE=${CROSS_TOOLS}/bin/arm-none-linux-gnueabi- <platform_defconfig>
-make ARCH=arm CROSS_COMPILE=${CROSS_TOOLS}/bin/arm-none-linux-gnueabi- menuconfig
-
-Required Kernel Changes (depending on the kernel version, the location of these configuration settings within menuconfig may be different)
+menuconfig options (depending on the kernel version, the location of these configuration settings within menuconfig may differ)
- General Setup
- - [*] Profiling Support
+ - Kernel Performance Events And Counters
+ - [*] Kernel performance events and counters (enables CONFIG_PERF_EVENTS)
+ - [*] Profiling Support (enables CONFIG_PROFILING)
+- Kernel Features
+ - [*] High Resolution Timer Support (enables CONFIG_HIGH_RES_TIMERS)
+ - [*] Use local timer interrupts (only required for SMP, enables CONFIG_LOCAL_TIMERS)
+ - [*] Enable hardware performance counter support for perf events (enables CONFIG_HW_PERF_EVENTS)
+- CPU Power Management
+ - CPU Frequency scaling
+ - [*] CPU Frequency scaling (enables CONFIG_CPU_FREQ)
- Kernel hacking
+ - [*] Mutex debugging: basic checks (optional, enables CONFIG_DEBUG_MUTEXES)
+ - [*] Compile the kernel with debug info (optional, enables CONFIG_DEBUG_INFO)
- [*] Tracers
- - [*] Trace process context switches and events
-- Kernel Features
- - [*] High Resolution Timer Support
- - [*] Use local timer interrupts (only required for SMP)
+ - [*] Trace process context switches and events (#)
-The "context switches and events" option will not be available if other trace configurations are enabled. Other trace configurations being enabled is sufficient to turn on context switches and events.
+(#) The "Trace process context switches and events" is not the only option that enables tracing (CONFIG_GENERIC_TRACER or CONFIG_TRACING) and may not be visible in menuconfig as an option if other trace configurations are enabled. Other trace configurations being enabled is sufficient to turn on tracing.
-Optional Kernel Changes (depending on the kernel version, the location of these configuration settings within menuconfig may be different)
-Note: Configurations may not be supported on all targets
-- System Type
- - [*] <SoC name> debugging peripherals (enable core performance counters on supported SoCs) /* kernels before 2.6.35 */
+The configuration options:
+CONFIG_GENERIC_TRACER or CONFIG_TRACING
+CONFIG_PROFILING
+CONFIG_HIGH_RES_TIMERS
+CONFIG_LOCAL_TIMERS (for SMP systems)
+CONFIG_PERF_EVENTS and CONFIG_HW_PERF_EVENTS (kernel versions 3.0 and greater)
+CONFIG_DEBUG_MUTEXES (optional, provides 'mutex' as a reason code when a thread stops running)
+CONFIG_DEBUG_INFO (optional, used for analyzing the kernel)
+CONFIG_CPU_FREQ (optional, provides frequency setting of the CPU)
-make -j5 ARCH=arm CROSS_COMPILE=${CROSS_TOOLS}/bin/arm-none-linux-gnueabi- uImage
+These may be verified on a running system using /proc/config.gz (if this file exists) by running 'zcat /proc/config.gz | grep <option>'. For example, confirming that CONFIG_PROFILING is enabled
+ > zcat /proc/config.gz | grep CONFIG_PROFILING
+ CONFIG_PROFILING=y
*** Checking the gator requirements ***
@@ -53,7 +63,7 @@ To create the gator.ko module,
cd gator-driver
make -C <kernel_build_dir> M=`pwd` ARCH=arm CROSS_COMPILE=<...> modules
for example
- make -C /home/username/kernel_2.6.32/ M=`pwd` ARCH=arm CROSS_COMPILE=/home/username/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- modules
+ make -C /home/username/kernel_2.6.32/ M=`pwd` ARCH=arm CROSS_COMPILE=/usr/local/DS-5/bin/arm-linux-gnueabihf- modules
If successful, a gator.ko module should be generated
*** Building the gator daemon ***
@@ -75,7 +85,7 @@ For Android targets (install the android ndk, see developer.android.com)
Load the kernel onto the target and copy gatord and gator.ko into the target's filesystem.
Ensure gatord has execute permissions
chmod +x gatord
-gator.ko must be located in the same directory as gatord on the target or the location specified with the -m option.
+gator.ko must be located in the same directory as gatord on the target or the location specified with the -m option or already insmod'ed.
With root privileges, run the daemon
sudo ./gatord &
Note: gatord requires libstdc++.so.6 which is usually supplied by the Linux distribution on the target. A copy of libstdc++.so.6 is available in the DS-5 Linux example distribution.
@@ -85,7 +95,8 @@ Note: gatord requires libstdc++.so.6 which is usually supplied by the Linux dist
Recommended compiler settings:
"-g": Debug symbols needed for best analysis results.
"-fno-inline": Speed improvement when processing the image files and most accurate analysis results.
- "-fno-omit-frame-pointer": ARM EABI frame pointers (Code Sourcery cross compiler) allow the call stack to be recorded with each sample taken when in ARM state (i.e. not -mthumb).
+ "-fno-omit-frame-pointer": ARM EABI frame pointers (Code Sourcery cross compiler) allow recording of the call stack with each sample taken when in ARM state (i.e. not -mthumb).
+ "-marm": This option is required if your compiler is configured with --with-mode=thumb, otherwise call stack unwinding will not work.
*** Hardfloat EABI ***
Binary applications built for the soft or softfp ABI are not compatible on a hardfloat system. All soft/softfp applications need to be rebuilt for hardfloat. The included compiler with DS-5 supports hardfloat.
@@ -94,13 +105,9 @@ Attempting to run an incompatible binary often results in the confusing error me
*** Profiling the kernel (optional) ***
-make ARCH=arm CROSS_COMPILE=$(CROSS_TOOLS}/bin/arm-none-linux-gnueabi- menuconfig
-- Kernel Hacking
- - [*] Compile the kernel with debug info
-
-make -j5 ARCH=arm CROSS_COMPILE=${CROSS_TOOLS}/bin/arm-none-linux-gnueabi- uImage
+CONFIG_DEBUG_INFO must be enabled, see "Kernel configuration" section above.
Use vmlinux as the image for debug symbols in Streamline.
-Drivers may be profiled using this method by statically linking the driver into the kernel image or adding the module as an image.
+Drivers may be profiled using this method by statically linking the driver into the kernel image or adding the driver as an image to Streamline.
To perform kernel stack unwinding and module unwinding, edit the Makefile to enable GATOR_KERNEL_STACK_UNWINDING and rebuild gator.ko.
*** Automatically start gator on boot (optional) ***
@@ -114,3 +121,4 @@ update-rc.d rungator.sh defaults
*** GPL License ***
For license information, please see the file LICENSE after unzipping driver-src/gator-driver.tar.gz.
+