jvmpi_impl.h

来自「This is a resource based on j2me embedde」· C头文件 代码 · 共 488 行 · 第 1/2 页

H
488
字号
/* Purpose: Checks to see if JVMPI_EVENT_MONITOR_WAITED is enabled. */CVMBool CVMjvmpiEventMonitorWaitedIsEnabled(void);#define CVMjvmpiEventMonitorWaitedIsEnabled() \    CVMjvmpiEventInfoIsEnabled(JVMPI_EVENT_MONITOR_WAITED)/* Purpose: Checks to see if JVMPI_EVENT_GC_START is enabled. */CVMBool CVMjvmpiEventGCStartIsEnabled(void);#define CVMjvmpiEventGCStartIsEnabled() \    CVMjvmpiEventInfoIsEnabled(JVMPI_EVENT_GC_START)/* Purpose: Checks to see if JVMPI_EVENT_GC_FINISH is enabled. */CVMBool CVMjvmpiEventGCFinishIsEnabled(void);#define CVMjvmpiEventGCFinishIsEnabled() \    CVMjvmpiEventInfoIsEnabled(JVMPI_EVENT_GC_FINISH)/* Purpose: Indicate that we have started a GC cycle (independent of whether            actual GC'ing has been blocked or not). */void CVMjvmpiSetGCWasStarted(void);#define CVMjvmpiSetGCWasStarted() \    (CVMjvmpiRec()->gcWasStarted = CVM_TRUE)/* Purpose: Indicate that we have ended a GC cycle which was started. */void CVMjvmpiResetGCWasStarted(void);#define CVMjvmpiResetGCWasStarted() \    (CVMjvmpiRec()->gcWasStarted = CVM_FALSE)/* Purpose: Check if we have started a GC cycle. */CVMBool CVMjvmpiGCWasStarted(void);#define CVMjvmpiGCWasStarted() \    (CVMjvmpiRec()->gcWasStarted)/* Purpose: Indicate that a data dump event has been requested. */void CVMjvmpiSetDataDumpRequested(void);#define CVMjvmpiSetDataDumpRequested() \    (CVMjvmpiRec()->dataDumpRequested = CVM_TRUE)/* Purpose: Clear the pending data dump event request. */void CVMjvmpiResetDataDumpRequested(void);#define CVMjvmpiResetDataDumpRequested() \    (CVMjvmpiRec()->dataDumpRequested = CVM_FALSE)/* Purpose: Check if a data dump was requested. */CVMBool CVMjvmpiDataDumpWasRequested(void);#define CVMjvmpiDataDumpWasRequested() \    (CVMjvmpiRec()->dataDumpRequested)/*=============================================================================    Methods for posting certain JVMPI events to notify the profiler agent that    the corresponding event has occurred or is about to occur in the VM:    NOTE: These methods are to be called from any VM code which need to check          post the appropriate JVMPI event.*//* Purpose: Posts a JVMPI_EVENT_ARENA_NEW event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostArenaNewEvent(CVMUint32 arenaID, const char *name);/* Purpose: Posts a JVMPI_EVENT_ARENA_DELETE event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostArenaDeleteEvent(CVMUint32 arenaID);/* Purpose: Posts a JVMPI_EVENT_CLASS_LOAD event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostClassLoadEvent(CVMExecEnv *ee, const CVMClassBlock *cb);/* Purpose: Posts a JVMPI_CLASS_LOAD_HOOK event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostClassLoadHookEvent(CVMUint8 **buffer, CVMInt32 *bufferLength,                                    void *(*malloc_f)(unsigned int));/* Purpose: Posts a JVMPI_EVENT_CLASS_UNLOAD event. *//* NOTE: Called while GC safe and should be called from within a GC cycle. */void CVMjvmpiPostClassUnloadEvent(CVMClassBlock *cb);/* Purpose: Posts a JVMPI_EVENT_COMPILED_METHOD_LOAD event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostCompiledMethodLoadEvent(CVMExecEnv *ee, CVMMethodBlock *mb);/* Purpose: Posts a JVMPI_EVENT_COMPILED_METHOD_UNLOAD event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostCompiledMethodUnloadEvent(CVMExecEnv *ee, CVMMethodBlock *mb);/* Purpose: Posts the JVMPI_EVENT_DATA_DUMP_REQUEST event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostDataDumpRequest(void);/* Purpose: Posts the JVMPI_EVENT_DATA_RESET_REQUEST event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostDataResetRequest(void);/* Purpose: Posts the JVMPI_EVENT_GC_START event just before GC starts. *//* NOTE: Called while GC safe before GC thread requests all threads to be         safe. */void CVMjvmpiPostGCStartEvent(void);/* Purpose: Posts the JVMPI_EVENT_GC_FINISH event just after GC finishes. *//* NOTE: Called while GC safe before GC thread allows all threads to become         unsafe again. */void CVMjvmpiPostGCFinishEvent(CVMUint32 used_objs, CVMUint32 used_obj_space,                               CVMUint32 total_obj_space);#ifdef CVM_JVMPI_TRACE_INSTRUCTION/* Purpose: Posts a JVMPI_EVENT_INSTRUCTION_START event. *//* NOTE: Called while GC unsafe. */void CVMjvmpiPostInstructionStartEvent(CVMExecEnv *ee, CVMUint8 *pc);/* Purpose: Posts a JVMPI_EVENT_INSTRUCTION_START event for "if" conditional            opcodes. *//* NOTE: Called while GC unsafe. */void CVMjvmpiPostInstructionStartEvent4If(CVMExecEnv *ee, CVMUint8 *pc,                                          CVMBool isTrue);/* Purpose: Posts a JVMPI_EVENT_INSTRUCTION_START event for "tableswitch"            opcodes. *//* NOTE: Called while GC unsafe. */void CVMjvmpiPostInstructionStartEvent4Lookupswitch(CVMExecEnv *ee,        CVMUint8 *pc, CVMInt32 chosenPairIndex, CVMInt32 pairsTotal);/* Purpose: Posts a JVMPI_EVENT_INSTRUCTION_START event for "lookupswitch"            opcodes. *//* NOTE: Called while GC unsafe. */void CVMjvmpiPostInstructionStartEvent4Tableswitch(CVMExecEnv *ee,        CVMUint8 *pc, CVMInt32 key, CVMInt32 low, CVMInt32 hi);#endif /* CVM_JVMPI_TRACE_INSTRUCTION *//* Purpose: Posts a JVMPI_EVENT_JNI_GLOBALREF_ALLOC event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostJNIGlobalrefAllocEvent(CVMExecEnv *ee, jobject ref);/* Purpose: Posts a JVMPI_EVENT_JNI_GLOBALREF_FREE event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostJNIGlobalrefFreeEvent(CVMExecEnv *ee, jobject ref);/* Purpose: Posts a JVMPI_EVENT_JNI_WEAK_GLOBALREF_ALLOC event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostJNIWeakGlobalrefAllocEvent(CVMExecEnv *ee, jobject ref);/* Purpose: Posts a JVMPI_EVENT_JNI_WEAK_GLOBALREF_FREE event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostJNIWeakGlobalrefFreeEvent(CVMExecEnv *ee, jobject ref);/* Purpose: Posts a JVMPI_EVENT_JVM_INIT_DONE event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostJVMInitDoneEvent(void);/* Purpose: Posts a JVMPI Method Entry event. *//* NOTE: Called while GC unsafe. */void CVMjvmpiPostMethodEntryEvent(CVMExecEnv *ee, CVMObjectICell *objICell);/* Purpose: Posts a JVMPI Method Entry event. *//* NOTE: Called while GC unsafe. */void CVMjvmpiPostMethodExitEvent(CVMExecEnv *ee);/* Purpose: Posts a JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTER or            JVMPI_EVENT_MONITOR_CONTENDED_ENTER event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostMonitorContendedEnterEvent(CVMExecEnv *ee,                                            CVMProfiledMonitor *pm);/* Purpose: Posts a JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTERED or            JVMPI_EVENT_MONITOR_CONTENDED_ENTERED event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostMonitorContendedEnteredEvent(CVMExecEnv *ee,                                              CVMProfiledMonitor *pm);/* Purpose: Posts a JVMPI_EVENT_RAW_MONITOR_CONTENDED_EXIT or            JVMPI_EVENT_MONITOR_CONTENDED_EXIT event. *//* NOTE: Can be called while GC safe or unsafe. */void CVMjvmpiPostMonitorContendedExitEvent(CVMExecEnv *ee,                                           CVMProfiledMonitor *pm);/* Purpose: Posts a JVMPI_EVENT_MONITOR_WAIT event.  Sent when a thread is            about to wait on an object. *//* NOTE: Called while GC safe. */void CVMjvmpiPostMonitorWaitEvent(CVMExecEnv *ee, CVMObjectICell *objICell,                                  jlong millis);/* Purpose: Posts a JVMPI_EVENT_MONITOR_WAITED event.  Sent when a thread            finishes waiting on an object. *//* NOTE: Called while GC safe. */void CVMjvmpiPostMonitorWaitedEvent(CVMExecEnv *ee, CVMObjectICell *objICell);/* Purpose: Called by GC routines after it allocates an object to post a            JVMPI_EVENT_OBJECT_ALLOC event. *//* NOTE: CVMjvmpiPostObjectAllocEvent() will fetch the arena ID for the object         from the GC itself.  Hence, the prototype does not require the caller         to pass in the arena ID for the object.  This is done to simplify the         implementation for RequestEvent() because JVMPI_EVENT_OBJECT_ALLOC         can be requested and no arena ID is supplied (which makes sense). *//* NOTE: Called while GC unsafe or while GC is disabled. */void CVMjvmpiPostObjectAllocEvent(CVMExecEnv *ee, CVMObject *obj);/* Purpose: Posts an JVMPI_EVENT_OBJECT_FREE for each object which is about to            be freed. *//* NOTE: Called while in a GC cycle i.e. while GC safe also. */void CVMjvmpiPostObjectFreeEvent(CVMObject *obj);/* Purpose: Posts an JVMPI_EVENT_OBJECT_MORE for each object which has been            moved. *//* NOTE: Called while in a GC cycle i.e. while GC safe also. */void CVMjvmpiPostObjectMoveEvent(CVMUint32 oldArenaID, void *oldobj,                                 CVMUint32 newArenaID, void *newobj);/* Purpose: Posts a JVMPI_EVENT_THREAD_START event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostThreadStartEvent(CVMExecEnv *ee, CVMThreadICell *threadICell);/* Purpose: Posts a JVMPI_EVENT_THREAD_END event. *//* NOTE: Called while GC safe. */void CVMjvmpiPostThreadEndEvent(CVMExecEnv *ee);/*=============================================================================    Methods for initializing and finalizing JVMPI to be called by VM code:*//* Purpose: Gets the JVMPI interface.  Called ONLY from JNI's GetEnv(). */void *CVMjvmpiGetInterface1(void);/* Purpose: Initializes the JVMPI globals. */void CVMjvmpiInitializeGlobals(CVMExecEnv *ee, CVMJvmpiRecord *record);/* Purpose: Destroys the JVMPI globals. */void CVMjvmpiDestroyGlobals(CVMExecEnv *ee, CVMJvmpiRecord *record);/* Purpose: Posts startup events required by JVMPI.  This includes defining            events which transpired prior to the completion of VM            initialization. *//* NOTE: Called while GC safe. */void CVMjvmpiPostStartUpEvents(CVMExecEnv *ee);/* Purpose: Profiler specific initialization, if requested with the            CVM_JVMPI_PROFILER=<profiler> build option: */#ifdef CVM_JVMPI_PROFILERvoid CVMJVMPIprofilerInit(CVMExecEnv *ee);#endif#endif /* CVM_JVMPI */#endif /* !_INCLUDED_JVMPI_IMPL_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?