You copied the Doc URL to your clipboard.

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:


  1. Open the gator_events_mmapped.c example file in the editor of your choice.
  2. Copy the XML from the comments section of gator_events_mmapped.c.
  3. Create an XML file in the same directory as the gatord source code, and call it events-mmap.xml.
  4. Add the copied XML from the comments section of gator_events_mmapped.c to events-mmap.xml.
  5. Remove any * comment markers from the copied XML.
  6. Save events-mmap.xml.
  7. Rebuild gatord and copy it to the target.
  8. 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 gatord.
  9. 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.
  10. Add Sine to list of counters.
  11. 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

    Sine counter chart