Advanced Customizations
ARM DUI 0482K
Copyright © 2010-2012 ARM. All rights reserved.
11-5
ID120712
Non-Confidential
Figure 11-1 The Sine counter in the Timeline view
11.2.2
Creating your own counters
To create your own counters, mimic the methods used in the
gator_events_mmaped.c
or any of
the other
gator_events_
x
files included with the gator source.
Make sure to do the following to ensure that gatord interacts with your custom source:
1.
Create an empty
gator_events_
your_custom
.c
file or duplicate
gator_events_mmaped.c
.
2.
Update the
makefile
to build the new
gator_events_
your_custom
.c
file.
3.
Add the preprocessor directive
#include "gator.h"
if you do not use
gator_events_mmaped.c
as a template.
4.
Include the
gator_events_init
macro.
5.
Implement the following functions in your new source file:
gator_events_
your_custom
_init
,
gator_events_
your_custom
_interface
,
gator_events_
your_custom
_create_files
,
gator_events_
your_custom
_start
,
gator_events_
your_custom
_read
, and
gator_events_
your_custom
_stop
.
6.
All of your new counters must be added to the events list. You can accomplish this in one
of two ways:
•
Add the list to the
events.sml
file, located in the same directory as
gatord
.
•
Create a new xml file in the same directory as the makefile before building
gatord
.
The makefile pulls in any file that begins with
events-
so create a xml file called
events-
YourCustom
.xml
. Re-build
gatord
after you create this new xml file.