← Back to Patent Explorer
US6126329A Expired / Lapsed US ⏱️ 0.0 years remaining

Method and apparatus for accurate profiling of computer programs

Assignee: Rational Software Corp
•
Filing: 1997-06-09
•
Granted: 2000-10-03
•
Expires: 2017-06-09
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract An object code expansion profiler equips a program for execution profiling by preprocessing the object code files of the program so as to add profiling monitoring code to the beginning of all or substantially all functions. The preprocessing includes, for each function, the steps of grouping the function's instructions into basic blocks, counting the number of cycles required to execute the instructions of the basic block, and inserting special monitoring code with the basic block. The special monitoring code is executed each time the basic block is executed, and updates the profiling information to reflect the number of cycles required to execute the basic block. Special handling is provided for profiling calls to the Operating System (OS). The resultant profiling information is converted into a call graph image most useful for human users. For each arc in the graph connecting a calling-function/parent-node to a called-function/child node, the displayed arc image has a width logarithmically proportional to the self+descendants time for the called function.

Inventors

  • 👤 James Bennett
  • 👤 Mark Anderson
  • 👤 Choon Piaw Na
  • 👤 Reed Hastings

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-11-08 16:12
CPC Classifications
G; G06; G06F; G06F11/00; G06F11/36; G06F11/3604; G06F11/3612; G06F11/30; G06F11/32; G06F11/323; G06F11/34; G06F11/3409; G06F11/3419; G06F11/3457; G06F11/3461; G06F11/3466; G06F2201/00; G06F2201/865; G06F2201/88

Claims Analysis

Total Claims: 13
Claim 1
Independent Claim 291 words
A computer implemented method for profiling execution of a computer program having functions comprising instructions, the method comprising the steps of: for each function, parsing the function instructions into basic blocks, wherein a basic block consists of a contiguous sequence of at least one instruction of which the first instruction is a program control transfer destination, the last instruction is a program control transfer instruction, and any instructions between first and last instructions are neither program control transfer destinations nor program control transfer instructions; and for each basic block, performing under computer control, the steps of selecting a basic block; analyzing the selected basic block to determine a fixed number of clock cycles for the selected basic block, and to determine whether the selected basic block contains an operating system (OS) call; and adding basic block profiling code so as to be executed whenever the basic block is executed, said basic block profiling code operating to add the determined fixed number of clock cycles to a clock cycle accumulator for the function, and further including, for at least one selected basic block containing an OS call, the OS call timing profiling steps of adding timing start code to determine a start time immediately before executing the OS call; adding timing end code to determine an end time immediately after executing the OS call; adding OS call timing calculation code to determine from the start time and end time a number of clock cycles required to execute the OS call; and adding OS call timing recording code to add the determined number of clock cycles to a clock cycle accumulator for the function; wherein said OS call timing profiling steps are performed for substantially only basic blocks containing indeterminate length OS calls.
Claim 2
Dependent Claim 291 words
A computer implemented method for profiling execution of a computer program having functions comprising instructions, the method comprising the steps of: for each function, parsing the function instructions into basic blocks, wherein a basic block consists of a contiguous sequence of at least one instruction of which the first instruction is a program control transfer destination, the last instruction is a program control transfer instruction, and any instructions between first and last instructions are neither program control transfer destinations nor program control transfer instructions; and for each basic block, performing under computer control, the steps of selecting a basic block; analyzing the selected basic block to determine a fixed number of clock cycles for the selected basic block, and to determine whether the selected basic block contains an operating system (OS) call; and adding basic block profiling code so as to be executed whenever the basic block is executed, said basic block profiling code operating to add the determined fixed number of clock cycles to a clock cycle accumulator for the function, and further including, for at least one selected basic block containing an OS call, the OS call timing profiling steps of adding timing start code to determine a start time immediately before executing the OS call; adding timing end code to determine an end time immediately after executing the OS call; adding OS call timing calculation code to determine from the start time and end time a number of clock cycles required to execute the OS call; and adding OS call timing recording code to add the determined number of clock cycles to a clock cycle accumulator for the function; wherein said OS call timing profiling steps are performed for substantially only basic blocks containing indeterminate length OS calls.
Claim 3
Dependent Claim 159 words
A computer implemented method for profiling execution of a computer program having functions, the functions having instructions, the method comprising the steps of: a) augmenting the program by adding profiling code to the program; b) executing the augmented program and collecting profiling data for functions of the program, said profiling data including self+descendants times for the functions wherein the self+descendants times are percentages of a total execution time for the program; c) constructing a call graph for the program; and d) displaying to a user a representation of the call graph including arcs connecting nodes, wherein each arc links a parent function to a child function and has a width corresponding to the self+descendants time for the child function, and wherein the step of displaying the representation of the call graph comprises displaying a call graph in which each arc has a width having a linear relationship to the percentage self+descendants time of the child function of the arc.
Claim 4
Dependent Claim 159 words
A computer implemented method for profiling execution of a computer program having functions, the functions having instructions, the method comprising the steps of: a) augmenting the program by adding profiling code to the program; b) executing the augmented program and collecting profiling data for functions of the program, said profiling data including self+descendants times for the functions wherein the self+descendants times are percentages of a total execution time for the program; c) constructing a call graph for the program; and d) displaying to a user a representation of the call graph including arcs connecting nodes, wherein each arc links a parent function to a child function and has a width corresponding to the self+descendants time for the child function, and wherein the step of displaying the representation of the call graph comprises displaying a call graph in which each arc has a width having a linear relationship to the percentage self+descendants time of the child function of the arc.
Claim 5
Dependent Claim 159 words
A computer implemented method for profiling execution of a computer program having the functions, the functions having instruction, the method comprising the steps of: a) augmenting the program by adding profiling code to the program; b) executing the augmented program and collecting profiling data for functions of the program, said profiling including self+descendants times for the functions wherein the self+descendants times are percentages of a total execution time for the program; c) constructing a call graph for the program; and d) displaying to a user a representation of the call graph including arcs connecting nodes, wherein each arc links a parent function to a child function and has a width corresponding to the self+descendants time for the child function and wherein the step of displaying the representation of the call graph comprise displaying a call graph in which each arc has a width having a logarithmic relationship to the percentage self+descendants time of the child function of the arc.
Claim 6
Dependent Claim 159 words
A computer implemented method for profiling execution of a computer program having the functions, the functions having instruction, the method comprising the steps of: a) augmenting the program by adding profiling code to the program; b) executing the augmented program and collecting profiling data for functions of the program, said profiling including self+descendants times for the functions wherein the self+descendants times are percentages of a total execution time for the program; c) constructing a call graph for the program; and d) displaying to a user a representation of the call graph including arcs connecting nodes, wherein each arc links a parent function to a child function and has a width corresponding to the self+descendants time for the child function and wherein the step of displaying the representation of the call graph comprise displaying a call graph in which each arc has a width having a logarithmic relationship to the percentage self+descendants time of the child function of the arc.
Claim 7
Dependent Claim 141 words
A computer implemented method for profiling execution of a computer program having functions, the functions having instructions, the method comprising the steps of: a) augmenting the program by adding profiling code to the program; b) executing the augmented program and collecting profiling data for functions of the program, said profiling data including self+descendants times for the functions; c) constructing a call graph showing function calls for the program; d) providing a pruning time filter value; d) displaying to a user a representation of the call graph including arcs connecting nodes, wherein each arc links a parent function to a child function, wherein a set of arcs is automatically pruned from said displayed call graph representation, wherein each of said set of said automatically pruned arcs connects to a child function having a self+descendants time less than said pruning time filter value.
Claim 8
Dependent Claim 141 words
A computer implemented method for profiling execution of a computer program having functions, the functions having instructions, the method comprising the steps of: a) augmenting the program by adding profiling code to the program; b) executing the augmented program and collecting profiling data for functions of the program, said profiling data including self+descendants times for the functions; c) constructing a call graph showing function calls for the program; d) providing a pruning time filter value; d) displaying to a user a representation of the call graph including arcs connecting nodes, wherein each arc links a parent function to a child function, wherein a set of arcs is automatically pruned from said displayed call graph representation, wherein each of said set of said automatically pruned arcs connects to a child function having a self+descendants time less than said pruning time filter value.
Claim 9
Dependent Claim 47 words
The method of claim 4, wherein said step of providing the pruning time filter value comprises automatically determining, under computer control, a time value such that a predetermined number of the functions of the program have a self+descendants time at least equal to the determined time value.
Claim 10
Dependent Claim 17 words
The method of claim 5, wherein the predetermined number of functions is less than about one hundred.
Claim 11
Dependent Claim 14 words
The method of claim 6, wherein the predetermined number of functions is about thirty.
Claim 12
Dependent Claim 324 words
A computer implemented method for profiling execution of a computer program having functions comprising instructions, the method comprising the steps of: for each function, parsing the function instructions into basic block, wherein a basic block consists of a contiguous sequence of at least one instruction of which the first instruction is a program control transfer destination, the last instruction is a program control transfer instruction, and any instructions between first and last instructions are neither program control transfer destinations nor program control transfer instructions; and for each basic block, performing under computer control, the steps of selecting a basic block; analyzing the selected basic block to determine a fixed number of clock cycles for the selected basic block, and to determine whether the selected basic block contains an operating system (OS) call; and adding basic block profiling code so as to be executed whenever the basic block is executed, said basic block profiling code operating to add the determined fixed number of clock cycles to a clock cycle accumulator for the function, and further including, for at least one selected basic block containing an OS call, the OS call timing profiling steps of adding timing start code to determine a start time immediately before executing the OS call; adding timing end code to determine an end time immediately after executing the OS call; adding OS call timing calculation code to determine from the start time and end time a number of clock cycles required to execute the OS call; and adding OS call timing recording code to add the determined number of clock cycles to a clock cycle accumulator for the function; wherein the added basic block profiling code operates to add the determined fixed number of clock cycles, and the added OS call timing recording code operates to add the determined number of cycles required to execute the OS call, to a clock cycle accumulator for the selected basic block of the function.
Claim 13
Dependent Claim 324 words
A computer implemented method for profiling execution of a computer program having functions comprising instructions, the method comprising the steps of: for each function, parsing the function instructions into basic block, wherein a basic block consists of a contiguous sequence of at least one instruction of which the first instruction is a program control transfer destination, the last instruction is a program control transfer instruction, and any instructions between first and last instructions are neither program control transfer destinations nor program control transfer instructions; and for each basic block, performing under computer control, the steps of selecting a basic block; analyzing the selected basic block to determine a fixed number of clock cycles for the selected basic block, and to determine whether the selected basic block contains an operating system (OS) call; and adding basic block profiling code so as to be executed whenever the basic block is executed, said basic block profiling code operating to add the determined fixed number of clock cycles to a clock cycle accumulator for the function, and further including, for at least one selected basic block containing an OS call, the OS call timing profiling steps of adding timing start code to determine a start time immediately before executing the OS call; adding timing end code to determine an end time immediately after executing the OS call; adding OS call timing calculation code to determine from the start time and end time a number of clock cycles required to execute the OS call; and adding OS call timing recording code to add the determined number of clock cycles to a clock cycle accumulator for the function; wherein the added basic block profiling code operates to add the determined fixed number of clock cycles, and the added OS call timing recording code operates to add the determined number of cycles required to execute the OS call, to a clock cycle accumulator for the selected basic block of the function.

References Cited (Backward Citations)

US5142679A Cited
US4845615A Cited
US4937740A Cited
US5047919A Cited
US5247651A Cited
US5212794A Cited
US5313616A Cited
US5355487A Cited
US5333304A Cited
US5164969A Cited
US5265254A Cited
US5359533A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 2003-10-03 2004-04-03 2004-10-03 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2007-10-03 2008-04-03 2008-10-03 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2011-10-03 2012-04-03 2012-10-03 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag