The pixie program adds profiling code to a program. It reads an
executable program, partitions it into basic blocks, and writes an
equivalent program containing additional code that counts the execution
of each basic block. ( A basic block is a region of the program that can
be entered only at the beginning and exited only at the end).
Pixie is invoked on an executable file as
pixie prog
where prog is a executable file from our running example.
After the above command is executed you should find an executable file in your directory called prog.pixie and a file called prog.Addrs.
When you run this new executable file prog.pixie like any other file, it will generate a file containing basic block counts. This file has the name of prog.Counts. This file will go as input to prof command which is explained next.
Having obtained the prog.Addrs and prog.Counts files which contain information on addresses of blocks and counts of the blocks respectively, by using pixie, we then use the prof utilty to analyze this profiling data and produce a listing. This listing typically gives information on how many times a given procedure is invoked, what is it's execution time, lines or procedures which did not execute and othe information used for optimization. The use of prof command is explained below using an example. For more details do a man prof.
Example:
cc -o myprog myprog.c /* generates executable called prog */ pixie -o myprog.pixie myprog /* generates myprog.Addrs */ myprog.pixie /* generates myprog.Counts */ prof -pixie myprog myprog.Addrs myprog.Counts > myprog.prof