6 Miscellaneous Programming Features

6.5 PC logging

Program counter (PC) logging provides a way of monitoring where your code is spending time. The PC-logging facility gives you three functions,start-pc-logging,stop-pc-logging, andsummarize-pc-logging. These enable you to start and stop a logging session, and to see the analyzed results.

PC logging works by taking an interrupt at regular intervals and noting the PC. It records the analysis in a log file that is not human-readable. The functionsummarize-pc-logging analyzes the log file, determines which code vector each PC belongs to, and then presents the results so that you can see the number of "hit counters" for each of your functions.

PC logging resembles backtrace logging in that you use it to get information about where your program is spending its time. However, PC logging is less intrusive than backtrace logging, which you may feel to be an advantage. The disadvantage of PC logging is that it returns less information than backtrace logging does, as PC logging asks, "What function is currently executing?" and backtrace logging asks, "What function is currently executing and what is the stack of function calls that is leading to this particular call?" Both techniques ask the program where it is, but backtrace logging goes on to ask how it got there.

The constructs that make up the PC-logging facility are extensions to Common Lisp.

6.5.1 - Reference pages

The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker