Using the gator_events_mmaped.c custom counters example
In the gator-driver.tar.gz archive distributed with your copy of Streamline is a gator source file called gator_events_mmaped.c. This file was provided as an example of how to add custom counters. Incorporating the simulated examples from gator_events_mmaped.c into gator is a good way to familiarize yourself with the process of adding your own counters.
NoteYou can locate all of the files provided by DS-5 by selecting HelpARM Extras... from the main menu.
To add a custom counter using gator_events_mmaped.c, follow these steps:
- Open the gator_events_mmaped.c sample file in the editor of your choice.
- Copy the xml from the comments section of gator_events_mmaped.c.
- 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.
- 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.
- Remove any * comment markers from the copied xml.
- Save events.xml.
Copy events.xml to your target. You must place it in the same
- Enter ./gatord & on the command line of your target to restart gatord.
- Open the Counter Configuration dialog using the button in the Streamline Data view. A new category, mmaped, appears in the Counter Configuration dialog box 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.
Figure 13-1 The Sine counter in the Timeline view