SourcePawn::IProfiler Class Reference

Represents a code profiler for plugins. More...

#include <public/sourcepawn/sp_vm_api.h>

List of all members.

Public Member Functions

virtual void OnNativeBegin (IPluginContext *pContext, sp_native_t *native)=0
 Invoked by the JIT to notify that a native is being started.
virtual void OnNativeEnd ()=0
 Invoked by the JIT to notify that the last native on the stack is no longer being executed.
virtual void OnFunctionBegin (IPluginContext *pContext, const char *name)=0
 Invoked by the JIT to notify that a function call is starting.
virtual void OnFunctionEnd ()=0
 Invoked by the JIT to notify that the last function call has concluded. In the case of an error inside a function, this will not be called. Instead, the VM will call OnCallbackEnd() and the profiler stack must be unwound.
virtual int OnCallbackBegin (IPluginContext *pContext, sp_public_t *pubfunc)=0
 Invoked by the VM to notify that a forward/callback is starting.
virtual void OnCallbackEnd (int serial)=0
 Invoked by the JIT to notify that a callback has ended.


Detailed Description

Represents a code profiler for plugins.

Definition at line 978 of file sp_vm_api.h.


Member Function Documentation

virtual void SourcePawn::IProfiler::OnNativeBegin ( IPluginContext pContext,
sp_native_t native 
) [pure virtual]

Invoked by the JIT to notify that a native is being started.

Parameters:
pContext Plugin context.
native Native information.

virtual void SourcePawn::IProfiler::OnFunctionBegin ( IPluginContext pContext,
const char *  name 
) [pure virtual]

Invoked by the JIT to notify that a function call is starting.

Parameters:
pContext Plugin context.
name Function name, or NULL if not known.
code_addr P-Code address.

virtual int SourcePawn::IProfiler::OnCallbackBegin ( IPluginContext pContext,
sp_public_t pubfunc 
) [pure virtual]

Invoked by the VM to notify that a forward/callback is starting.

Parameters:
pContext Plugin context.
pubfunc Public function information.
Returns:
Unique number to pass to OnFunctionEnd().

virtual void SourcePawn::IProfiler::OnCallbackEnd ( int  serial  )  [pure virtual]

Invoked by the JIT to notify that a callback has ended.

As noted in OnFunctionEnd(), this my be called with a misaligned profiler stack. To correct this, the stack should be unwound (discarding data as appropriate) to a matching serial number.

Parameters:
serial Unique number from OnCallbackBegin().


The documentation for this class was generated from the following file:
Generated on Fri Nov 21 07:10:04 2008 for SourceMod SDK by  doxygen 1.5.1