Browse Prior Art Database

Time-Sampling Scheme to Trace Through User Programs Using Ptrace Unix Command

IP.com Disclosure Number: IPCOM000120746D
Original Publication Date: 1991-Jun-01
Included in the Prior Art Database: 2005-Apr-02
Document File: 2 page(s) / 52K

Publishing Venue

IBM

Related People

Kau, CC: AUTHOR [+2]

Abstract

Time-sampling tracing scheme is developed in this invention to trace through any user programs efficiently and collect a controllable amount of traces. Instead of tracing every executed instruction in a program, with the time-sampling scheme the tracer can trace a program for a number of instructions using a conventional tracing scheme and then let the program run freely for a certain period of time without collecting any traces. The tracer can repeat the process of tracing and free running to trace through the whole user program efficiently and collect traces in every execution phase of the program.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 99% of the total text.

Time-Sampling Scheme to Trace Through User Programs Using Ptrace
Unix Command

      Time-sampling tracing scheme is developed in this
invention to trace through any user programs efficiently and collect
a controllable amount of traces.  Instead of tracing every executed
instruction in a program, with the time-sampling scheme the tracer
can trace a program for a number of instructions using a conventional
tracing scheme and then let the program run freely for a certain
period of time without collecting any traces.  The tracer can repeat
the process of tracing and free running to trace through the whole
user program efficiently and collect traces in every execution phase
of the program.

      The tracer uses Ptrace, a UNIX* command, to start/resume user
program execution, set breakpoints and record instruction traces.
Also, the tracer exploits some other features of Ptrace to implement
the time-sampling mechanism which are (1) when a user program is
running in traced mode under Ptrace, it will stop running whenever it
receives a signal from the tracer, (2) the user program can resume
its execution when it receives a Ptrace (continue) command issued by
the tracer.  Besides Ptrace, another UNIX system service called
Usleep is used in the tracer to measure user program execution time
in a resolution of microseconds.  With these UNIX system services a
time-sampling tracing algorithm is implemented and the flow chart is
shown in the figure.
*  Trademark of AT&T Bell ...