System and method for tracing instructions in an information handling system without changing the system source code
First Claim
1. A method for tracing operations in an information handling system, comprising the steps of:
- creating a virtual machine layer between an operating system and hardware of the information handling system;
shadowing identified machine registers during machine transition states using the virtual machine layer;
determining by a tracing program if a change in program flow has occurred, wherein said determining step includes the following steps;
reading a first instruction address of a first instruction;
calculating a length of the first instruction;
adding the first instruction address to the length of the first instruction to determine an expected address;
comparing the expected address to the next instruction address; and
if the expected address is not equal to the next instruction address, concluding that a change in program flow has occurred; and
writing a trace record to a trace log if a change in program flow has occurred.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention is directed to a system and method for tracing operations in an information handling system without changing the operating system code. Certain machine registers are shadowed during critical machine state transitions (e.g., taking and returning from interrupts), so that the tracing program does not lose control of the system. The system is interrupted before each instruction is executed, and a tracing program determines if a change in program flow has occurred. If a change in program flow has occured, a record is written to a trace log. The record contains the number of consecutive instructions executed before the program flow change, along with a displacement field indicating the number of bytes from the end of the record to the beginning of the next record. Executed instructions are also embedded in the trace log, allowing for high compression ratios and less complex post-processing of the trace data.
138 Citations
24 Claims
-
1. A method for tracing operations in an information handling system, comprising the steps of:
-
creating a virtual machine layer between an operating system and hardware of the information handling system; shadowing identified machine registers during machine transition states using the virtual machine layer; determining by a tracing program if a change in program flow has occurred, wherein said determining step includes the following steps; reading a first instruction address of a first instruction; calculating a length of the first instruction; adding the first instruction address to the length of the first instruction to determine an expected address; comparing the expected address to the next instruction address; and if the expected address is not equal to the next instruction address, concluding that a change in program flow has occurred; and writing a trace record to a trace log if a change in program flow has occurred. - View Dependent Claims (2, 3, 4)
-
-
5. An information handling system, comprising:
-
one or more processors; memory means for storing instructions and data for use by the processors; one or more images of an operating system for controlling the operation of the processors; an input/output system for communicating information to and from peripheral devices; at least one system bus connecting the elements of the system for efficient operation; a virtual machine layer between an operating system and hardware of the information handling system, the virtual machine layer for shadowing an identified machine register during processor transition states; reporting means for providing processor transition state information to a requesting process; a tracing program for determining if a change in program flow has occurred; and a trace log in which trace records are written if a change in program flow has occurred. - View Dependent Claims (6, 7, 8, 9)
-
-
10. A computer readable medium, comprising:
-
means for shadowing identified machine registers during machine transition states; means for determining by a tracing program if a change in program flow has occurred, wherein said means for determining includes; means for reading a first instruction address of a first instruction; means for calculating a length of the first instruction; means for adding the first instruction address to the length of the first instruction to determine an expected address; means for comparing the expected address to the next instruction address; and means for concluding that a chance in program flow has occurred; and means for writing a trace record to a trace log if a change in program flow has occurred. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A method for tracing operations in an information handling system, comprising the steps of:
-
creating a virtual machine layer between an operating system and hardware of the information handling system; shadowing identified machine registers during machine transition states using the virtual machine layer, wherein said shadowing step includes the following steps; reading a next instruction address of a next instruction to be executed; decoding the next instruction; and if the next instruction is one of a predetermined set of instructions, emulating the instruction in software; determining by a tracing program if a change in program flow has occurred; and writing a trace record to a trace log if a change in program flow has occurred. - View Dependent Claims (20, 21)
-
-
22. An information handling system, comprising:
-
one or more processors; memory means for storing instructions and data for use by the processors; one or more images of an operating system for controlling the operation of the processors; an input/output system for communicating information to and from peripheral devices; at least one system bus connecting the elements of the system for efficient operation; a virtual machine layer between an operating system and hardware of the information handling system, the virtual machine layer including means for shadowing an identified machine register during processor transition states, wherein said means for shadowing further includes; means for reading a next instruction address of a next instruction to be executed; means for executing the instruction; means for decoding the next instruction; and means for emulating the instruction in software; and reporting means for providing processor transition state information to a requesting process. - View Dependent Claims (23, 24)
-
Specification