11.4 Using the gator_events_mmapped.c custom counters example
The file gator_events_mmapped.c is provided as an example of how to add custom counters to code that uses kernel space gator. It is located in the gator driver source code.
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
The gator driver source code is available from either of the following locations:
To add a custom counter using gator_events_mmapped.c, follow these steps:
Open the gator_events_mmapped.c
example file in the editor of your choice.
Copy the XML from the comments section of gator_events_mmapped.c.
Create an XML file in the same directory as the
gatord source code, and call it events-mmap.xml.
Add the copied XML from the comments section of gator_events_mmapped.c to
Remove any * comment markers from the copied XML.
gatord and copy it to the
Kill the old
gatord process 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
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 Live and Timeline views.
Figure 11-1 Sine counter chart