Quantify simulates the time required to handle register window overflow and underflow conditions for SPARC processors. See "How Quantify times register-window traps" on page 3-15.
To control recording these simulated times, use the option -record-register-window-traps. For example:
You can find the cost in machine cycles that Quantify uses for each register-window underflow and overflow trap in the .machine.sunos4 or the .machine.solaris2 file in <quantifyhome>.
By default, -record-register-window-traps=no. Quantify reports the excluded register-window trap time only if it is a significant fraction of the combined recorded and excluded time for the entire run.
On machines such as HPPA which do not support register windows, Quantify ignores any attempts to time these operations and issues a warning message.
Quantify can collect function time information at different levels of detail, or granularity. As the level of detail increases, so does the cost of collecting the data. By default, Quantify determines the level of detail based on the type of code your compiler emits.
Quantify can collect data at the following levels of granularity:
Collection granularity |
Description |
Distinguishes counts for each function only | |
Distinguishes counts for each basic block | |
Distinguishes counts for each line |
You can use the -collection-granularity option to control the level of detail at which Quantify collects data. You can specify function, basic-block, or line.
You can use basic-block and line only if debugging information is available; that is, if you compile your application using the -g debugging option.
-collection-granularity=function
Quantify tracks the total machine cycles over each function call but does not record any data about machine cycles for basic blocks. This level of data collection incurs the least overhead, requiring about 1 machine cycle for each basic block. This is the detail that is displayed in the Function Detail window.
When you specify -collection-granularity=function, the Annotated Source window is not available.
If debugging information is not present, such as in third-party libraries and in optimized code, Quantify automatically instruments code at function granularity.
-collection-granularity=basic-block
This setting requires debugging information. Quantify tracks both the total machine cycles over each function call and the machine cycles executed in each basic block. Basic block data is used for the line annotations in the Annotated Source window.
This is the default if debugging information is available. -collection-granularity=line is identical to basic-block granularity, except that when a basic block extends over several lines of source code, Quantify inserts additional counters to record line-by-line counts. This improves readability of the data but at the expense of additional counting at run time.
Counting for basic blocks and lines is substantially slower than counting for function granularity, requiring approximately seven machine cycles per basic block or line counter. This is because Quantify must update both its function counter and each of the basic-block counters as it enters each basic block. Updating the basic-block counters requires updating a counter in memory.
The average cost of each basic block in normal code is 5 to 10 machine cycles. This means that, exclusive of function entry and exit overhead, Quantify's counting insertion in this case slows the function on average by a factor of two. This contrasts with function granularity which slows the same code by only about 20 percent.
To control the granularity of data collection without using the -collection-granularity option, you can:
Recompile your application without using the -g option so Quantify automatically collects data at function granularity.
Use strip -l to remove the line number information from certain files. Quantify then automatically collects data at function granularity.
To speed up data collection in an application compiled for debugging without recompiling the code, use the -force-rebuild option with the -collection-granularity option:
% quantify -force-rebuild \
-collection-granularity=function cc ...