Custom Counter Groups in PVRTune Complete

When working with counters, it may be helpful to use user-defined counter groups. To create these, select Edit… from the Counter Table window, which opens the Custom Counter Groups dialog.



This dialog lists all the defined counter groups along with a set of options:

OptionEffect
NewCreates a new custom counter group without any counters.
CloneDuplicates the currently selected counter group.
RenameChanges the filename of the currently selected custom counter group.
DeleteRemoves the currently selected counter group.
EditAllows counters to be added to removed from the selected counter group.
Load DefaultLoads the default counter groups
LoadLoads saved counter groups
SaveSaves the selected custom counter group as a .pvrtunecg file.
CSV ImportIMport counter groups from a CSV file.
CSV ExportExport the current counter groups to a CSV file.
AcceptCloses the dialog with changes saved.
CancelCloses the dialog without saving any changes.

Counter groups are specific to hardware specifications - the Edit button will only work when a specific hardware series is selected in this dialog. If there is an active connection, or a recording opened in the GUI, then selecting the group name and clicking Edit or double-clicking the name will default to that hardware series (also highlighted in the top row with an asterisk).

Creating a Custom Counter Group with Pre-Defined Counters

  1. Select the Edit button which is found in the Counter Table window. This opens the Custom Counter groups dialog which lists all defined counter groups. Selecting New will create a new group, which can be populated by selecting Edit.

  2. Selecting Edit displays a list of available counters.



  3. Choose a suitable option from the list and then select Add Counter to Group. If needed, use the Filter Text field to get to the required items faster. The displayed information will automatically update to include the associated details.

    Note: As counters are being added to the counter group, the HW Block Capacity panel will start to fill up. The HW Block Capacity panel provides the number of sources available per hardware block to be used by the counter group. As soon as a block exceeds the number of sources it can support, this panel will display an error. The custom counter group will not be saved until the error is fixed.

  4. Select the Accept button to save the user-defined counter group.

  5. To remove a counter from the group, select it and then choose Remove.

Creating a Custom Counter Group with User-defined Counters

If a counter to add to a custom counter group is not available, it may be possible to create it by selecting New Counter in the Custom Counter Group window. This opens the Create New Counters dialog.



This dialog is split into multiple tabs, each one displaying an exhaustive list of counters for the different hardware blocks, which is dependent on the connected device. Information about these blocks and counters can be found in the relevant hardware reference manual. There is no capacity limit for reading global counters, which include counter sources such as memory bandwidth and data master information.

From these lists, a hardware counter source can be added to the Counter Sources Shortlist. The sources in the shortlist can be combined mathematically using an equation in the New Counter Equation box.

Counter sources can be inserted into this box by using the context menu and selecting Insert text. These sources can be combined using basic mathematical operations, including add (+), subtract (-), multiply (*), and divide (/), but a useful set of functions can also be used:

  • log2(<argument) finds the log to the base 2 of the argument;

  • max(<argument>,<argument>) returns the argument with the larger value;

  • total(<source-name>) calculates the total counter of a counter source of the profiling period;

  • mean(<source-name>) calculates the average value of the particular counter source;

  • cap(<capability-name>) is used to specify a capability of the hardware an application is running on, for example the number of pixels per tile.

The hardware capabilities that can be specified usingcap() in PVRTune are given below:

  • eCapUSSEPipes: Number of shader pipelines;

  • eCapISPPipes: Number of ISP pipelines;

  • eCapTATriPerclk: Triangles per clock of the tile accelerator (TA);

  • eCapISPTriPerClk: Triangles per clock of the ISP;

  • eCapPixelsPerTile: Number of pixels per tile;

  • eCapALUPipes: Number of ALU pipelines;

  • eCapPTE: Boolean which specifies whether Perfect Tiling Engine is available;

  • eCapISPPixelPerClk: Pixels per blcok of the ISP;

  • eCapMSAA2xFullRate: Boolean which specifies whether MSAA 2x at full rate is available;

  • eCapSLCBusWidth: Width of SLC bus in bytes;

  • eCapSLCBanks: Number of SLC banks.

More information on the PowerVR hardware can be found in the Introduction to PowerVR for Developers.

An example counter equation for Triangles input per second is demonstrated below:

((total(RGX1__TA:Triangles input(eRGX1_TA__PPP_PRIMITIVE))/total(TimeHostUS))*1000000.000000)

Four counters will be created when the counter sources are combined:

  • a raw counter;

  • one each for:

    • per clock

    • per frame

    • per second

Some global counter sources are absolute numbers rather than counters. For these, only the raw counter will be created.

To edit the counter source, select it and choose Modify Selected, which opens the HW Counter Source.

HW Counter Source Editor Dialog

This dialog can be used to create new or customise existing counter sources. It can be accessed by either selecting New... or Modify Selected... in the Create New Counters window. If the hardware has support for specifying batch ranges (such as PowerVR Series6XT) a batch range can be specified. Counters will only increment while batches (draw calls) in the minimum..maximum range are being processed. Check the hardware counter documentation to see which sources exist and which support the batch range control.

Note: The counters listed in the Global tab of the Create New Counters dialog cannot be modified.


The options for the dialog above are explained in the following table:

OptionEffect
NameChange the name of the hardware source.
Auto-nameThe default name for the hardware counter source,
BlockThe hardware counter blcok to use.
GroupCounters within blocks are arranged into groups.
Batch range: MinimumStart batch of specified range.
Batch range: MaximumEnd batch of specified range.
ModeSelect whether the chosen bits are read as a unary number (0x00f0 is 4) or a binary number (0x00f0 is 15 - there is an implied right bit shift to remove ignored bits).
Bit tableAfter choosing a block and a group, select the actual counter source(s) to count.