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 counters.
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
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.
Results: 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 Live and Timeline views.
Figure 12-1 Sine counter chart