#include <revolution/gx.h>
void GXReadMemMetric( u32* cp_req,
u32* tc_req,
u32* cpu_rd_req,
u32* cpu_wr_req,
u32* dsp_req,
u32* io_req,
u32* vi_req,
u32* pe_req,
u32* rf_req,
u32* fi_req );
cp_req |
Returns a cp request counter value as a 32-bit unsigned integer. |
tc_req |
Returns a tc request counter value as a 32-bit unsigned integer. |
cpu_rd_req |
Returns a CPU read request counter value as a 32-bit unsigned integer. |
cpu_wr_req |
Returns a CPU write request counter value as a 32-bit unsigned integer. |
dsp_req |
Returns a dps request counter value as a 32-bit unsigned integer. |
io_req |
Returns an io request counter value as a 32-bit unsigned integer. |
vi_req |
Returns a vi request counter value as a 32-bit unsigned integer. |
pe_req |
Returns a pe request counter value as a 32-bit unsigned integer. |
rf_req |
Returns a rf request counter value as a 32-bit unsigned integer. |
fi_req |
Returns an fi request counter value as a 32-bit unsigned integer. |
None.
The graphics processor (GP) can count many internal events that give detailed information on performance. This function returns the number of memory requests made by each memory master. The counters can be cleared by calling GXClearMemMetric.
Note: This function can measure only access to internal memory (MEM1 region) of the system. It cannot measure access to external memory (MEM2 region).
u32 cp_req, tc_req, cpu_rd_req, cpu_wr_req, dsp_req, io_req, vi_req, pe_req;
u32 rf_req, fi_req;
GXClearMemMetric();
// Draw Object(s)
// wait until object drawn
GXSetDrawSync(0xbeef);
while (0xbeef != GXReadDrawSync())
;
metric = GXReadMemMetric(&cp_req,
&tc_req,
&cpu_rd_req,
&cpu_wr_req,
&dsp_req,
&io_req,
&vi_req,
&pe_req,
&rf_req,
&fi_req );
OSReport("Number command processor requests: %d\n", cp_req);
Each request results in a 32-byte transaction on the main memory bus.
cp_reqThe command processor (CP) is responsible for reading the graphics FIFO, reading display lists (GXCallDisplayList), and servicing vertex cache misses. This metric returns the number of memory read requests issued by the command processor.
tc_reqReturns the number of memory read requests issued by the texture cache (TC).
cpu_rd_reqReturns the number of memory read requests made by the CPU.
cp_wr_reqReturns the number of memory write requests made by the CPU.
dsp_reqReturns the number of memory requests made by the audio DSP.
io_reqReturns the number of memory requests made by IO devices.
vi_reqReturns the number of memory read requests made by the video interface (VI).
pe_reqReturns the number of memory write requests made by the pixel engine (PE). These include texture copies (GXCopyTex) and display copies (GXCopyDisp).
rf_reqReturns the number of memory refresh requests.
fi_reqReturns the number of forced idle (FI) requests, which are dummy requests required to switch the bus direction (read to write, or write to read).
GXReadPixMetric
GXClearPixMetric
GXSetVCacheMetric
GXReadVCacheMetric
GXClearVCacheMetric
GXSetGPMetric
GXReadGPMetric
GXClearGPMetric
2006/03/01 Initial version.