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 counters.
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.
NoteTo create your own counters, mimic the methods used in the gator_events_mmaped.c or any of the other gator_events_x files included with the gator source. You can locate all of the files provided by DS-5 by selecting Help > ARM Extras... from the main menu.
Follow these steps to ensure that gatord interacts with your custom source:
- Create an empty gator_events_your_custom.c file or duplicate gator_events_mmaped.c.
- Update the makefile to build the new gator_events_your_custom.c file.
- Add the preprocessor directive #include "gator.h" if you do not use gator_events_mmaped.c as a template.
- Include the gator_events_init macro.
Implement the following functions in your new source file:
gator_events_your_custom_start, gator_events_your_custom_read, and
All of your new counters must be added to the events list. You can accomplish
this in one of two ways:
- Add the list to the events.xml file, located in the
same directory as
- Create a new xml file in the same directory as the makefile before
building gatord. The makefile pulls in any file that begins with
events- so create a xml file called
gatordafter you create this new xml file.
- Add the list to the events.xml file, located in the same directory as