summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2018-10-10 11:45:40 -0400
committerStephen Toub <stoub@microsoft.com>2018-10-10 11:45:40 -0400
commit3535b50fd650032d1a77eff3ef706998d5bead03 (patch)
treeee6607002816bbdcf3095db664a7f749864a2bf9 /src
parentcfe51dd00e069e9fcbee6843e0eee2e80c9b3bd1 (diff)
downloadcoreclr-3535b50fd650032d1a77eff3ef706998d5bead03.tar.gz
coreclr-3535b50fd650032d1a77eff3ef706998d5bead03.tar.bz2
coreclr-3535b50fd650032d1a77eff3ef706998d5bead03.zip
Add Timer duration/period to ThreadTransferSendObj
Diffstat (limited to 'src')
-rw-r--r--src/System.Private.CoreLib/src/System/Diagnostics/Eventing/FrameworkEventSource.cs21
-rw-r--r--src/System.Private.CoreLib/src/System/Threading/Timer.cs2
2 files changed, 15 insertions, 8 deletions
diff --git a/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/FrameworkEventSource.cs b/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/FrameworkEventSource.cs
index 740fff432d..dda0a02a56 100644
--- a/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/FrameworkEventSource.cs
+++ b/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/FrameworkEventSource.cs
@@ -92,14 +92,14 @@ namespace System.Diagnostics.Tracing
[System.Security.SecuritySafeCritical]
#endif // !CORECLR
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
- private unsafe void WriteEvent(int eventId, long arg1, int arg2, string arg3, bool arg4)
+ private unsafe void WriteEvent(int eventId, long arg1, int arg2, string arg3, bool arg4, int arg5, int arg6)
{
if (IsEnabled())
{
if (arg3 == null) arg3 = "";
fixed (char* string3Bytes = arg3)
{
- EventSource.EventData* descrs = stackalloc EventSource.EventData[4];
+ EventSource.EventData* descrs = stackalloc EventSource.EventData[6];
descrs[0].DataPointer = (IntPtr)(&arg1);
descrs[0].Size = 8;
descrs[0].Reserved = 0;
@@ -112,7 +112,13 @@ namespace System.Diagnostics.Tracing
descrs[3].DataPointer = (IntPtr)(&arg4);
descrs[3].Size = 4;
descrs[3].Reserved = 0;
- WriteEventCore(eventId, 4, descrs);
+ descrs[4].DataPointer = (IntPtr)(&arg5);
+ descrs[4].Size = 4;
+ descrs[4].Reserved = 0;
+ descrs[5].DataPointer = (IntPtr)(&arg6);
+ descrs[5].Size = 4;
+ descrs[5].Reserved = 0;
+ WriteEventCore(eventId, 6, descrs);
}
}
}
@@ -664,11 +670,12 @@ namespace System.Diagnostics.Tracing
// 2 - managed async IO operations (FileStream, PipeStream, a.o.)
// 3 - WinRT dispatch operations
// info - any additional information user code might consider interesting
+ // intInfo1/2 - any additional integer information user code might consider interesting
[Event(150, Level = EventLevel.Informational, Keywords = Keywords.ThreadTransfer, Task = Tasks.ThreadTransfer, Opcode = EventOpcode.Send)]
- public void ThreadTransferSend(long id, int kind, string info, bool multiDequeues)
+ public void ThreadTransferSend(long id, int kind, string info, bool multiDequeues, int intInfo1, int intInfo2)
{
if (IsEnabled())
- WriteEvent(150, id, kind, info, multiDequeues);
+ WriteEvent(150, id, kind, info, multiDequeues, intInfo1, intInfo2);
}
// id - is a managed object. it gets translated to the object's address. ETW listeners must
// keep track of GC movements in order to correlate the value passed to XyzSend with the
@@ -677,9 +684,9 @@ namespace System.Diagnostics.Tracing
#if !CORECLR
[System.Security.SecuritySafeCritical]
#endif // !CORECLR
- public unsafe void ThreadTransferSendObj(object id, int kind, string info, bool multiDequeues)
+ public unsafe void ThreadTransferSendObj(object id, int kind, string info, bool multiDequeues, int intInfo1, int intInfo2)
{
- ThreadTransferSend((long)*((void**)JitHelpers.UnsafeCastToStackPointer(ref id)), kind, info, multiDequeues);
+ ThreadTransferSend((long)*((void**)JitHelpers.UnsafeCastToStackPointer(ref id)), kind, info, multiDequeues, intInfo1, intInfo2);
}
// id - represents a correlation ID that allows correlation of two activities, one stamped by
diff --git a/src/System.Private.CoreLib/src/System/Threading/Timer.cs b/src/System.Private.CoreLib/src/System/Threading/Timer.cs
index ddefa6373c..67516de086 100644
--- a/src/System.Private.CoreLib/src/System/Threading/Timer.cs
+++ b/src/System.Private.CoreLib/src/System/Threading/Timer.cs
@@ -566,7 +566,7 @@ namespace System.Threading
else
{
if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.ThreadTransfer))
- FrameworkEventSource.Log.ThreadTransferSendObj(this, 1, string.Empty, true);
+ FrameworkEventSource.Log.ThreadTransferSendObj(this, 1, string.Empty, true, (int)dueTime, (int)period);
success = m_associatedTimerQueue.UpdateTimer(this, dueTime, period);
}