iJIT_NotifyEvent
Reports information about JIT-compiled code to the agent.
Syntax
int iJIT_NotifyEvent(iJIT_JVM_EVENT event_type, void EventSpecificData);
Description
The iJIT_NotifyEvent
function sends a notification of
event_type
with the data pointed by EventSpecificData
to the
agent. The reported information is used to attribute samples obtained
from any profiling tool collector. This API needs to be called
after JIT compilation and before the first entry into the JIT-compiled
code.
Input Parameters
Parameter |
Description |
|
Notification code sent to the agent. See a complete list of event types below. |
|
Pointer to event specific data. |
The following values are allowed for event_type
:
Send this notification after a JITted method has been loaded into
memory, and possibly JIT compiled, but before the code is executed.
Use the |
|
|
Send this notification to terminate profiling. Use NULL for
|
|
Send this notification to provide new content for a previously reported
dynamic code. The previous content will be invalidated starting from the
time of the notification. Use the |
Send this notification when an inline dynamic code is JIT compiled and
loaded into memory by the JIT engine, but before the parent code region
starts executing. Use the |
|
Send this notification when a dynamic code is JIT compiled and loaded into
memory by the JIT engine, but before the code is executed. Use the
|
The following structures can be used for EventSpecificData
:
iJIT_Method_Inline_Load Structure
When you use the iJIT_Method_Inline_Load
structure to describe the
JIT compiled method, use iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED
as an event type to report it. TheiJIT_Method_Inline_Load
structure has the following fields:
Field |
Description |
|
Unique method ID. Method ID cannot be smaller than 999. You must
either use the API function |
|
Unique immediate parent’s method ID. Method ID may not be smaller than 999. You must either use the API function iJIT_GetNewMethodID to get a valid and unique method ID, or else manage ID uniqueness and correct range by yourself. |
|
The name of the method, optionally prefixed with its class name and appended with its complete signature. This argument cannot be set to NULL. |
|
The base address of the method code. Can be NULL if the method is not JITted. |
|
The virtual address on which the method is inlined. If NULL, then data provided with the event are not accepted. |
|
The number of entries in the line number table. 0 if none. |
|
Pointer to the line numbers info array. Can be NULL if |
|
Class name. Can be NULL. |
|
Source file name. Can be NULL. |
iJIT_Method_Load Structure
When you use theiJIT_Method_Load
structure to describe the JIT
compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED
as an
event type to report it. TheiJIT_Method_Load
structure has the
following fields:
Field |
Description |
|
Unique method ID. Method ID cannot be smaller than 999. You must
either use the API function |
|
The name of the method, optionally prefixed with its class name and appended with its complete signature. This argument cannot be set to NULL. |
|
The base address of the method code. Can be NULL if the method is not JITted. |
|
The virtual address on which the method is inlined. If NULL, then data provided with the event are not accepted. |
|
The number of entries in the line number table. 0 if none. |
|
Pointer to the line numbers info array. Can be NULL if |
|
This field is obsolete. |
|
Class name. Can be NULL. |
|
Source file name. Can be NULL. |
|
This field is obsolete. |
|
This field is obsolete. |
|
This field is obsolete. |
iJIT_Method_Load_V2 Structure
When you use the iJIT_Method_Load_V2
structure to describe the JIT
compiled method, use iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED_V2
as an
event type to report it. TheiJIT_Method_Load_V2
structure has the
following fields:
Field |
Description |
|
Unique method ID. Method ID cannot be smaller than 999. You must either
use the API function |
|
The name of the method, optionally prefixed with its class name and appended with its complete signature. This argument cannot be set to NULL. |
|
The base address of the method code. Can be NULL if the method is not JITted. |
|
The virtual address on which the method is inlined. If NULL, then data provided with the event are not accepted. |
|
The number of entries in the line number table. 0 if none. |
|
Pointer to the line numbers info array. Can be NULL if |
|
Class name. Can be NULL. |
|
Source file name. Can be NULL. |
|
Module name. Can be NULL. The module name can be useful for distinguishing among different JIT engines. |
LineNumberInfo Structure
Use the LineNumberInfo
structure to describe a single entry in the
line number information of a code region. A table of line number entries
provides information about how the reported code region is mapped to
source file. Profiling tool uses line number information to attribute
the samples (virtual address) to a line number. It is acceptable to
report different code addresses for the same source line:
Offset |
Line Number |
1 |
2 |
12 |
4 |
15 |
2 |
18 |
1 |
21 |
30 |
Profilers construct the following table using the client data:
Code sub-range |
Line Number |
0-1 |
2 |
1-12 |
4 |
12-15 |
2 |
15-18 |
1 |
18-21 |
30 |
The LineNumberInfo
structure has the following fields:
Field |
Description |
|
Opcode byte offset from the beginning of the method. |
|
Matching source line number offset (from beginning of source file). |
Return Values
The return values are dependent on the particular iJIT_JVM_EVENT
.