You copied the Doc URL to your clipboard.

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.

Note

To 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:

Procedure

  1. Create an empty gator_events_your_custom.c file or duplicate gator_events_mmaped.c.
  2. Update the makefile to build the new gator_events_your_custom.c file.
  3. Add the preprocessor directive #include "gator.h" if you do not use gator_events_mmaped.c as a template.
  4. Include the gator_events_init macro.
  5. Implement the following functions in your new source file: gator_events_your_custom_init, gator_events_your_custom_interface, gator_events_your_custom_create_files, gator_events_your_custom_start, gator_events_your_custom_read, and gator_events_your_custom_stop.
  6. 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 gatord.
    • 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 events-YourCustom.xml. Re-build gatord after you create this new xml file.
Was this page helpful? Yes No