Aussie AI
The pixie utility
-
Book Excerpt from "Generative AI in C++"
-
by David Spuler, Ph.D.
The pixie utility
The pixie
utility
can be used under Linux or UNIX to get more accurate counts on the number of times each
statement in a function is executed.
Where the prof
utility only produces estimates based on statistical sampling of the program
counter at regular intervals throughout the execution of the program,
pixie
measures the number of times each basic block is
executed.
A basic block is a sequence of code containing no branches.
The pixie
utility is applied to the already generated executable file. There is no
need to recompile the executable with the -p
option. The command for pixie
is simply:
pixie a.out
This will generate a new executable file, “a.out.pixie
”, which when executed will
generate a data file called “a.out.Counts
”. A data file of function addresses called
“a.out.Addrs
” is also generated. The next step is to run the new executable:
a.out.pixie
After execution, the count file can be examined using either prof
or pixstats
. One possible
command is:
pixstats a.out
The use of the prof command with the -pixie option is:
prof -pixie a.out
Both of these commands will generate a variety of information.
prof
with the “-pixie
” option will
generate an ordering of functions based on instruction cycle counts, another based on
invocations, and a list of instruction counts for each basic block.
pixstats
generates a
whole wealth of useful information including summaries of opcode distributions and
register usage.
For more information refer to the Linux manual entries for pixie
, pixstats
and prof
.
• Next: • Up: Table of Contents |
The new AI programming book by Aussie AI co-founders:
Get your copy from Amazon: Generative AI in C++ |