Intel IXP400 Frozen Dessert Maker User Manual


 
Intel
®
IXP400 Software
Access-Layer Components: Performance Profiling (IxPerfProfAcc) API
April 2005 IXP400 Software Version 2.0 Programmer’s Guide
256 Document Number: 252539, Revision: 007
2. To end the time sampling, call the stop function, with parameters:
This function can only be called once ixPerfProfAccXscalePmuTimeSampStart has been
called. It is the user’s responsibility to allocate the memory for the pointers before calling this
function. The user may then read/print the values stored in these pointers to obtain the results
of the time sampling process:
clkCount — Indicates the number of clock cycles that elapsed,
timeProfile — Contains the unique PC addresses and their occurence frequencies.
For example, if the user has declared a pointer “IxPerfProfAccXscalePmuEvtCnt clkCount”,
the user may then print out the value of the clock counter (which indicates the number of clock
cycles that elapsed) as shown below.
The following example shows how to process an array of
IxPerfProfAccXscalePmuSamplePcProfile:
If the user has declared a pointer to an array...
...the user may then print out the top five PC addresses in the time profile as follows:
i. Obtain the number of samples which were taken. For example:
ii. Determine the number of elements in the timeProfile array, which is the number of unique PC
addresses by adding up the elements in the array that contain results:
ixPerfProfAccXscalePmuTimeSampStop(
IxPerfProfAccXscalePmuEvtCnt *clkCount,
IxPerfProfAccXscalePmuSamplePcProfile *timeProfile)
Figure 87. Display Clock Counter
printf("\n Lower 32 bits of clock count: 0x%x", clkCount.lower32BitsEventCount);
printf("\n Upper 32 bits of clock count: 0x%x", clkCount.upper32BitsEventCount);
IxPerfProfAccXscalePmuSamplePcProfile
timeProfile[IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES],
clkSamples = clkCount.upper32BitsEventCount
UINT32 test_freq;
UINT32 frequency; /*total number of samples collected*/
UINT32 numPc = 0; /*number of unique PC addresses*/
for (frequency=0; frequency< =clkSamples;
frequency+=test_freq)
{
test_freq = timeProfile[numPc].freq;
numPc ++;
}