Microsoft SDK for Java

IJavaEventMonitorIDInfo2::
GetStackTrace

The GetStackTrace method of the IJavaEventMonitorIDInfo2 interface is called by a profiler to obtain a stack trace for the specified thread. The profiler must pass the thread ID it is interested in. The Microsoft VM will call the NotifyEvent2 method exported by the profiler, enumerating stack traces for the specified thread from the lowest stack frame to the highest.

The GetStackTrace method is implemented only by the IJavaEventMonitorIDInfo2 and IJavaEventMonitorIDInfo3 interfaces.

Syntax

HRESULT GetStackTrace(ThreadID thread_id);

Return Value

E_FAIL if the thread is not in a state in which a stack trace can be obtained. Otherwise, this method call returns the result of the last NotifyEvent2 callback, or S_OK if the stack was empty, or all callbacks return S_OK.

Parameters

[in] thread_id The ThreadID that the profiler is interested in obtaining a stack trace for.

Remarks

Frames are enumerated from lowest to highest through calls to the NotifyEvent2 method implemented by the profiler application. The event type passed to this method will be JVM_EVENT_TYPE2_STACK_TRACE.

The Java thread will be temporarily suspended and no other events will be sent for this thread for the duration of this method. The NotifyEvent2 callback implemented by the profiler should return S_OK to continue enumerating stack frames.

The thread_id parameter can be NULL to indicate the current thread.

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