payload.GetSize(),
(pThread == NULL) ? NULL : pActivityId,
pRelatedActivityId);
+ pInstance->EnsureStack(session); // TODO: Perform the stackwalk before the constructor
// Copy the stack if a separate stack trace was provided.
if(pStack != NULL)
instancePayloadSize,
NULL /* pActivityId */,
NULL /* pRelatedActivityId */);
+ _ASSERTE(!m_pMetadataEvent->NeedStack());
// Set the timestamp to match the source event, because the metadata event
// will be emitted right before the source event.
#endif // _DEBUG
m_pEvent = &event;
m_threadID = threadID;
- if(pActivityId != NULL)
+ if (pActivityId != NULL)
{
m_activityId = *pActivityId;
}
{
m_activityId = {0};
}
- if(pRelatedActivityId != NULL)
+ if (pRelatedActivityId != NULL)
{
m_relatedActivityId = *pRelatedActivityId;
}
m_dataLength = length;
QueryPerformanceCounter(&m_timeStamp);
_ASSERTE(m_timeStamp.QuadPart > 0);
+#ifdef _DEBUG
+ EnsureConsistency();
+#endif // _DEBUG
+}
- if(event.NeedStack() && !session.RundownEnabled())
+void EventPipeEventInstance::EnsureStack(const EventPipeSession &session)
+{
+ if (m_pEvent->NeedStack() && !session.RundownEnabled())
{
EventPipe::WalkManagedStackForCurrentThread(m_stackContents);
}
-
-#ifdef _DEBUG
- EnsureConsistency();
-#endif // _DEBUG
}
unsigned int EventPipeEventInstance::GetAlignedTotalSize() const
EventPipeEventInstance(EventPipeSession &session, EventPipeEvent &event, DWORD threadID, BYTE *pData, unsigned int length, LPCGUID pActivityId, LPCGUID pRelatedActivityId);
+ void EnsureStack(const EventPipeSession &session);
+
StackContents* GetStack()
{
LIMITED_METHOD_CONTRACT;