Extracting information from the call graph model
After you have built a call graph model of the application,
you can extract detailed information from it.
For routines and lines, you can extract the timing information
shown in Table 33-9 from
the ProfileRoutine and ProfileLine objects.
|
Property |
What it means |
|---|---|
|
AbsoluteSelfTime |
The time spent in the routine or line |
|
MinSelfTime |
The shortest time spent in the routine |
|
MaxSelfTime |
The longest time spent in the routine |
|
AbsoluteTotalTime |
The time spent in the routine or line |
|
MinTotalTime |
The shortest time spent in the routine |
|
MaxTotalTime |
The longest time spent in the routine |
|
PercentSelfTime |
AbsoluteSelfTime as a percentage of the |
|
PercentTotalTime |
AbsoluteTotalTime as a percentage of |
Example: extracting information from a call graph
model
The following function extracts information from a call graph
model about the routines called from a specific routine. You would
use similar functions to extract information about the routines
that called the given routine and about the routine itself.
The function takes a ProfileCall object and an index as arguments
and returns a structure containing the number of times the called
routine was executed and execution times for the called routine.
|
1 |
str_func_detail lstr_result<br>ProfileClass lproclass_class<br>ProfileRoutine lprort_routine<br> <br>// get the name of the called routine<br>// from the calledroutine property of<br>// the ProfileCall object passed to the function<br>lprort_routine = a_pcall.Calledroutine<br>lstr_result.Name = ""<br>lproclass_class = a_pcall.Class<br>IF isValid(lproclass_class) THEN &<br>   lstr_result.Name += lproclass_class.Name + "."<br>lstr_result.name += a_pcall.Name<br> <br>lstr_result.hits = a_pcall.HitCount<br>lstr_result.selfTime = a_pcall. &<br>   AbsoluteSelfTime * timeScale<br>lstr_result.totalTime = a_pcall. &<br>   AbsoluteTotalTime * timeScale<br>lstr_result.percentSelf = a_pcall.PercentSelfTime<br>lstr_result.percentTotal= a_pcall.PercentTotalTime<br>lstr_result.index = al_index<br> <br>RETURN lstr_result |