EP0307075A2

Method and apparatus for measuring program execution.

Abstract

A computer program is disclosed for measuring the execution of machine code instructions in an executing program. A copy of the measured program is made and selected machine instructions are replaced by interrupt-causing breakpoint instructions. As each breakpoint instruction is executed, the breakpoint is replaced by the actual instruction, and a bit map is updated to indicate execution of the measured instruction. Execution resumes with the actual instruction.

EP0307075A2, drawing sheet 1
Sheet 1 of 10

Term

Term ended

Projected expiry passed 8 July 2008, 18.2 years ago.

  1. Priority
  2. Filed
  3. Published
  4. Projected expiry
  5. Today

12 claims: 6 independent, 6 dependent

  1. 1
    A method for measuring computer program instruction execution, comprising the steps of:replacing a selected instruction with a measurement instruction;in response to the execution of the measurement instruction, performing the steps of: indicating that the selected instruction has executed, replacing the measurement instruction with the selected instruction;and executing the selected instruction.
  2. 2
    A method for measuring the execution of machine-level instructions in a computer program, comprising the steps of:selecting a set of the instructions from the computer program;replacing each of the instructions in the selected set with a measurement instruction;executing the program;in response to the execution of one of the measurement instructions, performing the steps of: identifying the measured instruction replaced by the executed measurement instruction;indicating that the measured instruction has executed;restoring the measured instruction by replacing the measurement instruction;and executing the restored instruction.
  3. 7
    A method for measuring the execution of machine-level instructions in a computer program comprising the steps of:making a copy of the computer program;selecting a set of the instructions from the computer program;replacing each of the selected instructions in the program copy with an interrupt-causing instruction;initialising a map having a set of storage locations corresponding to the selected set of instructions;executing the program copy;in response to an interrupt, performing the steps of: ascertaining the location in the program of the interrupted instruction;storing a predetermined value in the map storage location corresponding to the instruction replaced by the interrupted instruction;restoring the instruction by copying the instruction at the ascertained location in the program to the ascertained location in the program copy;and executing the restored instruction.
  4. 8
    An apparatus for measuring computer program instruction execution in a computer, the computer having at least one central processing unit for executing instructions, the apparatus comprising:memory means coupled to the central processing unit for storing data and instruction;means coupled to said memory means for replacing a selected instruction with a measurement instruction;and means coupled to said memory means and responsive to the execution of the measurement instruction for: indicating that the selected instruction has executed;replacing the measurement instruction with the selected instruction;and executing the selected instruction.
  5. 10
    In a computer having at least one central processing unit for executing instructions, an apparatus for measuring the execution of machine-level instructions in a computer program, comprising:memory means coupled to the central processing unit for storing instructions an data;means coupled to said memory means for selecting a set of instructions from the computer program;means coupled to said memory means for replacing each of the instructions in the selected set with a measurement instruction;means coupled to said memory means for executing the program;and means coupled to said memory means and responsive to the execution of one of the measurement instructions for: identifying the measured instruction replaced by the executed measurement instruction;indicating that the measured instruction has executed;restoring the measured instruction by replacing the measurement instruction;and executing the restored instruction.
  6. 12
    In a computer having at least one central processing unit, an apparatus for measuring the execution of machine-­level instructions in a computer program comprising:memory means coupled to the central processing unit for storing instructions and data;means coupled to said memory means for making a copy of the computer program;means coupled to said memory means for selecting a set of instructions from the computer program;means coupled to said memory means for replacing each of the selected instructions in the program copy with an interrupt-causing instruction;means coupled to said memory means for initialising a map having a set of storage locations corresponding to the selected set of instructions;means coupled to said memory means for causing the central processing unit to execute the program copy;and means coupled to said memory means and responsive to an interrupt for: ascertaining the location in the program of the interrupted instruction;storing a predetermined value in the map storage location corresponding to the instruction replaced by the interrupted instruction;restoring the instruction by copying the instruction at the ascertained location in the program to the ascertained location in the program copy;and executing the restored instruction.