You copied the Doc URL to your clipboard.

Creating filesystem and ftrace counters

gator supports 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 in the same location as the gatord makefile. 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 must rebuild gatord.