IP Library Granted Patent US 8,478,948
Granted Patent B2
US 8,478,948 · App. 12/328,364 · Granted Jul 2, 2013

Method and system for efficient tracing and profiling of memory accesses during program execution

Inventors: Maksim V. Panchenko (Mountain View, CA); Chandrashekhar R. Garud (Newark, CA); Fu-Hwa Wang (Saratoga, CA)
Assignee: Oracle America, Inc.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,478,948
App. No.
12/328,364
Granted
Jul 2, 2013
Kind
B2
Abstract

A system and method for performing efficient program instrumentation for memory profiling. A computing system comprises a memory profiler comprising a static binary instrumentation (SBI) tool and a dynamic binary analysis (DBA) tool. The profiler is configured to selectively instrument memory access operations of a software application. Instrumentation may be bypassed completely for an instruction if the instruction satisfies some predetermined conditions. Some sample conditions include the instruction accesses an address within a predetermined read-only area, the instruction accesses an address within a user-specified address range, and/or the instruction is a load instruction accessing a memory location determined from a data flow graph to store an initialized value. An instrumented memory access instruction may have memory checking analysis performed only upon an initial execution of the instruction in response to determining during initial execution that a read data value of the instruction is initialized. Both unnecessary instrumentation and memory checking analysis may be reduced.

Claims (43)

1. A compilation method for memory profiling, the method comprising:

analyzing source program code of a computer program;

identifying memory access instructions in the source program code of the computer program; and

determining a first memory access instruction qualifies for instrumentation;

wherein the instrumentation comprises:

inserting additional program instructions into the computer program;

wherein the additional program instructions:

invoke a memory check operation only during a first execution of the first memory access instruction, wherein the memory check operation stores an identifier and statistics of the first memory access instruction for profiling; and

bypass a memory check operation during subsequent executions of the first memory access instruction, in response to determining that a read data value of the first memory access instruction was initialized during the first execution.

2. The method as recited in claim 1 , further comprising determining a second memory access instruction qualifies for bypass of instrumentation.

3. The method as recited in claim 2 , wherein determining the second memory access instruction qualifies for bypass of instrumentation comprises one or more of the following: the second memory access instruction accesses an address within a user-specified address range and the second memory access instruction accesses a memory type not within a user-specified memory type.

4. The method as recited in claim 3 , wherein determining the second memory access instruction qualifies for bypass of instrumentation further comprises one or more of the following: the second memory access instruction is a load instruction within a user-specified code range and the second memory access instruction is a load instruction accessing a memory location determined from a data flow graph to store an initialized value.

5. The method as recited in claim 1 , further comprising removing a speculative load instruction from a branch of execution in the program code, wherein it is determined the speculative load instruction reads a value that is not used in the branch of execution.

6. The method as recited in claim 1 , further comprising instrumenting only a portion of a memory location data value corresponding to a memory access instruction, in response to determining only said portion of the memory location data value is used by the program.

7. The method as recited in claim 1 , further comprising instrumenting a store instruction with no analysis checks in response to the store instruction is within a user-specified code range.

8. The method as recited in claim 1 , wherein determining the read data value of the first memory instruction is initialized comprises one or more of the following: inspecting variables subsequent utilizing a linker for separate modules and comparing the read data value to a predetermined marker value, wherein the marker value is written to un-initialized memory prior to program execution.

9. A computing system comprising:

one or more processors each comprising one or more processor cores;

a memory coupled to the one or more processors, wherein the memory stores a program comprising program code;

wherein a processor of the one or more processors is configured to execute program instructions of a compiler which when executed are operable to:

analyze source program code of a computer program;

identify memory access instructions in the source program code of the computer program; and

determine a first memory access instruction qualifies for instrumentation;

wherein the instrumentation comprises inserting additional program instructions into the computer program, wherein the additional program instructions:

invoke a memory check operation only during a first execution of the first memory access instruction, wherein the memory check operation stores an identifier and statistics of the first memory access instruction for profiling; and

bypass a memory check operation during subsequent executions of the first memory access instruction, in response to determining during the first execution that a read data value of the first memory access instruction was initialized.

10. The computing system as recited in claim 9 , wherein the processor of the one or more processors is configured to execute program instructions which when executed are further operable to determine a second memory access instruction qualifies for bypass of instrumentation.

11. The computing system as recited in claim 10 , wherein determining the second memory access instruction qualifies for bypass of instrumentation comprises one or more of the following: the second memory access instruction accesses an address within a user-specified address range and the second memory access instruction accesses a memory type not within a user-specified memory type.

12. The computing system as recited in claim 11 , wherein determining the second memory access instruction qualifies for bypass of instrumentation further comprises one or more of the following: the second memory access instruction is a load instruction within a user-specified code range and the second memory access instruction is a load instruction accessing a memory location determined from a data flow graph to store an initialized value.

13. The computing system as recited in claim 9 , wherein a processor of the one or more processors is configured to execute program instructions which when executed is operable to remove a speculative load instruction from a branch of execution in the program code, wherein it is determined the speculative load instruction reads a value that is not used in the branch of execution.

14. The computing system as recited in claim 9 , wherein a processor of the one or more processors is configured to execute program instructions which when executed is operable to instrument only a portion of a memory location data value corresponding to a memory access instruction, in response to determining only said portion of the memory location data value is used by the program.

15. The computing system as recited in claim 9 , wherein a processor of the one or more processors is configured to instrument a store instruction with no analysis checks in response to the store instruction is within a user-specified code range.

16. The computing system as recited in claim 9 , wherein determining the read data value of the first memory instruction is initialized comprises one or more of the following: inspecting variables subsequent utilizing a linker for separate modules and comparing the read data value to a predetermined marker value, wherein the marker value is written to un-initialized memory prior to program execution.

17. A non-transitory computer readable storage medium storing program instructions, wherein the program instructions are executable to:

analyze source program code of a computer program;

identify memory access instructions in the source program code of the computer program; and

determine a first memory access instruction qualifies for instrumentation;

wherein the instrumentation comprises inserting additional program instructions into the computer program, wherein the additional program instructions:

invoke a memory check operation only during a first execution of the first memory access instruction, wherein the memory check operation stores an identifier and statistics of the first memory access instruction for profiling; and

bypass a memory check operation during subsequent executions of the first memory access instruction, in response to determining during the first execution that a read data value of the first memory access instruction was initialized.

18. The storage medium as recited in claim 17 , wherein the program instructions are further executable to determine a second memory access instruction qualifies for bypass of instrumentation.

19. The storage medium as recited in claim 18 , wherein determining the second memory access instruction qualifies for bypass of instrumentation comprises one or more of the following: the second memory access instruction accesses an address within a user-specified address range and the second memory access instruction accesses a memory type not within a user-specified memory type.

20. The storage medium as recited in claim 17 , wherein determining the read data value of the first memory instruction is initialized comprises one or more of the following: inspecting variables subsequent utilizing a linker for separate modules and comparing the read data value to a predetermined marker value, wherein the marker value is written to un-initialized memory prior to program execution.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037311/0206 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 5, 2008
From: PANCHENKO, MAKSIM V.; GARUD, CHANDRASHEKHAR R.; WANG, FU-HWA
To: SUN MICROSYSTEMS, INC.
Reel/Frame 021929/0798 →
Continuity (1)
Related Publication 20100146220A1 · Jun 10, 2010