PVRScopeStats#
PVRScopeStats is used to access the performance counters on PowerVR hardware via a driver library called PVRScopeServices.
This section contains several examples of using PVRScopeStats to perform various tasks, including the important two: reading and outputting counter data.
Initialising PVRScopeStats#
To initialise PVRScopeStats:
Include the PVRScope header file.
#include "PVRScopeStats.h"
Define the control structures.
// Defines
#define NO_GROUP_CHANGE 0xffffffff
// Internal control data
SPVRScopeImplData* PVRScopeStatsData;
// Counter information
SPVRScopeCounterDef* counterDefinitions;
unsigned int numCounters;
// Counter reading data
unsigned int activeGroup;
unsigned int selectedGroup;
bool activeGroupChanged;
SPVRScopeCounterReading counterReading;
Initialise communication with PVRScopeServices.
PVRScopeInitialise(PVRScopeStatsData);
Set up the counter data structures.
PVRScopeGetCounters(*PVRScopeStatsData,numCounters,counterDefinitions,counterReading);
Note
PVRScopeFindStandardCounter
is a function that makes setting up counter data structures more efficient. Rather than listing all the counters available, it presents an indexed list of common counters.
Shutting down PVRScopeStats#
To shutdown PVRScopeStats, call the shutdown functions as follows:
PVRScopeDeInitialise(*PVRScopeStatsData,*counterDefinitions,*counterReading);