US 6,983,455 B2
Mechanism for profiling computer code
Aleksandr M. Kuzmin, Santa Clara, Calif. (US)
Assigned to Sun Microsystems, Inc., Palo Alto, Calif. (US)
Filed on Apr. 10, 2002, as Appl. No. 10/120,823.
Prior Publication US 2003/0196193 A1, Oct. 16, 2003
Int. Cl. G06F 9/44 (2006.01)
U.S. Cl. 717—130 18 Claims
OG exemplary drawing
 
1. A method for profiling a set of computer code, comprising:
executing a set of computer code;
generating an execution log for the set of computer code, wherein the execution log comprises information indicating how many times a code segment within the set of computer code was executed;
selecting said code segment from the execution log after execution of the set of computer code has completed;
accessing a decomposed representation of said code segment, said decomposed representation specifying one or more basic instructions that are executed to execute said code segment;
determining a resource measure for each of the basic instructions specified in said decomposed representation, wherein a resource measure for a basic instruction provides an indication of an amount of processing resources consumed in executing that basic instruction once;
deriving, based upon said decomposed representation and the resource measures, an execution cost for said code segment, wherein said execution cost provides an indication of an amount of processing resources consumed in executing said code segment once; and
deriving, based upon said execution cost and how many times said code segment was executed, a total execution cost for said code segment.