Adding support to gatord for a new CPU or perf PMU
Use either of the following ways to add support for a new CPU or perf PMU to
gatord. The information in this topic applies to gator version 23 and later.
- Perf support in Linux for the PMU is required because
gatorduses perf to read the hardware counters.
- Check the perf PMUs supported by your kernel by running
cnnare listed, then A
xx, CCI-400, or CNN respectively are supported.
- Only XML changes are required, no code changes are necessary.
gatordafter the XML changes is recommended but not required because you can pass PMUs and events to
gatordon the command line.
Make the following changes, then rebuild
Add a line to
DS_install_directory/sw/streamline/gator/daemon/pmus.xml describing the new PMU. For CPUs, the following information is required:
- The CPU Implementer and Primary part number from the Main ID Register.
- The number of generic hardware counters that can be selected simultaneously.
- Optionally, set the perf PMU name of the CPU to ensure correct operation in multi-PMU Arm® big.LITTLE™ configurations.
Create an events XML file, named events-
xxx.xml in the gator daemon source directory that defines the events that the new PMU generates. This file should exclude the XML header and
<events>element. See the Cortex®‑A15 events XML file,
DS_install_directory/sw/streamline/gator/daemon/events-Cortex-A15.xml for an example.
Alternatively, to add support without having to rebuild
gatord, do the following:
Create an events XML file that defines the events that the new PMU generates. This file must include the XML header and
<events>element, for example:
<?xml version="1.0" encoding="UTF-8"?> <events> <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"/> <!-- ... --> </category> </events>
Create an XML file that defines information about the new PMU. For the required format, see the gator pmus.xml. For example:
<?xml version="1.0" encoding="UTF-8"?> <pmus> <pmu pmnc_name="ARMv7_Cortex_A9" cpuid="0x41c09" core_name="Cortex-A9" pmnc_counters="6"/> </pmus>
Copy these files to the target and restart
gatordusing the following flags:
-Eto specify the location of the events XML file. This flag causes the events to be appended to the list of events that
-Pto specify the location of the PMU XML file. This option causes the new PMU to be added to the list of PMUs defined in pmus.xml that
gatordhas built-in support for.