Fill out API more.

This commit is contained in:
David Anderson 2014-06-24 01:18:16 -07:00
parent ec61d4d188
commit fac52a2897
4 changed files with 22 additions and 5 deletions

View File

@ -95,7 +95,7 @@ ProfileToolManager::OnRootConsoleCommand2(const char *cmdname, const ICommandArg
} }
g_pSourcePawn2->DisableProfiling(); g_pSourcePawn2->DisableProfiling();
g_pSourcePawn2->SetProfilingTool(nullptr); g_pSourcePawn2->SetProfilingTool(nullptr);
active_->Stop(); active_->Stop(render_help);
active_->RenderHelp(render_help); active_->RenderHelp(render_help);
return; return;
} }

View File

@ -66,9 +66,10 @@ VProfTool::Start()
} }
void void
VProfTool::Stop() VProfTool::Stop(void (*render)(const char *fmt, ...))
{ {
g_VProfCurrentProfile.Stop(); g_VProfCurrentProfile.Stop();
RenderHelp(render);
} }
bool bool
@ -77,6 +78,12 @@ VProfTool::IsActive()
return g_VProfCurrentProfile.IsEnabled(); return g_VProfCurrentProfile.IsEnabled();
} }
bool
VProfTool::IsAttached()
{
return true;
}
intptr_t intptr_t
VProfTool::RegisterCode( VProfTool::RegisterCode(
uintptr_t addr, uintptr_t addr,

View File

@ -43,8 +43,9 @@ public:
const char *Name() KE_OVERRIDE; const char *Name() KE_OVERRIDE;
const char *Description() KE_OVERRIDE; const char *Description() KE_OVERRIDE;
bool Start() KE_OVERRIDE; bool Start() KE_OVERRIDE;
void Stop() KE_OVERRIDE; void Stop(void (*render)(const char *fmt, ...)) KE_OVERRIDE;
bool IsActive() KE_OVERRIDE; bool IsActive() KE_OVERRIDE;
bool IsAttached() KE_OVERRIDE;
intptr_t RegisterCode( intptr_t RegisterCode(
uintptr_t addr, uintptr_t addr,
size_t length, size_t length,

View File

@ -1040,16 +1040,25 @@ namespace SourcePawn
/** /**
* @brief Initiate a stop command. * @brief Initiate a stop command.
*
* @param render Function to render any help messages.
*/ */
virtual void Stop() = 0; virtual void Stop(void (*render)(const char *fmt, ...)) = 0;
/** /**
* @brief Returns whether or not a profiler is active. * @brief Returns whether or not the profiler is currently profiling.
* *
* @return True if active, false otherwise. * @return True if active, false otherwise.
*/ */
virtual bool IsActive() = 0; virtual bool IsActive() = 0;
/**
* @brief Returns whether the profiler is attached.
*
* @return True if attached, false otherwise.
*/
virtual bool IsAttached() = 0;
/** /**
* @brief Registers JIT code with the profiler. * @brief Registers JIT code with the profiler.
* *