Microsoft SDK for Java

IJavaEventMonitor2::
GetPossibleEventCategories

The GetPossibleEventCategories method of the IJavaEventMonitor2 interface is called by the Microsoft VM to query the profiler to determine which event categories might ever be enabled for notification. This method is only supported on the IJavaEventMonitor2 interface.

Syntax

HRESULT GetPossibleEventCategories(DWORD *ppossible_events);

Return Value

The MethodID of the method the profiler is interested in.

Parameters

[out] *ppossible_events The MethodID of the method the profiler is interested in.

Remarks

After the Initialize method is called (and returns S_OK), the Microsoft VM checks to determine if the IJavaEventMonitor2 interface is supported by the profiler application. If this interface is supported, the VM calls the GetPossibleEventCategories method to determine which event categories might ever be enabled by the profiler in this Java process (the bitmask for the maximum possible list of event categories). If some event categories will never be enabled for this process, the VM can optimize internal operations by eliminating some profiling overhead.

The profiler application should set the possible_events parameter to the bitmask of the maximum possible list of events for which it might ever want to receive notification. The possible events that can be notified can be any combination of the event categories defined in the JAVA_EVENT_CATEGORY enumeration.

JAVA_Event_Category

Constant Value Description
JVM_MONITOR_NONE 0 Do not send notification for any event categories.
JVM_MONITOR_CLASS_LOADS 1 Send event notification when a Java class is loaded or when the class is unloaded. The Microsoft VM will call the NotifyEvent method implemented by the profiler.
JVM_MONITOR_METHOD_CALLS 2 Send event notification when a Java method is about to be called and upon completion of the method call. The Microsoft VM will call the MethodEntry and MethodExit methods implemented by the profiler. If the profiler implements IJavaEventMonitor2 interface, the Microsoft VM will call MethodExit2 on this interface rather than MethodExit.
JVM_MONITOR_JIT_COMPILATION 4 Send event notification when a Java class is about to be JIT compiled and after JIT compilation is completed. The Microsoft VM will call the NotifyEvent method implemented by the profiler.
JVM_MONITOR_BYTE_CODE_EXECUTION 8 Send event notification when a byte code instruction of an interpreted method is about to be executed. The Microsoft VM will call the ExecuteByteCode method implemented by the profiler. If any profiler requests this event category, then JIT compilation will be disabled for all methods.
JVM_MONITOR_SOURCE_LINE_EXECUTION 0x10 Send event notification when a Java source line is about to be executed. The Microsoft VM will call the ExecuteSourceLine method implemented by the profiler.
JVM_MONITOR_EXCEPTIONS 0x20 Send event notification when an exception is about to be thrown. The Microsoft VM will call the NotifyEvent2 method if the IJavaEventMonitor2 interface is implemented by the profiler. Otherwise the Microsoft VM will call the NotifyEvent method.
JVM_MONITOR_GARBAGE_COLLECTIONS 0x80 Send event notification when the VM is about to execute garbage collection. The Microsoft VM will call the NotifyEvent method implemented by the profiler.
JVM_MONITOR_THREADS 0x100 Send event notification when a Java thread is about to be created or destroyed. The Microsoft VM will call the NotifyEvent method implemented by the profiler. If the IJavaEventMonitor2 interface is implemented by the profiler, the Microsoft VM will also call the NotifyEvent2 method when a thread's name has been set.
JVM_MONITOR_SAMPLING 0x200 Changes the behavior of the Microsoft VM to improve the accuracy of sampling. Note that this event category doesn't generate any additional event notifications, but improves the accuracy of the SampleThreadLocation method implemented by the Microsoft VM. Specifying this event category slows down the execution of non-JIT compiled methods, but improves the accuracy of the sampling data for these methods.
JVM_MONITOR_EXCEPTION_UNWIND 0x400 Send event notification when a Java exception is about to be thrown past a stack frame. If the IJavaEventMonitor2 interface is implemented by the profiler, the Microsoft VM will call the NotifyEvent2 method.
JVM_MONITOR_SPECIFIC_METHOD_CALLS 0x800 Send event notification when specific methods are called. The Microsoft VM will call the MethodEntry and MethodExit methods implemented by the profiler. If the IJavaEventMonitor2 interface is implemented by the profiler, the Microsoft VM will call the MethodExit2 method rather than MethodExit.
ALL_JVM_MONITOR_EVENTS 0xFFF Send event notification on all event categories.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.