summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Medhurst2014-04-09 06:39:14 -0500
committerJon Medhurst2014-04-09 06:40:23 -0500
commit0f66ada81c8f90a7b2e4f7570032e33aaedfb32f (patch)
treec686b9fe25f272834766eba38b51cc7a97c69786 /README_Streamline.txt
parent33bef9ed7feca41e7cd6de8bf5d80052669278d3 (diff)
downloadarm-ds5-gator-0f66ada81c8f90a7b2e4f7570032e33aaedfb32f.tar.gz
arm-ds5-gator-0f66ada81c8f90a7b2e4f7570032e33aaedfb32f.tar.xz
arm-ds5-gator-0f66ada81c8f90a7b2e4f7570032e33aaedfb32f.zip
gator: Version 5.18DS-5.18
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'README_Streamline.txt')
-rwxr-xr-xREADME_Streamline.txt56
1 files changed, 45 insertions, 11 deletions
diff --git a/README_Streamline.txt b/README_Streamline.txt
index 744c33f..df3f923 100755
--- a/README_Streamline.txt
+++ b/README_Streamline.txt
@@ -2,18 +2,19 @@
2*** Purpose *** 2*** Purpose ***
3 3
4Instructions on setting up ARM Streamline on the target. 4Instructions on setting up ARM Streamline on the target.
5The gator driver and gator daemon are required to run on the ARM linux target in order for ARM Streamline to operate. 5The gator driver and gator daemon are required to run on the ARM Linux target in order for ARM Streamline to operate. A new early access feature allows the gator daemon can run without the gator driver by using userspace APIs with reduced functionality when using Linux 3.12 or later.
6The driver should be built as a module and the daemon must run with root permissions on the target. 6The driver should be built as a module and the daemon must run with root permissions on the target.
7 7
8*** Introduction *** 8*** Introduction ***
9 9
10A linux development environment with cross compiling tools is most likely required, depending on what is already created and provided. 10A Linux development environment with cross compiling tools is most likely required, depending on what is already created and provided.
11-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. 11-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.
12-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. 12-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.
13-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. 13-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.
14 -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. 14 -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.
15 -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. 15 -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.
16 -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. 16 -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.
17 -If the target is running Linux 3.12 or later the kernel driver is not required and userspace APIs will be used instead.
17 18
18*** Kernel configuration *** 19*** Kernel configuration ***
19 20
@@ -24,7 +25,7 @@ menuconfig options (depending on the kernel version, the location of these confi
24 - [*] Profiling Support (enables CONFIG_PROFILING) 25 - [*] Profiling Support (enables CONFIG_PROFILING)
25- Kernel Features 26- Kernel Features
26 - [*] High Resolution Timer Support (enables CONFIG_HIGH_RES_TIMERS) 27 - [*] High Resolution Timer Support (enables CONFIG_HIGH_RES_TIMERS)
27 - [*] Use local timer interrupts (only required for SMP, enables CONFIG_LOCAL_TIMERS) 28 - [*] Use local timer interrupts (only required for SMP and for version before Linux 3.12, enables CONFIG_LOCAL_TIMERS)
28 - [*] Enable hardware performance counter support for perf events (enables CONFIG_HW_PERF_EVENTS) 29 - [*] Enable hardware performance counter support for perf events (enables CONFIG_HW_PERF_EVENTS)
29- CPU Power Management 30- CPU Power Management
30 - CPU Frequency scaling 31 - CPU Frequency scaling
@@ -46,8 +47,10 @@ CONFIG_DEBUG_INFO (optional, used for analyzing the kernel)
46CONFIG_CPU_FREQ (optional, provides frequency setting of the CPU) 47CONFIG_CPU_FREQ (optional, provides frequency setting of the CPU)
47 48
48These 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 49These 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
49 > zcat /proc/config.gz | grep CONFIG_PROFILING 50 > zcat /proc/config.gz | grep CONFIG_PROFILING
50 CONFIG_PROFILING=y 51 CONFIG_PROFILING=y
52
53If a device tree is used it must include the pmu bindings, see Documentation/devicetree/bindings/arm/pmu.txt for details.
51 54
52*** Checking the gator requirements *** 55*** Checking the gator requirements ***
53 56
@@ -64,6 +67,17 @@ for example when using the linaro-toolchain-binaries
64 make -C /home/username/kernel_2.6.32/ M=`pwd` ARCH=arm CROSS_COMPILE=/home/username/gcc-linaro-arm-linux-gnueabihf-4.7-2013.01-20130125_linux/bin/arm-linux-gnueabihf- modules 67 make -C /home/username/kernel_2.6.32/ M=`pwd` ARCH=arm CROSS_COMPILE=/home/username/gcc-linaro-arm-linux-gnueabihf-4.7-2013.01-20130125_linux/bin/arm-linux-gnueabihf- modules
65If successful, a gator.ko module should be generated 68If successful, a gator.ko module should be generated
66 69
70It is also possible to integrate the gator.ko module into the kernel build system
71 cd /path/to/kernel/build/dir
72 cd drivers
73 mkdir gator
74 cp -r /path/to/gator/driver-src/* gator
75Edit Makefile in the kernel drivers folder and add this to the end
76 obj-$(CONFIG_GATOR) += gator/
77Edit Kconfig in the kernel drivers folder and add this before the last endmenu
78 source "drivers/gator/Kconfig"
79You can now select gator when using menuconfig while configuring the kernel and rebuild as directed
80
67*** Building the gator daemon *** 81*** Building the gator daemon ***
68 82
69cd /path/to/gator/daemon-src 83cd /path/to/gator/daemon-src
@@ -78,6 +92,9 @@ For Android targets (install the android ndk, see developer.android.com)
78 ndk-build 92 ndk-build
79 or execute /path/to/ndk/ndk-build if the ndk is not on your path 93 or execute /path/to/ndk/ndk-build if the ndk is not on your path
80 gatord should now be created and located in libs/armeabi 94 gatord should now be created and located in libs/armeabi
95 If you get an error like the following, upgrade to a more recent version of the android ndk
96 jni/PerfGroup.cpp: In function 'int sys_perf_event_open(perf_event_attr*, pid_t, int, int, long unsigned int)':
97 jni/PerfGroup.cpp:36:17: error: '__NR_perf_event_open' was not declared in this scope
81 98
82*** Running gator *** 99*** Running gator ***
83 100
@@ -88,6 +105,7 @@ gator.ko must be located in the same directory as gatord on the target or the lo
88With root privileges, run the daemon 105With root privileges, run the daemon
89 sudo ./gatord & 106 sudo ./gatord &
90Note: 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. 107Note: 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.
108If gator.ko is not loaded and is not in the same directory as gatord when using Linux 3.12 or later, gatord can run without gator.ko by using userspace APIs. Not all features are supported by userspace gator. If /dev/gator/version does not exist after starting gatord it is running userspace gator.
91 109
92*** Customizing the l2c-310 Counter *** 110*** Customizing the l2c-310 Counter ***
93 111
@@ -96,6 +114,10 @@ The l2c-310 counter in gator_events_l2c-310.c contains hard coded offsets where
96Further, the l2c-310 counter can be disabled by providing an offset of zero, ex: 114Further, the l2c-310 counter can be disabled by providing an offset of zero, ex:
97 insmod gator.ko l2c310_addr=0 115 insmod gator.ko l2c310_addr=0
98 116
117*** CCN-504 ***
118
119CCN-504 is disabled by default. To enable CCN-504, insmod gator module with the ccn504_addr=<addr> parameter where addr is the base address of the CCN-504 configuration register space (PERIPHBASE), ex: insmod gator.ko ccn504_addr=0x2E000000.
120
99*** Compiling an application or shared library *** 121*** Compiling an application or shared library ***
100 122
101Recommended compiler settings: 123Recommended compiler settings:
@@ -113,18 +135,31 @@ Attempting to run an incompatible binary often results in the confusing error me
113*** Bugs *** 135*** Bugs ***
114 136
115There is a bug in some Linux kernels where perf misidentifies the CPU type. To see if you are affected by this, run ls /sys/bus/event_source/devices/ and verify the listed processor type matches what is expected. For example, an A9 should show the following. 137There is a bug in some Linux kernels where perf misidentifies the CPU type. To see if you are affected by this, run ls /sys/bus/event_source/devices/ and verify the listed processor type matches what is expected. For example, an A9 should show the following.
116 138 # ls /sys/bus/event_source/devices/
117# ls /sys/bus/event_source/devices/ 139 ARMv7_Cortex_A9 breakpoint software tracepoint
118ARMv7_Cortex_A9 breakpoint software tracepoint
119
120To work around the issue try upgrading to a later kernel or comment out the gator_events_perf_pmu_cpu_init(gator_cpu, type); call in gator_events_perf_pmu.c 140To work around the issue try upgrading to a later kernel or comment out the gator_events_perf_pmu_cpu_init(gator_cpu, type); call in gator_events_perf_pmu.c
121 141
142There is a bug in some Linux kernels where an Oops may occurs when using userspace gator and a core is offlined. The fix was merged into mainline in 3.14-rc5, see http://git.kernel.org/tip/e3703f8cdfcf39c25c4338c3ad8e68891cca3731, and as been backported to older kernels.
143
144If you see this error when using SELinux, ex: Android 4.4 or later
145 # ./gatord
146 Unable to load (insmod) gator.ko driver:
147 >>> gator.ko must be built against the current kernel version & configuration
148 >>> See dmesg for more details
149 # dmesg
150 ...
151 <7>[ 6745.475110] SELinux: initialized (dev gatorfs, type gatorfs), not configured for labeling
152 <5>[ 6745.477434] type=1400 audit(1393005053.336:10): avc: denied { mount } for pid=1996 comm="gatord-main" name="/" dev="gatorfs" ino=8733 scontext=u:r:shell:s0 tcontext=u:object_r:unlabeled:s0 tclass=filesystem
153disable SELinux so that gatorfs can be mounted by running
154 # setenforce 0
155Once gator is started, SELinux can be reenabled
156
122*** Profiling the kernel (optional) *** 157*** Profiling the kernel (optional) ***
123 158
124CONFIG_DEBUG_INFO must be enabled, see "Kernel configuration" section above. 159CONFIG_DEBUG_INFO must be enabled, see "Kernel configuration" section above.
125Use vmlinux as the image for debug symbols in Streamline. 160Use vmlinux as the image for debug symbols in Streamline.
126Drivers may be profiled using this method by statically linking the driver into the kernel image or adding the driver as an image to Streamline. 161Drivers may be profiled using this method by statically linking the driver into the kernel image or adding the driver as an image to Streamline.
127To perform kernel stack unwinding and module unwinding, edit the Makefile to enable GATOR_KERNEL_STACK_UNWINDING and rebuild gator.ko. 162To perform kernel stack unwinding and module unwinding, edit the Makefile to enable GATOR_KERNEL_STACK_UNWINDING and rebuild gator.ko or run "echo 1 > /sys/module/gator/parameters/kernel_stack_unwinding" as root on the target after gatord is started.
128 163
129*** Automatically start gator on boot (optional) *** 164*** Automatically start gator on boot (optional) ***
130 165
@@ -137,4 +172,3 @@ update-rc.d rungator.sh defaults
137*** GPL License *** 172*** GPL License ***
138 173
139For license information, please see the file LICENSE after unzipping driver-src/gator-driver.tar.gz. 174For license information, please see the file LICENSE after unzipping driver-src/gator-driver.tar.gz.
140