### JIT Compilation Started: `jit cms`
```
-jit cms <threadIid:iid> <timestamp:ms> <functionId:id>
+jit cms <osThreadId:pid> <timestamp:ms> <functionId:id>
```
Notifies that the JIT compiler has started to compile a function.
-* `threadIid` - the Internal ID of the thread running JIT.
+* `osThreadId` - the PID of the operating system thread running JIT.
* `timestamp` - the event timestamp in milliseconds from the start of profiling.
* `functionId` - the ID of the function for which the compilation is starting.
### JIT Compilation Finished: `jit cmf`
```
-jit cmf <threadIid:iid> <timestamp:ms> <functionId:id> <status:hr>
+jit cmf <osThreadId:pid> <timestamp:ms> <functionId:id> <status:hr>
```
Notifies that the JIT compiler has finished compiling a function.
-* `threadIid` - the Internal ID of the thread running JIT.
+* `osThreadId` - the PID of the operating system thread running JIT.
* `timestamp` - the event timestamp in milliseconds from the start of profiling.
* `functionId` - the ID of the function that was compiled.
* `status` - an HRESULT that indicates whether compilation was successful.
### JIT Cached Function Search Started: `jit css`
```
-jit css <threadIid:iid> <timestamp:ms> <functionId:id>
+jit css <osThreadId:pid> <timestamp:ms> <functionId:id>
```
Notifies that a search has started for a function that was compiled previously
using the Native Image Generator (NGen).
-* `threadIid` - the Internal ID of the thread running JIT.
+* `osThreadId` - the PID of the operating system thread running JIT.
* `timestamp` - the event timestamp in milliseconds from the start of profiling.
* `functionId` - the ID of the function for which the search is being performed.
### JIT Cached Function Search Finished: `jit csf`
```
-jit csf <threadIid:iid> <timestamp:ms> <functionId:id>
+jit csf <osThreadId:pid> <timestamp:ms> <functionId:id>
```
Notifies that a search has finished for a function that was compiled previously
using the Native Image Generator (NGen).
-* `threadIid` - the Internal ID of the thread running JIT.
+* `osThreadId` - the PID of the operating system thread running JIT.
* `timestamp` - the event timestamp in milliseconds from the start of profiling.
* `functionId` - the ID of the function for which the search was performed.
### Garbage Collection Started: `gch gcs`
```
-gch gcs <threadIid:iid> <timestamp:ms> <reason:str> <gen_collect:t|f>...
+gch gcs <osThreadId:pid> <timestamp:ms> <reason:str> <gen_collect:t|f>...
```
Notifies that garbage collection has started.
-* `threadIid` - the Internal ID of the thread running JIT.
+* `osThreadId` - the PID of the operating system thread running GC.
* `timestamp` - the event timestamp in milliseconds from the start of profiling.
* `reason` - the reason the garbage collection was induced.
* `induced` - the garbage collection was induced by a Collect method.
### Garbage Collection Finished: `gch gcf`
```
-gch gcf <threadIid:iid> <timestamp:ms>
+gch gcf <osThreadId:pid> <timestamp:ms>
```
Notifies that garbage collection has completed.
-* `threadIid` - the Internal ID of the thread running JIT.
+* `osThreadId` - the PID of the operating system thread running GC.
* `timestamp` - the event timestamp in milliseconds from the start of profiling.
### GC Heap Allocation Table: `gch alt`
HRESULT hr = S_OK;
try
{
- ThreadInfo *pThreadInfo = m_profiler.GetCommonTrace().GetThreadInfo();
TRACE().DumpGarbageCollectionStarted(
- pThreadInfo == nullptr ? InternalID() : pThreadInfo->internalId,
- m_profiler.GetTickCountFromInit(),
- cGenerations,
- generationCollected,
- reason
- );
+ GetCurrentThreadId(), m_profiler.GetTickCountFromInit(),
+ cGenerations, generationCollected, reason);
}
catch (const std::exception &e)
{
HRESULT hr = S_OK;
try
{
- ThreadInfo *pThreadInfo = m_profiler.GetCommonTrace().GetThreadInfo();
TRACE().DumpGarbageCollectionFinished(
- pThreadInfo == nullptr ? InternalID() : pThreadInfo->internalId,
- m_profiler.GetTickCountFromInit()
- );
+ GetCurrentThreadId(), m_profiler.GetTickCountFromInit());
}
catch (const std::exception &e)
{
{
m_functionStorage.lock()->Place(functionId);
- if (m_profiler.GetConfig().LineTraceEnabled)
- {
- this->UpdateCallStackPush(*m_pJitFunctionInfo, 0);
- }
- else
+ // We should not update stack with JIT pseudo-function for not anounced
+ // threads.
+ ThreadInfo *pThreadInfo = m_profiler.GetCommonTrace().GetThreadInfoR();
+ if (pThreadInfo != nullptr)
{
- this->UpdateCallStackPush(*m_pJitFunctionInfo);
+ if (m_profiler.GetConfig().LineTraceEnabled)
+ {
+ this->UpdateCallStackPush(*m_pJitFunctionInfo, 0);
+ }
+ else
+ {
+ this->UpdateCallStackPush(*m_pJitFunctionInfo);
+ }
}
return S_OK;
FunctionID functionId,
bool succeeded)
{
- this->UpdateCallStackPop();
+ // We should not update stack with JIT pseudo-function for not anounced
+ // threads.
+ ThreadInfo *pThreadInfo = m_profiler.GetCommonTrace().GetThreadInfoR();
+ if (pThreadInfo != nullptr)
+ {
+ this->UpdateCallStackPop();
+ }
+
if (!succeeded)
{
HRESULT hr = S_OK;
try
{
- ThreadInfo *pThreadInfo = m_profiler.GetCommonTrace().GetThreadInfo();
TRACE().DumpJITCompilationStarted(
- pThreadInfo == nullptr ? InternalID() : pThreadInfo->internalId,
- m_profiler.GetTickCountFromInit(),
- functionId
- );
+ GetCurrentThreadId(), m_profiler.GetTickCountFromInit(),
+ functionId);
hr = this->JITStarted(functionId);
}
catch (const std::exception &e)
try
{
hr = this->JITFinished(functionId);
- ThreadInfo *pThreadInfo = m_profiler.GetCommonTrace().GetThreadInfo();
TRACE().DumpJITCompilationFinished(
- pThreadInfo == nullptr ? InternalID() : pThreadInfo->internalId,
- m_profiler.GetTickCountFromInit(),
- functionId, hrStatus
- );
+ GetCurrentThreadId(), m_profiler.GetTickCountFromInit(),
+ functionId, hrStatus);
}
catch (const std::exception &e)
{
HRESULT hr = S_OK;
try
{
- ThreadInfo *pThreadInfo = m_profiler.GetCommonTrace().GetThreadInfo();
TRACE().DumpJITCachedFunctionSearchStarted(
- pThreadInfo == nullptr ? InternalID() : pThreadInfo->internalId,
- m_profiler.GetTickCountFromInit(),
- functionId
- );
+ GetCurrentThreadId(), m_profiler.GetTickCountFromInit(),
+ functionId);
hr = this->JITStarted(functionId);
}
catch (const std::exception &e)
{
hr = this->JITFinished(functionId,
result == COR_PRF_CACHED_FUNCTION_FOUND);
- ThreadInfo *pThreadInfo = m_profiler.GetCommonTrace().GetThreadInfo();
TRACE().DumpJITCachedFunctionSearchFinished(
- pThreadInfo == nullptr ? InternalID() : pThreadInfo->internalId,
- m_profiler.GetTickCountFromInit(),
- functionId
- );
+ GetCurrentThreadId(), m_profiler.GetTickCountFromInit(),
+ functionId);
}
catch (const std::exception &e)
{
//
virtual void DumpJITCompilationStarted(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp,
FunctionID functionId) override
{
- m_tracefmt.log("jit cms").id(threadIid).ms(timestamp)
+ m_tracefmt.log("jit cms").pid(osThreadId).ms(timestamp)
.id(functionId);
}
virtual void DumpJITCompilationFinished(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp,
FunctionID functionId,
HRESULT hrStatus) override
{
- m_tracefmt.log("jit cmf").id(threadIid).ms(timestamp)
+ m_tracefmt.log("jit cmf").pid(osThreadId).ms(timestamp)
.id(functionId).hr(hrStatus);
}
virtual void DumpJITCachedFunctionSearchStarted(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp,
FunctionID functionId) override
{
- m_tracefmt.log("jit css").id(threadIid).ms(timestamp)
+ m_tracefmt.log("jit css").pid(osThreadId).ms(timestamp)
.id(functionId);
}
virtual void DumpJITCachedFunctionSearchFinished(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp,
FunctionID functionId) override
{
- m_tracefmt.log("jit csf").id(threadIid).ms(timestamp)
+ m_tracefmt.log("jit csf").pid(osThreadId).ms(timestamp)
.id(functionId);
}
//
virtual void DumpGarbageCollectionStarted(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp,
int cGenerations,
BOOL generationCollected[],
COR_PRF_GC_REASON reason) override
{
auto log = m_tracefmt.log("gch gcs");
- log.id(threadIid).ms(timestamp).str(reason);
+ log.pid(osThreadId).ms(timestamp).str(reason);
log.grps();
for (int i = 0; i < cGenerations; ++i)
{
}
virtual void DumpGarbageCollectionFinished(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp) override
{
- m_tracefmt.log("gch gcf").id(threadIid).ms(timestamp);
+ m_tracefmt.log("gch gcf").pid(osThreadId).ms(timestamp);
}
virtual void DumpGcHeapAllocTable(
//
virtual void DumpJITCompilationStarted(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp,
FunctionID functionId) = 0;
virtual void DumpJITCompilationFinished(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp,
FunctionID functionId,
HRESULT hrStatus) = 0;
virtual void DumpJITCachedFunctionSearchStarted(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp,
FunctionID functionId) = 0;
virtual void DumpJITCachedFunctionSearchFinished(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp,
FunctionID functionId) = 0;
//
virtual void DumpGarbageCollectionStarted(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp,
int cGenerations,
BOOL generationCollected[],
COR_PRF_GC_REASON reason) = 0;
virtual void DumpGarbageCollectionFinished(
- InternalID threadIid,
+ DWORD osThreadId,
DWORD timestamp) = 0;
virtual void DumpGcHeapAllocTable(