HP PAK Performance Analysis Tools User's Guide
Chapter 2 21
Puma Concepts
How Puma Analyzes Recursive Procedures
How Puma Analyzes Recursive
Procedures
When procedures in a program are recursive, the call structure at run
time (the dynamic call structure) can be more complex than the order of
procedure calls that is apparent before run time (the static call
structure). The Recursion Collapsing area of the Call Tree Analysis
window allows you to specify how you want Puma to collapse its
reporting of recursive routines.
Recursion Collapsing
A program with recursion can have a deceptively large call tree. Showing
the many paths to a given routine might give you more information than
you need while obscuring important patterns of recursion.
Suppose, for example, you have a routine named main that calls routine
r; routine r calls itself recursively to Level 3, and r also calls routine s.
If you got one sample from each of the possible stack traces, you would
have the following:
main r
main r s
main r r
mainrrs
mainrrr
mainrrrs
A hierarchical analysis (in text-mode) might look like this:
Samples Samples
In or Under In Only
Raw Count Raw Count Level
------------ --------- -----
6 0 1 main
612r
113s
413r
114s
214r
115s