Advanced Customizations 
ARM DUI 0482K Copyright © 2010-2012 ARM. All rights reserved. 11-4
ID120712 Non-Confidential
11.2 Creating custom performance counters
In addition to the hardware-specific and Linux performance counters that you can configure 
using the Counter Configuration dialog box, the gator daemon and driver provide hooks that 
enable you to customize the counters collected during a capture. 
Streamline derives its default set of counters from the performance monitoring unit, linux hooks, 
and memory-mapped peripherals. You can add your own counters to this list if there is a 
hardware metric that you want to track which Streamline does not provide by default.
11.2.1 The gator_events_mmaped.c example file
In the 
gator-driver.tar.gz
 archive distributed with your copy of Streamline is a gator source 
file called 
gator_events_mmaped.c
. The events contained in this file are not included in the 
events.xml
 file and do not appear in the list of available counters in the Counter Configuration 
dialog box. This file was provided as an example of how to add custom counters.
 You can locate all of the files provided by DS-5 by selecting Help → ARM Extras... from the 
main menu.
To familiarize yourself with the process of adding your own counters, incorporate the simulated 
examples from 
gator_events_mmaped.c
 into 
gator
.
To do so, follow these steps:
1. Open the 
gator_events_mmaped.c
 sample file in the editor of your choice.
2. Copy the xml from the comments section of 
gator_events_mmaped.c
.
3. Open 
events.xml
. This file is only available after you have built the gator daemon. If you 
built your gator daemon for a Linux target, it is located in the 
build_location/daemon-src
 
directory. If you built it for Android, it is located in the 
build_location/jni
 directory.
4. Add the copied xml from the comments section of 
gator_events_mmaped.c
 to events.xml, 
just after the closing tag of the Linux category. 
5. Remove any * comment markers from the copied xml.
6. Save 
events.xml
.
7. Copy 
events.xml
 to your target. You must place it in the same directory as 
gatord
.
8. Enter 
./gatord &
 on the command line of your target to restart 
gatord
.
9. Open the Counter Configuration dialog in Streamline. Note that a new category, 
mmaped, appears with the Sine, Triangle, and PWM simulated counters.
10. Add Sine to list of counters.
11. Run a capture session.
If successful, the waveform generated by the simulated Sine counter appears in the charts 
section of the Timeline view.