Regis.Hoffman@fas.ri.cmu.edu (Regis Hoffman) (07/25/89)
I am looking for a way to count the number of instructions (especially floating point) executed in a program running under SUN OS (on a SUN 3/160). Apparently the way to do this is to use ptrace() (to enable process tracing), but the manual entry is not very clear. Can anyone answer these questions or even better, have a program to count instructions? - PTRACE_GETREGS returns the process' registers. Does the PC point to the instruction that caused the trace exception, or does it point to the exception handler that processes the trace? If the latter, then the stack must be examined to determine the PC of the instruction? - What is the difference between PTRACE_PEEKUSER and PTRACE_GETREGS in regard to obtaining the PC? Both appear to return register information. Any other thoughts/comments will be appreciated. Regis Hoffman (rmh@fas.ri.cmu.edu)