Using the gator_events_mmapped.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_mmapped.c. This file is provided as an example of how to add custom counters to code that uses kernel space gator.
Incorporating the simulated examples from gator_events_mmapped.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 Help > ARM Extras... from the main menu.
To add a custom counter using gator_events_mmapped.c, follow these steps:
- Open the gator_events_mmapped.c sample file in the editor of your choice.
- Copy the XML from the comments section of gator_events_mmapped.c.
Create a new XML file in the same directory as the
gatordsource code, and call it events-mmap.xml.
- Add the copied XML from the comments section of gator_events_mmapped.c to events-mmap.xml.
- Remove any * comment markers from the copied XML.
- Save events-mmap.xml.
gatordand copy it to the target.
Kill the old
gatordprocess if it is already running, then enter ./gatord & on the command line of your target to launch the newly built
Open the Counter Configuration dialog using the button
in the Streamline Data view.
A new category, mmapped, 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 12-1 The Sine counter in the Timeline view