You copied the Doc URL to your clipboard.

Creating filesystem and ftrace counters

gator has support for reading generic files based on entries in events XML files. This feature allows you to add counters to extract data held in files, for example, /dev, /sys or /proc file entries. You can use a similar technique to add counters for ftrace data.

To add filesystem counters, you first need to create an events-xxx.xml file. Ensure that for each entry in the file, the counter attribute values begin with filesystem_ and are unique. Use path attributes to specify the names and locations of the files to read. An example file called events-Filesystem.xml containing commented-out entries is provided with the gatord source code.

gator reads the files specified in your events-xxx.xml ten times per second. By default, it interprets each file as an integer, but if you provide a regular expression using the regex attribute, gator applies it and converts the matched entry to an integer.

gator also supports reading ftrace data, using a similar technique. In the events-xxx.xml file, ensure the counter attribute values begin with ftrace_ and are unique. You can specify regular expressions to extract counter values. For an example, see events-ftrace.xml located in the gator daemon source code.

After creating the events XML file, you can either:

  • Rebuild gatord. In this case, your events-xxx.xml file must be in the same location as the gatord makefile.

  • Restart gatord using the -E command-line option, specifying the location of your events-xxx.xml file. This appends your filesystem and ftrace counters to the existing events that gator supports and avoids the need to rebuild gatord. If you choose this method, you need to specify the XML header and include an events node in your events-xxx.xml file.


Some ftrace counters are available by default in the Counter Configuration dialog, if the target supports them.