1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Store sampling period.

This commit is contained in:
Bartosz Taudul
2020-02-25 23:08:52 +01:00
parent 3402d16548
commit 2b7f5091f1
4 changed files with 7 additions and 4 deletions
+3 -2
View File
@@ -160,7 +160,7 @@ void WINAPI EventRecordCallback( PEVENT_RECORD record )
}
}
bool SysTraceStart()
bool SysTraceStart( int64_t& samplingPeriod )
{
s_pid = GetCurrentProcessId();
@@ -191,6 +191,7 @@ bool SysTraceStart()
interval.Interval = 1250; // 8 kHz
const auto intervalStatus = TraceSetInformation( 0, TraceSampledProfileIntervalInfo, &interval, sizeof( interval ) );
if( intervalStatus != ERROR_SUCCESS ) return false;
samplingPeriod = 125*1000;
}
const auto psz = sizeof( EVENT_TRACE_PROPERTIES ) + sizeof( KERNEL_LOGGER_NAME );
@@ -523,7 +524,7 @@ void SysTraceInjectPayload()
}
#endif
bool SysTraceStart()
bool SysTraceStart( int64_t& samplingPeriod )
{
if( !TraceWrite( TracingOn, sizeof( TracingOn ), "0", 2 ) ) return false;
if( !TraceWrite( CurrentTracer, sizeof( CurrentTracer ), "nop", 4 ) ) return false;