Tuesday, November 15, 2011

Chapter 14 - Program Profilers

Program Profilers

Profiling allows you to know where your program used time and what functions (and together with other functions) were enabled during its execution creating knowledge of the parts of the program that are slower than expected and may need to be rewritten for better efficiency.   It can also tell you which functions are being accessed more or less often than you expected which will pinpoint bugs that would have been overlooked otherwise.  The profiler uses information discovered  during the actual execution of the program;  it can be used on programs that are too large/complex to analyze by reading the source but how your program is run will affect the information that shows up in the profile data and will omit information for that feature.(1)

The three program profiler tools discussed in this writing use static instrumentation of programs to monitor dynamic behavior, but are different in certain ways.

 Gprof,  the most limited of the three; it is only capable of producing a call graph, and is language dependent but it is easier to use than the others, and is portable across CPU architectures and OSs.

ATOM and Etch are more flexible - users define their own instrumentation code and are not limited to a single function and are both language independent but unlike Gprof, they work at the binary level (confined to a particular OS/architecture). If only the final binary executable is used, then Etch is the only tool of the three of use. Though static instrumentation of individual binaries are powerful profile tools in runtime behavior it is limited and the other layers of the system, (operating system and hardware), effect program execution greatly.  Events (scheduling, cache misses, interrupt handling, etc.) can cause  poor system performance, but  need code in the OS itself to be determined, or with hardware monitoring.(2)


(1) <http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html#SEC1>. Web. 15 Nov.  2011.
(2) <http://www.cs.wustl.edu/~jain/cse567-06/ftp/sw_monitors2.pdf>. Web. 15 Nov. 2011.

No comments:

Post a Comment