A configuration.xml file defines the set of counters and their attributes that you want to collect from the target.
You normally configure counters using the Select Counters dialog box. From this dialog box, you can also export a configuration.xml file to use later in a headless workflow. If you have no network connection to your target, then you can manually create a configuration.xml file before running a capture session.
Note
Streamline defines a default set of counters. If this set is sufficient, you do not need to create a configuration.xml file.
Run gatord --print counters.xml <flags>, where <flags> is the flags that you will use when capturing.
This command lists all the counters that your target supports.
Example:
ARMv7_Cortex_A9_ccnt Linux_block_rq_wr Linux_power_cpu_freq
ARMv7_Cortex_A9_cnt0 Linux_cpu_wait_contention Linux_proc_statm_data
ARMv7_Cortex_A9_cnt1 Linux_cpu_wait_io Linux_proc_statm_share
ARMv7_Cortex_A9_cnt2 Linux_irq_irq Linux_proc_statm_size
ARMv7_Cortex_A9_cnt3 Linux_irq_softirq Linux_proc_statm_text
ARMv7_Cortex_A9_cnt4 Linux_meminfo_bufferram Linux_sched_switch
ARMv7_Cortex_A9_cnt5 Linux_meminfo_memfree mmapped_cnt0
L2C-310_cnt0 Linux_meminfo_memused mmapped_cnt1
L2C-310_cnt1 Linux_net_rx mmapped_cnt2
Linux_block_rq_rd Linux_net_tx
Counters whose name does not end in _cnt<n>, for example Linux_block_rq_rd, support a single event only. To find out which event these counters support, search for the counter name in the output of --print events.xml .
Example:
$ gatord --print events.xml
...
<event counter="Linux_block_rq_rd" title="Disk I/O" name="Read" units="B" description="Disk I/O Bytes Read"/>
...
This example shows that the Linux_block_rq_rd counter is the Disk I/O: Read event.
Counters whose name ends in _cnt<n> usually support more than one event. To find out which events these counters support, search for the counter set name in the output of --print events.xml .
Example:
$ gatord --print events.xml
...
<counter_set name="ARMv7_Cortex_A9_cnt" count="6"/>
<category name="Cortex-A9" counter_set="ARMv7_Cortex_A9_cnt" per_cpu="yes" supports_event_based_sampling="yes">
<event counter="ARMv7_Cortex_A9_ccnt" event="0xff" title="Clock" name="Cycles" display="hertz" units="Hz" average_selection="yes" average_cores="yes" description="The number of core clock cycles"/>
<event event="0x00" title="Software" name="Increment" description="Incremented only on writes to the Software Increment Register"/>
<event event="0x01" title="Cache" name="Instruction refill" description="Instruction fetch that causes a refill of at least the level of instruction or unified cache closest to the processor"/>
<event event="0x02" title="Cache" name="Inst TLB refill" description="Instruction fetch that causes a TLB refill of at least the level of TLB closest to the processor"/>
...
This example shows that the ARMv7_Cortex_A9_ccnt counter is the Clock: Cycles event. It also shows that the ARMv7_Cortex_A9_cnt<n> counters can be associated with many events, including Software: Increment, Cache: Instruction refill, and Cache: Inst TLB refill.
After following this step, you now know which events are available for your target.
Create an empty configuration.xml file. Copy and paste into it the counter and event (if any) attributes from the <event .../> nodes for the events you are interested in.
Example:
To add the Disk I/O: Read event, copy the required attributes from events.xml into your configuration.xml file, so it looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<configurations revision="3">
<configuration counter="Linux_block_rq_rd"/>
</configurations>
Note
The Linux_block_rq_rd counter does not have an event attribute.
To add another event, for example Clock: Cycles, copy its attributes into a new <configuration> node:
<?xml version="1.0" encoding="UTF-8"?>
<configurations revision="3">
<configuration counter="Linux_block_rq_rd"/>
<configuration counter="ARMv7_Cortex_A9_ccnt" event="0xff"/>
</configurations>
To add an event that does not have a counter attribute, for example Cache: Instruction refill, you must choose a counter value from the category for the event. For example, the category for the Cache: Instruction refill event uses counter_set="ARMv7_Cortex_A9_cnt". Therefore you can choose one of the unused ARMv7_Cortex_A9_cnt<n> counters to associate with the Cache: Instruction refill event, for example ARMv7_Cortex_A9_cnt0. Your configuration.xml file now looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<configurations revision="3">
<configuration counter="Linux_block_rq_rd"/>
<configuration counter="ARMv7_Cortex_A9_ccnt" event="0xff"/>
<configuration counter="ARMv7_Cortex_A9_cnt0" event="0x01"/>
</configurations>
Note
You can only associate each _cnt<n> counter with a single event at the same time, so you cannot include all possible events in this configuration.xml file.
You now have a configuration.xml file for a specific target to capture the events you are interested in.