mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Implement suspend/resume/is_active for C++/C APIs
This commit is contained in:
parent
69c541e594
commit
ae9bdd6721
@ -4987,6 +4987,16 @@ TRACY_API int32_t ___tracy_profiler_started( void )
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
TRACY_API void ___tracy_suspend( void ) {
|
||||||
|
tracy::GetProfiler().Suspend();
|
||||||
|
}
|
||||||
|
TRACY_API void ___tracy_resume( void ) {
|
||||||
|
tracy::GetProfiler().Resume();
|
||||||
|
}
|
||||||
|
TRACY_API int32_t ___tracy_is_active( void ) {
|
||||||
|
return static_cast<int32_t>( tracy::GetProfiler().IsActive() );
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -126,6 +126,10 @@
|
|||||||
#define TracyFiberEnterHint(x,y)
|
#define TracyFiberEnterHint(x,y)
|
||||||
#define TracyFiberLeave
|
#define TracyFiberLeave
|
||||||
|
|
||||||
|
#define TracySuspend
|
||||||
|
#define TracyResume
|
||||||
|
#define TracyIsActive
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -249,6 +253,10 @@
|
|||||||
# define TracyFiberLeave tracy::Profiler::LeaveFiber()
|
# define TracyFiberLeave tracy::Profiler::LeaveFiber()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define TracySuspend tracy::GetProfiler().Suspend()
|
||||||
|
#define TracyResume tracy::GetProfiler().Resume()
|
||||||
|
#define TracyIsActive tracy::GetProfiler().IsActive()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -119,6 +119,10 @@ typedef const void* TracyCLockCtx;
|
|||||||
# define TracyCFiberLeave
|
# define TracyCFiberLeave
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define TracySuspend
|
||||||
|
#define TracyResume
|
||||||
|
#define TracyIsActive
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#ifndef TracyConcat
|
#ifndef TracyConcat
|
||||||
@ -375,6 +379,14 @@ TRACY_API void ___tracy_fiber_leave( void );
|
|||||||
# define TracyCFiberLeave ___tracy_fiber_leave();
|
# define TracyCFiberLeave ___tracy_fiber_leave();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
TRACY_API void ___tracy_suspend( void );
|
||||||
|
TRACY_API void ___tracy_resume( void );
|
||||||
|
TRACY_API int32_t ___tracy_is_active( void );
|
||||||
|
|
||||||
|
#define TracySuspend ___tracy_suspend( void );
|
||||||
|
#define TracyResume ___tracy_resume( void );
|
||||||
|
#define TracyIsActive ___tracy_is_active( void );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user