Intel® IXP400 Software

Access-Layer Components: Performance Profiling (IxPerfProfAcc) API

2. To end the time sampling, call the stop function, with parameters:

ixPerfProfAccXscalePmuTimeSampStop( IxPerfProfAccXscalePmuEvtCnt *clkCount, IxPerfProfAccXscalePmuSamplePcProfile *timeProfile)

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.

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);

The following example shows how to process an array of

IxPerfProfAccXscalePmuSamplePcProfile:

If the user has declared a pointer to an array...

IxPerfProfAccXscalePmuSamplePcProfile

timeProfile[IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES],

...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: clkSamples = clkCount.upper32BitsEventCount

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:

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 ++;

}

April 2005

IXP400 Software Version 2.0

Programmer’s Guide

256

Document Number: 252539, Revision: 007

 

Page 256
Image 256
Intel IXP400 manual Display Clock Counter