summaryrefslogtreecommitdiff
path: root/src/vm/eventpipe.cpp
diff options
context:
space:
mode:
authorBrian Robbins <brianrob@microsoft.com>2017-05-25 12:28:24 -0700
committerGitHub <noreply@github.com>2017-05-25 12:28:24 -0700
commit7ca2692405f255ce4a87d2c3ec263d938cf274fc (patch)
treede684f25960d65b51b26797cd5b3f1c4250ae704 /src/vm/eventpipe.cpp
parented1342ba2409cd8bc736380017ee39eaa1701cf2 (diff)
downloadcoreclr-7ca2692405f255ce4a87d2c3ec263d938cf274fc.tar.gz
coreclr-7ca2692405f255ce4a87d2c3ec263d938cf274fc.tar.bz2
coreclr-7ca2692405f255ce4a87d2c3ec263d938cf274fc.zip
Implement Activity ID / Related Activity ID for EventSources Writing to EventPipe (#11904)
* Implement thread-local storage of activity ids. * Plumb the activity id and related activity id into the trace file.
Diffstat (limited to 'src/vm/eventpipe.cpp')
-rw-r--r--src/vm/eventpipe.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/vm/eventpipe.cpp b/src/vm/eventpipe.cpp
index b73c023b64..4eae6a87c6 100644
--- a/src/vm/eventpipe.cpp
+++ b/src/vm/eventpipe.cpp
@@ -282,7 +282,7 @@ void EventPipe::DeleteProvider(EventPipeProvider *pProvider)
}
}
-void EventPipe::WriteEvent(EventPipeEvent &event, BYTE *pData, unsigned int length)
+void EventPipe::WriteEvent(EventPipeEvent &event, BYTE *pData, unsigned int length, LPCGUID pActivityId, LPCGUID pRelatedActivityId)
{
CONTRACTL
{
@@ -309,7 +309,7 @@ void EventPipe::WriteEvent(EventPipeEvent &event, BYTE *pData, unsigned int leng
if(!s_pConfig->RundownEnabled() && s_pBufferManager != NULL)
{
- if(!s_pBufferManager->WriteEvent(pThread, event, pData, length))
+ if(!s_pBufferManager->WriteEvent(pThread, event, pData, length, pActivityId, pRelatedActivityId))
{
// This is used in DEBUG to make sure that we don't log an event synchronously that we didn't log to the buffer.
return;
@@ -323,7 +323,9 @@ void EventPipe::WriteEvent(EventPipeEvent &event, BYTE *pData, unsigned int leng
event,
pThread->GetOSThreadId(),
pData,
- length);
+ length,
+ pActivityId,
+ pRelatedActivityId);
if(s_pFile != NULL)
{
@@ -340,7 +342,9 @@ void EventPipe::WriteEvent(EventPipeEvent &event, BYTE *pData, unsigned int leng
event,
pThread->GetOSThreadId(),
pData,
- length);
+ length,
+ pActivityId,
+ pRelatedActivityId);
// Write to the EventPipeFile if it exists.
if(s_pSyncFile != NULL)
@@ -372,7 +376,7 @@ void EventPipe::WriteSampleProfileEvent(Thread *pSamplingThread, EventPipeEvent
{
// Specify the sampling thread as the "current thread", so that we select the right buffer.
// Specify the target thread so that the event gets properly attributed.
- if(!s_pBufferManager->WriteEvent(pSamplingThread, *pEvent, pData, length, pTargetThread, &stackContents))
+ if(!s_pBufferManager->WriteEvent(pSamplingThread, *pEvent, pData, length, NULL /* pActivityId */, NULL /* pRelatedActivityId */, pTargetThread, &stackContents))
{
// This is used in DEBUG to make sure that we don't log an event synchronously that we didn't log to the buffer.
return;
@@ -577,14 +581,16 @@ void QCALLTYPE EventPipeInternal::WriteEvent(
INT_PTR eventHandle,
unsigned int eventID,
void *pData,
- unsigned int length)
+ unsigned int length,
+ LPCGUID pActivityId,
+ LPCGUID pRelatedActivityId)
{
QCALL_CONTRACT;
BEGIN_QCALL;
_ASSERTE(eventHandle != NULL);
EventPipeEvent *pEvent = reinterpret_cast<EventPipeEvent *>(eventHandle);
- EventPipe::WriteEvent(*pEvent, (BYTE *)pData, length);
+ EventPipe::WriteEvent(*pEvent, (BYTE *)pData, length, pActivityId, pRelatedActivityId);
END_QCALL;
}