Method and system for maintaining thread-relative metrics for trace data adjusted for thread switches
First Claim
1. A method for processing for events detected while profiling all instrumented program executed by a virtual machine in a data processing system, the method comprising the computer-implemented stops of:
- in response to an occurrence of current event, receiving a request for a number of bytecodes executed by a thread running in the virtual machine since a preceding event;
computing the number of bytecodes executed by the thread running in the virtual machine since the preceding event; and
returning, in response to the request, the number of bytecodes executed by the thread running in the virtual machine since the preceding event, wherein the step of computing the number of bytecodes executed by the thread running in the virtual machine since the preceding event further includes;
retrieving a stored bytecode count for the thread;
obtaining a current bytecode count for the thread;
computing a difference between the current bytecode count and the stored bytecode count; and
adding the computed difference to the number of bytecodes executed by the thread running in the virtual machine sine the preceding event.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and system for maintaining a thread-relative metric for trace data using device driver support is provided. A profiling process may detect a current event, and in response to the current event, may request an elapsed metric since a preceding event. The profiling process then receives a thread-relative elapsed metric and may output a trace record for the current event in which is stored a metric equal to the received thread-relative elapsed metric. In response to a notification of an occurrence of the current event, a device driver computes the thread-relative elapsed metric by: determining a current thread; retrieving a stored metric for the preceding event of the current thread; obtaining a current metric; and computing the thread-relative elapsed metric as a difference between the current metric and the stored metric.
85 Citations
7 Claims
-
1. A method for processing for events detected while profiling all instrumented program executed by a virtual machine in a data processing system, the method comprising the computer-implemented stops of:
-
in response to an occurrence of current event, receiving a request for a number of bytecodes executed by a thread running in the virtual machine since a preceding event;
computing the number of bytecodes executed by the thread running in the virtual machine since the preceding event; and
returning, in response to the request, the number of bytecodes executed by the thread running in the virtual machine since the preceding event, wherein the step of computing the number of bytecodes executed by the thread running in the virtual machine since the preceding event further includes;
retrieving a stored bytecode count for the thread;
obtaining a current bytecode count for the thread;
computing a difference between the current bytecode count and the stored bytecode count; and
adding the computed difference to the number of bytecodes executed by the thread running in the virtual machine sine the preceding event. - View Dependent Claims (2)
storing the current bytecode count for subsequent retrieval.
-
-
3. A data processing system for processing events detected while profiling an instrumented program executed by a virtual machine in the data processing system, the data processing system comprising:
-
receiving means for receiving, in response to an occurrence of a current event, a request for a number of bytecodes executed by a thread running in the virtual machine since a preceding event;
first computing means for computing the number of bytecodes executed by the thread running in the virtual machine since the preceding event, and returning means for returning, in response to the request, the number of bytecodes executed by the thread running in the virtual machine since the preceding event, wherein the first computing means further includes;
retrieving means for retrieving a stored bytecode count for the thread;
obtaining means for obtaining a current bytecode count for the thread;
second computing means for computing a difference between the current bytecode count and the stored bytecode count; and
adding means for adding the computed difference to the number of bytecodes executed by the thread running in the virtual machine since the preceding event. - View Dependent Claims (4, 5)
storing means for storing the current bytecode count for subsequent retrieval.
-
-
5. The data processing system of claim 3 further comprising applying means for applying, in response to a determination of completion of the profiling the instrumented program, remaining bytecode counts to corresponding threads.
-
6. A computer program product in a computer-readable medium for use in a data processing system for processing events detected while profiling an instrumented program executed by a virtual machine in the data processing system, the computer program product comprising:
-
first instructions for receiving, in response to an occurrence of a current event, a request for a number of bytecodes executed by a thread running in the virtual machine since a preceding event;
second instructions for computing the number of bytecodes executed by the thread running in the virtual machine since the preceding event; and
third instructions for returning, in response to the request, the number of bytecodes executed by the thread running in the virtual machine since the preceding event, wherein the second instructions further include;
instructions for retrieving a stored bytecode count for the thread;
instructions for obtaining a current bytecode count for the thread;
instructions for computing a difference between the current bytecode count and the stored bytecode count; and
instructions for adding the computed difference to the number of bytecodes executed by the thread running in the virtual machine since the preceding event. - View Dependent Claims (7)
instructions for storing the current bytecode count for subsequent retrieval.
-
Specification