summaryrefslogtreecommitdiff
path: root/src/System.Private.CoreLib/shared/System/Threading/Tasks
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2019-01-24 17:01:09 -0800
committerGitHub <noreply@github.com>2019-01-24 17:01:09 -0800
commit64e4a7cb99bdd945656846552700dcedb377cb35 (patch)
tree4102af8a00b36d950d850b7916602def516cd39a /src/System.Private.CoreLib/shared/System/Threading/Tasks
parentad03955be542a6ff2501481df676ce3d9e0f427f (diff)
downloadcoreclr-64e4a7cb99bdd945656846552700dcedb377cb35.tar.gz
coreclr-64e4a7cb99bdd945656846552700dcedb377cb35.tar.bz2
coreclr-64e4a7cb99bdd945656846552700dcedb377cb35.zip
Rename TplEtwProvider to TplEventSource (#22194)
* Rename TplEtwProvider to TplEventSource * Rename etwLog to log
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Threading/Tasks')
-rw-r--r--src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs60
-rw-r--r--src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskContinuation.cs36
-rw-r--r--src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskScheduler.cs4
-rw-r--r--src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEventSource.cs (renamed from src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEtwProvider.cs)8
4 files changed, 54 insertions, 54 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs b/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs
index 6f49037284..37fce399de 100644
--- a/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs
+++ b/src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs
@@ -893,7 +893,7 @@ namespace System.Threading.Tasks
Task currentTask = Task.InternalCurrent;
Task parentTask = m_contingentProperties?.m_parent;
- TplEtwProvider.Log.TaskScheduled(ts.Id, currentTask == null ? 0 : currentTask.Id,
+ TplEventSource.Log.TaskScheduled(ts.Id, currentTask == null ? 0 : currentTask.Id,
this.Id, parentTask == null ? 0 : parentTask.Id, (int)this.Options);
}
}
@@ -1209,8 +1209,8 @@ namespace System.Threading.Tasks
}
while (newId == 0);
- if (TplEtwProvider.Log.IsEnabled())
- TplEtwProvider.Log.NewID(newId);
+ if (TplEventSource.Log.IsEnabled())
+ TplEventSource.Log.NewID(newId);
return newId;
}
@@ -2396,18 +2396,18 @@ namespace System.Threading.Tasks
Task previousTask = currentTaskSlot;
// ETW event for Task Started
- var etwLog = TplEtwProvider.Log;
+ var log = TplEventSource.Log;
Guid savedActivityID = new Guid();
- bool etwIsEnabled = etwLog.IsEnabled();
+ bool etwIsEnabled = log.IsEnabled();
if (etwIsEnabled)
{
- if (etwLog.TasksSetActivityIds)
- EventSource.SetCurrentThreadActivityId(TplEtwProvider.CreateGuidForTaskID(this.Id), out savedActivityID);
+ if (log.TasksSetActivityIds)
+ EventSource.SetCurrentThreadActivityId(TplEventSource.CreateGuidForTaskID(this.Id), out savedActivityID);
// previousTask holds the actual "current task" we want to report in the event
if (previousTask != null)
- etwLog.TaskStarted(previousTask.m_taskScheduler.Id, previousTask.Id, this.Id);
+ log.TaskStarted(previousTask.m_taskScheduler.Id, previousTask.Id, this.Id);
else
- etwLog.TaskStarted(TaskScheduler.Current.Id, 0, this.Id);
+ log.TaskStarted(TaskScheduler.Current.Id, 0, this.Id);
}
bool loggingOn = AsyncCausalityTracer.LoggingOn;
@@ -2461,11 +2461,11 @@ namespace System.Threading.Tasks
{
// previousTask holds the actual "current task" we want to report in the event
if (previousTask != null)
- etwLog.TaskCompleted(previousTask.m_taskScheduler.Id, previousTask.Id, this.Id, IsFaulted);
+ log.TaskCompleted(previousTask.m_taskScheduler.Id, previousTask.Id, this.Id, IsFaulted);
else
- etwLog.TaskCompleted(TaskScheduler.Current.Id, 0, this.Id, IsFaulted);
+ log.TaskCompleted(TaskScheduler.Current.Id, 0, this.Id, IsFaulted);
- if (etwLog.TasksSetActivityIds)
+ if (log.TasksSetActivityIds)
EventSource.SetCurrentThreadActivityId(savedActivityID);
}
}
@@ -2874,14 +2874,14 @@ namespace System.Threading.Tasks
}
// ETW event for Task Wait Begin
- var etwLog = TplEtwProvider.Log;
- bool etwIsEnabled = etwLog.IsEnabled();
+ var log = TplEventSource.Log;
+ bool etwIsEnabled = log.IsEnabled();
if (etwIsEnabled)
{
Task currentTask = Task.InternalCurrent;
- etwLog.TaskWaitBegin(
+ log.TaskWaitBegin(
(currentTask != null ? currentTask.m_taskScheduler.Id : TaskScheduler.Default.Id), (currentTask != null ? currentTask.Id : 0),
- this.Id, TplEtwProvider.TaskWaitBehavior.Synchronous, 0);
+ this.Id, TplEventSource.TaskWaitBehavior.Synchronous, 0);
}
// Alert a listening debugger that we can't make forward progress unless it slips threads.
@@ -2912,14 +2912,14 @@ namespace System.Threading.Tasks
Task currentTask = Task.InternalCurrent;
if (currentTask != null)
{
- etwLog.TaskWaitEnd(currentTask.m_taskScheduler.Id, currentTask.Id, this.Id);
+ log.TaskWaitEnd(currentTask.m_taskScheduler.Id, currentTask.Id, this.Id);
}
else
{
- etwLog.TaskWaitEnd(TaskScheduler.Default.Id, 0, this.Id);
+ log.TaskWaitEnd(TaskScheduler.Default.Id, 0, this.Id);
}
// logically the continuation is empty so we immediately fire
- etwLog.TaskWaitContinuationComplete(this.Id);
+ log.TaskWaitContinuationComplete(this.Id);
}
return returnValue;
@@ -3232,11 +3232,11 @@ namespace System.Threading.Tasks
{
Debug.Assert(continuationObject != null);
- TplEtwProvider etw = TplEtwProvider.Log;
- bool tplEtwProviderLoggingEnabled = etw.IsEnabled();
- if (tplEtwProviderLoggingEnabled)
+ TplEventSource log = TplEventSource.Log;
+ bool TplEventSourceLoggingEnabled = log.IsEnabled();
+ if (TplEventSourceLoggingEnabled)
{
- etw.RunningContinuation(Id, continuationObject);
+ log.RunningContinuation(Id, continuationObject);
}
if (AsyncCausalityTracer.LoggingOn)
@@ -3293,9 +3293,9 @@ namespace System.Threading.Tasks
if (continuations[i] is StandardTaskContinuation tc &&
(tc.m_options & TaskContinuationOptions.ExecuteSynchronously) == 0)
{
- if (tplEtwProviderLoggingEnabled)
+ if (TplEventSourceLoggingEnabled)
{
- etw.RunningContinuationList(Id, i, tc);
+ log.RunningContinuationList(Id, i, tc);
}
continuations[i] = null; // so that we can skip this later
tc.Run(this, canInlineContinuations);
@@ -3313,9 +3313,9 @@ namespace System.Threading.Tasks
continue;
}
continuations[i] = null; // to enable free'ing up memory earlier
- if (tplEtwProviderLoggingEnabled)
+ if (TplEventSourceLoggingEnabled)
{
- etw.RunningContinuationList(Id, i, currentContinuation);
+ log.RunningContinuationList(Id, i, currentContinuation);
}
switch (currentContinuation)
@@ -4269,10 +4269,10 @@ namespace System.Threading.Tasks
if ((this.Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0 &&
!(this is ITaskCompletionAction))
{
- var etwLog = TplEtwProvider.Log;
- if (etwLog.IsEnabled())
+ var log = TplEventSource.Log;
+ if (log.IsEnabled())
{
- etwLog.AwaitTaskContinuationScheduled(TaskScheduler.Current.Id, Task.CurrentId ?? 0, continuationTask.Id);
+ log.AwaitTaskContinuationScheduled(TaskScheduler.Current.Id, Task.CurrentId ?? 0, continuationTask.Id);
}
}
diff --git a/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskContinuation.cs b/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskContinuation.cs
index 8933f219f2..034d19d826 100644
--- a/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskContinuation.cs
+++ b/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskContinuation.cs
@@ -394,11 +394,11 @@ namespace System.Threading.Tasks
// Otherwise, Post the action back to the SynchronizationContext.
else
{
- TplEtwProvider etwLog = TplEtwProvider.Log;
- if (etwLog.IsEnabled())
+ TplEventSource log = TplEventSource.Log;
+ if (log.IsEnabled())
{
m_continuationId = Task.NewId();
- etwLog.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, m_continuationId);
+ log.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, m_continuationId);
}
RunCallback(GetPostActionCallback(), this, ref Task.t_currentTask);
}
@@ -411,8 +411,8 @@ namespace System.Threading.Tasks
{
var c = (SynchronizationContextAwaitTaskContinuation)state;
- TplEtwProvider etwLog = TplEtwProvider.Log;
- if (etwLog.TasksSetActivityIds && c.m_continuationId != 0)
+ TplEventSource log = TplEventSource.Log;
+ if (log.TasksSetActivityIds && c.m_continuationId != 0)
{
c.m_syncContext.Post(s_postCallback, GetActionLogDelegate(c.m_continuationId, c.m_action));
}
@@ -427,7 +427,7 @@ namespace System.Threading.Tasks
return () =>
{
Guid savedActivityId;
- Guid activityId = TplEtwProvider.CreateGuidForTaskID(continuationId);
+ Guid activityId = TplEventSource.CreateGuidForTaskID(continuationId);
System.Diagnostics.Tracing.EventSource.SetCurrentThreadActivityId(activityId, out savedActivityId);
try { action(); }
finally { System.Diagnostics.Tracing.EventSource.SetCurrentThreadActivityId(savedActivityId); }
@@ -572,11 +572,11 @@ namespace System.Threading.Tasks
}
else
{
- TplEtwProvider etwLog = TplEtwProvider.Log;
- if (etwLog.IsEnabled())
+ TplEventSource log = TplEventSource.Log;
+ if (log.IsEnabled())
{
m_continuationId = Task.NewId();
- etwLog.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, m_continuationId);
+ log.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, m_continuationId);
}
// We couldn't inline, so now we need to schedule it
@@ -618,19 +618,19 @@ namespace System.Threading.Tasks
void IThreadPoolWorkItem.Execute()
{
- var etwLog = TplEtwProvider.Log;
+ var log = TplEventSource.Log;
ExecutionContext context = m_capturedContext;
- if (!etwLog.IsEnabled() && context == null)
+ if (!log.IsEnabled() && context == null)
{
m_action();
return;
}
Guid savedActivityId = default;
- if (etwLog.TasksSetActivityIds && m_continuationId != 0)
+ if (log.TasksSetActivityIds && m_continuationId != 0)
{
- Guid activityId = TplEtwProvider.CreateGuidForTaskID(m_continuationId);
+ Guid activityId = TplEventSource.CreateGuidForTaskID(m_continuationId);
System.Diagnostics.Tracing.EventSource.SetCurrentThreadActivityId(activityId, out savedActivityId);
}
try
@@ -655,7 +655,7 @@ namespace System.Threading.Tasks
}
finally
{
- if (etwLog.TasksSetActivityIds && m_continuationId != 0)
+ if (log.TasksSetActivityIds && m_continuationId != 0)
{
System.Diagnostics.Tracing.EventSource.SetCurrentThreadActivityId(savedActivityId);
}
@@ -772,7 +772,7 @@ namespace System.Threading.Tasks
// path that already handles this, albeit at the expense of allocating the ATC
// object, and potentially forcing the box's delegate into existence, when logging
// is enabled.
- if (TplEtwProvider.Log.IsEnabled())
+ if (TplEventSource.Log.IsEnabled())
{
UnsafeScheduleAction(box.MoveNextAction, prevCurrentTask);
}
@@ -806,11 +806,11 @@ namespace System.Threading.Tasks
{
AwaitTaskContinuation atc = new AwaitTaskContinuation(action, flowExecutionContext: false);
- var etwLog = TplEtwProvider.Log;
- if (etwLog.IsEnabled() && task != null)
+ var log = TplEventSource.Log;
+ if (log.IsEnabled() && task != null)
{
atc.m_continuationId = Task.NewId();
- etwLog.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, atc.m_continuationId);
+ log.AwaitTaskContinuationScheduled((task.ExecutingTaskScheduler ?? TaskScheduler.Default).Id, task.Id, atc.m_continuationId);
}
ThreadPool.UnsafeQueueUserWorkItemInternal(atc, preferLocal: true);
diff --git a/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskScheduler.cs b/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskScheduler.cs
index 92c358897c..7de42a777b 100644
--- a/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskScheduler.cs
+++ b/src/System.Private.CoreLib/shared/System/Threading/Tasks/TaskScheduler.cs
@@ -197,7 +197,7 @@ namespace System.Threading.Tasks
bool bInlined = false;
try
{
- if (TplEtwProvider.Log.IsEnabled())
+ if (TplEventSource.Log.IsEnabled())
task.FireTaskScheduledIfNeeded(this);
bInlined = TryExecuteTaskInline(task, taskWasPreviouslyQueued);
@@ -252,7 +252,7 @@ namespace System.Threading.Tasks
{
Debug.Assert(task != null);
- if (TplEtwProvider.Log.IsEnabled())
+ if (TplEventSource.Log.IsEnabled())
task.FireTaskScheduledIfNeeded(this);
this.QueueTask(task);
diff --git a/src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEtwProvider.cs b/src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEventSource.cs
index 3e2d42b19c..94f0ec37e8 100644
--- a/src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEtwProvider.cs
+++ b/src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEventSource.cs
@@ -16,7 +16,7 @@ namespace System.Threading.Tasks
,LocalizationResources = "FxResources.System.Private.CoreLib.SR"
#endif
)]
- internal sealed class TplEtwProvider : EventSource
+ internal sealed class TplEventSource : EventSource
{
/// Used to determine if tasks should generate Activity IDs for themselves
internal bool TasksSetActivityIds; // This keyword is set
@@ -49,10 +49,10 @@ namespace System.Threading.Tasks
/// Defines the singleton instance for the TPL ETW provider.
/// The TPL Event provider GUID is {2e5dba47-a3d2-4d16-8ee0-6671ffdcd7b5}.
/// </summary>
- public static readonly TplEtwProvider Log = new TplEtwProvider();
+ public static readonly TplEventSource Log = new TplEventSource();
/// <summary>Prevent external instantiation. All logging should go through the Log instance.</summary>
- private TplEtwProvider() : base(new Guid(0x2e5dba47, 0xa3d2, 0x4d16, 0x8e, 0xe0, 0x66, 0x71, 0xff, 0xdc, 0xd7, 0xb5), "System.Threading.Tasks.TplEventSource") { }
+ private TplEventSource() : base(new Guid(0x2e5dba47, 0xa3d2, 0x4d16, 0x8e, 0xe0, 0x66, 0x71, 0xff, 0xdc, 0xd7, 0xb5), "System.Threading.Tasks.TplEventSource") { }
/// <summary>Configured behavior of a task wait operation.</summary>
public enum TaskWaitBehavior : int
@@ -317,7 +317,7 @@ namespace System.Threading.Tasks
/// If known, if 'TaskID' has a 'continueWith' task, mention give its ID here.
/// 0 means unknown. This allows better visualization of the common sequential chaining case.
/// </param>
- [Event(TASKWAITBEGIN_ID, Version = 3, Task = TplEtwProvider.Tasks.TaskWait, Opcode = EventOpcode.Send,
+ [Event(TASKWAITBEGIN_ID, Version = 3, Task = TplEventSource.Tasks.TaskWait, Opcode = EventOpcode.Send,
Level = EventLevel.Informational, Keywords = Keywords.TaskTransfer | Keywords.Tasks)]
public void TaskWaitBegin(
int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER