Patent ID: 6126329
Filing Date: 2000-10-03
Classification: G06F

Abstract:
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; andfor each basic block, performing under computer control, the steps ofselecting 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; andadding 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 ofadding 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; andadding 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.