mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 23:36:00 +02:00
Profiler changes
This commit is contained in:
parent
3122839ea8
commit
bb73aced22
2 changed files with 48 additions and 2 deletions
42
IDE/include/BeefDbg.h
Normal file
42
IDE/include/BeefDbg.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef BEEFDBG_IMPLEMENTATION
|
||||
|
||||
struct BfDebugMessageData
|
||||
{
|
||||
int mMessageType; // 0 = none, 1 = error
|
||||
int mStackWindbackCount;
|
||||
int mBufParamLen;
|
||||
const char* mBufParam;
|
||||
void* mPCOverride;
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
BfDebugMessageData gBfDebugMessageData;
|
||||
}
|
||||
|
||||
extern "C" __declspec(dllimport) void DebugBreak();
|
||||
|
||||
void BfProfileStart(int sampleRatea = 1000)
|
||||
{
|
||||
char str[128];
|
||||
sprintf(str, "StartSampling\t0\t%d\t0");
|
||||
gBfDebugMessageData.mBufParam = str;
|
||||
gBfDebugMessageData.mBufParamLen = strlen(gBfDebugMessageData.mBufParam);
|
||||
DebugBreak();
|
||||
}
|
||||
|
||||
void BfProfileEnd()
|
||||
{
|
||||
gBfDebugMessageData.mBufParam = "StopSampling\t0";
|
||||
gBfDebugMessageData.mBufParamLen = strlen(gBfDebugMessageData.mBufParam);
|
||||
DebugBreak();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void BfProfileStart(int sampleRatea = 1000);
|
||||
void BfProfileEnd();
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue