IAS:
Program Tracing



By using the IAS tracing functionality, you can generate program traces for performance analysis and for debugging by creating a hook into every instruction execution and every memory read or write. For example, to help track down a complicated state of events that spans several instructions, you can code in hooks specific to that situation and incorporate them into IAS. Because the hooks are dynamically linked, you need not recompile IAS. All you have to provide is the code for some or all of of the four functions--init, finalize, memory read or write, and instruction execution.

As reference, see the template and sample implementation in:

tools/dsv/iam/src/libtrace.c
You can modify this template to put in your own checks or printfs, for example, then compile with the following command:
cc -G -o sample_libtrace.so.1 sample_libtrace.c
If you are using gcc, compile with this command:
gcc -fpic -shared -o sample_libtrace.so.1 sample_libtrace.c
and set the environment variable, as follows:
setenv PJSIM_TRACE_LIB sample_libtrace.so.1

IAS looks for PJSIM_TRACE_LIB; if it is set, it loads the functions from the libraries that you specified. The sample implementation is self-explanatory.

Note - For a memory write, IAS calls the trace function before completing the write.

IAS



Copyright © 1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303-4900 USA. All rights reserved.


Last modified 24-March-1999