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.
gator-driver.tar.gz archive distributed
with your copy of Streamline is a gator source file called
The events contained in this file are not included in the
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
To do so, follow these steps:
gator_events_mmaped.csample file in the editor of your choice.
Copy the xml from the comments section of
events.xml, located in the
Add the copied xml from the comments section of
gator_events_mmaped.cto events.xml, just after the closing tag of the Linux category.
Remove any * comment markers from the copied xml.
events.xmlto your target.
Enter ./gatord & on the command line of your target to restart
Open the Counter Configuration dialog in Streamline. Note that a new category, mmaped, appears with the Sine, Triangle, and PWM simulated counters.
Add Sine to list of counters.
Run a capture session.
If successful, the waveform generated by the simulated Sine counter appears in the charts section of the Timeline view.
To create your own counters, mimic the methods used in the
any of the other
included with the gator source.
Make sure to do the following to ensure that gatord interacts with your custom source:
Create an empty
gator_events_file or duplicate
makefileto build the new
Add the preprocessor directive
#include "gator.h"if you do not use
gator_events_mmaped.cas a template.
Implement the following functions in your new source file:
All of your new counters must be added to the
Here is a brief description of each of the gator event functions:
gatorcalls this function startup.
Tells gator what triggers calls to your custom events file.
Adds custom directories and enabled, event, and key files to
gatorcalls this at the start or execution.
gatorcalls this function at every sample.
gatorcalls this at the termination of a capture session.
Use the following attributes in the counter elements in your
The identifier of the counter resource.
Architecture specific or implementation-specific event number, in decimal, determined from either the architecture specification document or the Technical Reference Manual of the processor.
The title of the chart that Streamline displays. Counters with matching titles stack in the charts.
The name that Streamline displays.
Defines whether or not Streamline collects data on a per cpu basis. Set this value to yes and Streamline collects data from each cpu separately for this counter.
To get L2C-310 memory-mapped peripherals working with Streamline, do the following:
gator_events_l2c-310.cfile located in the archive in
Add the following
#ifstatement to the existing
#ifstatements in the
with the name of your architecture and
with the physical address of your L2C-310 in hexadecimal.
Rebuild the gator driver.
Connect to your target.