Non-invasive trace-driven system and method for computer system profiling
First Claim
1. In a computer system having an operating system kernel in a program executing multiple processes, a method for use during execution of said multiple processes in profiling said multiple processes, comprising:
- inserting with said system a trace hook mechanism in a periodic clock routine of said operating system kernel;
inserting with said system additional trace hook mechanisms in said operating system kernel sufficient to initialize and maintain process identity, name, and current running process correspondences;
generating with said system trace events in response to said trace hook and additional trace hook mechanisms at predetermined time intervals;
generating with said system trace events in response to changes in process state at times of occurrence of said changes in process state;
creating and maintaining with said system during said profiling a trace buffer as a function of said trace events comprised of;
a plurality of fields of program counter hook data, each corresponding to a different <
current executing process identity, program counter value>
tuple and a count of the number of repetitions of each said instance; and
a plurality of fields maintaining correspondences between process names,identities, and said fields of program counter hook data.
0 Assignments
0 Petitions
Accused Products
Abstract
The invention disclosed herein is a system and method for comprehensive, non-invasive profiling of a processor whereby feedback is provided to a programmer of the execution dynamics of a program. In a preferred embodiment a partial real-time reduction is provided of selected trace events employing the environment'"'"'s trace facility, and a post-processing function is then performed. A trace hook is provided in the environment'"'"'s periodic clock routine which captures the address to be returned to following this timer'"'"'s interrupt, and further captures the address of the caller of the routine represented by the first address. The frequency of occurrences of the first address is collected and correlated to various virtual address spaces and corresponding subroutine offsets within those virtual address spaces. By employing the assembly and source code listing of programs, the address frequencies are then correlated back to specific instructions, and from information in the assembly listing accumulated time is further correlated against specific lines of source code. A profile is generated indicating the amount of time spent by the processor in various processes, kernel, shared library, and user spaces, and subroutines correlated to the lines of source code for negligible additional processor run time.
159 Citations
3 Claims
-
1. In a computer system having an operating system kernel in a program executing multiple processes, a method for use during execution of said multiple processes in profiling said multiple processes, comprising:
-
inserting with said system a trace hook mechanism in a periodic clock routine of said operating system kernel; inserting with said system additional trace hook mechanisms in said operating system kernel sufficient to initialize and maintain process identity, name, and current running process correspondences; generating with said system trace events in response to said trace hook and additional trace hook mechanisms at predetermined time intervals; generating with said system trace events in response to changes in process state at times of occurrence of said changes in process state; creating and maintaining with said system during said profiling a trace buffer as a function of said trace events comprised of; a plurality of fields of program counter hook data, each corresponding to a different <
current executing process identity, program counter value>
tuple and a count of the number of repetitions of each said instance; anda plurality of fields maintaining correspondences between process names, identities, and said fields of program counter hook data. - View Dependent Claims (2, 3)
-
Specification