From 7ca6004c0b05138c49b9b21e0045487f55a60ab6 Mon Sep 17 00:00:00 2001 From: Drew Richardson Date: Wed, 22 Jul 2015 12:00:00 -0700 Subject: gator: Version 5.22 Signed-off-by: Drew Richardson --- README.md | 298 +++++++++++ README_Streamline.txt | 250 --------- daemon/Android.mk | 3 +- daemon/AtraceDriver.cpp | 136 +++++ daemon/AtraceDriver.h | 39 ++ daemon/Buffer.cpp | 16 +- daemon/Buffer.h | 3 +- daemon/CCNDriver.cpp | 41 +- daemon/CCNDriver.h | 2 + daemon/CapturedXML.cpp | 2 +- daemon/Child.cpp | 50 +- daemon/Command.cpp | 69 ++- daemon/Config.h | 7 + daemon/ConfigurationXML.cpp | 15 +- daemon/DiskIODriver.cpp | 2 +- daemon/DriverSource.cpp | 56 +- daemon/DriverSource.h | 1 + daemon/EventsXML.cpp | 4 +- daemon/ExternalDriver.cpp | 269 ++++++++++ daemon/ExternalDriver.h | 41 ++ daemon/ExternalSource.cpp | 84 ++- daemon/ExternalSource.h | 3 + daemon/FtraceDriver.cpp | 115 ++--- daemon/FtraceDriver.h | 5 +- daemon/FtraceSource.cpp | 188 ------- daemon/FtraceSource.h | 43 -- daemon/MaliVideoDriver.cpp | 28 +- daemon/MaliVideoDriver.h | 1 + daemon/MemInfoDriver.cpp | 2 +- daemon/NetDriver.cpp | 2 +- daemon/PerfDriver.cpp | 184 +++++-- daemon/PerfDriver.h | 8 +- daemon/PerfGroup.cpp | 15 +- daemon/PerfSource.cpp | 29 +- daemon/Proc.cpp | 9 +- daemon/Sender.cpp | 22 +- daemon/SessionData.cpp | 108 +++- daemon/SessionData.h | 44 +- daemon/Setup.cpp | 36 +- daemon/StreamlineSetup.cpp | 10 +- daemon/UserSpaceSource.cpp | 10 +- daemon/defaults.xml | 30 +- daemon/events-CCI-400.xml | 6 +- daemon/events-Cortex-A53.xml | 6 +- daemon/events-Cortex-A57.xml | 6 +- daemon/events-Cortex-A72.xml | 6 +- daemon/events-Mali-4xx.xml | 11 + daemon/events-Mali-Midgard_hw.xml | 4 +- daemon/events-Mali-T82x_hw.xml | 216 ++++---- daemon/events-Mali-V500.xml | 4 +- daemon/events-atrace.xml | 19 + daemon/events-ftrace.xml | 20 +- daemon/k/perf_event.3.12.h | 792 ---------------------------- daemon/k/perf_event.h | 793 ++++++++++++++++++++++++++++- daemon/main.cpp | 31 +- daemon/notify/COPYING | 339 ++++++++++++ daemon/notify/Makefile | 24 + daemon/notify/Notify.java | 31 ++ driver/Makefile | 2 +- driver/gator.h | 12 +- driver/gator_cookies.c | 110 +++- driver/gator_events_armv6.c | 1 + driver/gator_events_armv7.c | 1 + driver/gator_events_block.c | 1 + driver/gator_events_irq.c | 1 + driver/gator_events_l2c-310.c | 1 + driver/gator_events_mali_4xx.c | 40 +- driver/gator_events_mali_common.c | 10 +- driver/gator_events_mali_midgard.c | 23 +- driver/gator_events_mali_midgard_hw.c | 121 ++--- driver/gator_events_mali_midgard_hw_test.c | 43 -- driver/gator_events_meminfo.c | 7 +- driver/gator_events_mmapped.c | 1 + driver/gator_events_net.c | 7 +- driver/gator_events_perf_pmu.c | 17 +- driver/gator_events_sched.c | 1 + driver/gator_events_scorpion.c | 1 + driver/gator_fs.c | 2 +- driver/gator_hrtimer_gator.c | 8 +- driver/gator_main.c | 26 +- driver/gator_marshaling.c | 4 + driver/gator_trace_gpu.c | 2 +- driver/gator_trace_sched.c | 8 +- driver/mali_midgard.mk | 3 +- 84 files changed, 3061 insertions(+), 1980 deletions(-) create mode 100755 README.md delete mode 100644 README_Streamline.txt create mode 100644 daemon/AtraceDriver.cpp create mode 100644 daemon/AtraceDriver.h create mode 100644 daemon/ExternalDriver.cpp create mode 100644 daemon/ExternalDriver.h delete mode 100644 daemon/FtraceSource.cpp delete mode 100644 daemon/FtraceSource.h create mode 100644 daemon/events-atrace.xml delete mode 100644 daemon/k/perf_event.3.12.h mode change 120000 => 100644 daemon/k/perf_event.h create mode 100644 daemon/notify/COPYING create mode 100644 daemon/notify/Makefile create mode 100644 daemon/notify/Notify.java diff --git a/README.md b/README.md new file mode 100755 index 0000000..8e55b1e --- /dev/null +++ b/README.md @@ -0,0 +1,298 @@ + +## Purpose + +Instructions on setting up ARM Streamline on the target. + +A target agent (gator) is required to run on the ARM Linux target in order for ARM Streamline to operate. Gator may run in kernel space or user space mode, though user space gator requires Linux 3.4 or later and contains reduced functionality. Furthermore, user space gator is a beta release, see the bugs section in this readme for a list of known issues. + +The driver should be built as a module and the daemon must run with root permissions on the target. + +## Introduction + +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, 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. 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. + - If the target is running Linux 3.4 or later the kernel driver is not required and userspace APIs will be used instead. + +## Kernel configuration + +menuconfig options (depending on the kernel version, the location of these configuration settings within menuconfig may differ) +- General Setup + - Kernel Performance Events And Counters + - [*] Kernel performance events and counters (enables CONFIG_PERF_EVENTS) + - [*] Profiling Support (enables CONFIG_PROFILING) +- [*] Enable loadable module support (enables CONFIG_MODULES, needed unless the gator driver is built into the kernel) + - [*] Module unloading (enables MODULE_UNLOAD) +- Kernel Features + - [*] High Resolution Timer Support (enables CONFIG_HIGH_RES_TIMERS) + - [*] Use local timer interrupts (only required for SMP and for version before Linux 3.12, 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) +- Device Drivers + - Graphics support + - ARM GPU Configuration + - Mali Midgard series support + - [*] Streamline Debug support (enables CONFIG_MALI_GATOR_SUPPORT needed as part of Mali Midgard support) +- Kernel hacking + - [*] Compile the kernel with debug info (optional, enables CONFIG_DEBUG_INFO) + - [*] Tracers + - [*] Trace process 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 as well as CONFIG_CONTEXT_SWITCH_TRACER) 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. + +The configuration options: +- CONFIG_MODULES and MODULE_UNLOAD (not needed if the gator driver is built into the kernel) +- CONFIG_GENERIC_TRACER or CONFIG_TRACING +- CONFIG_CONTEXT_SWITCH_TRACER +- CONFIG_PROFILING +- CONFIG_HIGH_RES_TIMERS +- CONFIG_LOCAL_TIMERS (for SMP systems and kernel versions before 3.12) +- CONFIG_PERF_EVENTS and CONFIG_HW_PERF_EVENTS (kernel versions 3.0 and greater) +- CONFIG_DEBUG_INFO (optional, used for analyzing the kernel) +- CONFIG_CPU_FREQ (optional, provides frequency setting of the CPU) +- CONFIG_MALI_GATOR_SUPPORT (needed as part of Mali Midgard support) + +These may be verified on a running system using `/proc/config.gz` (if this file exists) by running `zcat /proc/config.gz | grep