Method and apparatus for dynamic instrumentation of an executable application
program. The application program includes a plurality of functions, each function
having an entry point and an endpoint. When the application is executed, a shared
memory segment is created for an instrumentation program and the application program.
Upon initial invocation of the original functions in the application program, corresponding
substitute functions are created in the shared memory segment, the substitute versions
including instrumentation code. Thereafter, the substitute functions are executed
in lieu of the original functions in the application program.