ETW Events in Task Parallel Library and PLINQ

Both the Task Parallel Library and PLINQ generate Event Trace for Windows (ETW) events that you can use to profile and troubleshoot applications by using tools such as the Windows Performance Analyzer. However, in most scenarios, the best way to profile parallel application code is to use the Concurrency Visualizer in Visual Studio Ultimate.

In the EVENT_HEADER structure, the ProviderId GUID for events generated by Parallel.For, Parallel.ForEach and Parallel.Invoke is:

0x2e5dba47, 0xa3d2, 0x4d16, 0x8e, 0xe0, 0x66, 0x71, 0xff, 0xdc, 0xd7, 0xb5

EVENT_DESCRIPTOR.Task = 1

EVENT_DESCRIPTOR.Id = 1

Name

Type

Description

OriginatingTaskSchedulerID

System.Int32

The ID of the TaskScheduler that started the loop.

OriginatingTaskID

System.Int32

The ID of the task that started the loop.

ForkJoinContextID

System.Int32

A unique identifier used to indicate nesting and pairs for events with fork/join semantics.

OperationType

System.Int32

Indicates the type of loop:

1 = ParallelInvoke

2 = ParallelFor

3 = ParallelForEach

InclusiveFrom

System.Int64

The starting value of the loop counter

ExclusiveTo

System.Int64

The ending value of the loop counter

EVENT_DESCRIPTOR.Task = 2

EVENT_DESCRIPTOR.Id = 2

Name

Type

Description

OriginatingTaskSchedulerID

System.Int32

The ID of the TaskScheduler that started the loop.

OriginatingTaskID

System.Int32

The ID of the task that started the loop.

ForkJoinContextID

System.Int32

A unique identifier used to indicate nesting and pairs for events with fork/join semantics.

totalIterations

System.Int64

The total number of iterations

EVENT_DESCRIPTOR.Task = 3

EVENT_DESCRIPTOR.Id = 3

Name

Type

Description

OriginatingTaskSchedulerID

System.Int32

The ID of the TaskScheduler that started the loop.

OriginatingTaskID

System.Int32

The ID of the task that started the loop.

ForkJoinContextID

System.Int32

A unique identifier used to indicate nesting and pairs for events with fork/join semantics.

totalIterations

System.Int64

The total number of iterations

operationType

System.Int32

Indicates the type of loop:

1 = ParallelInvoke

2 = ParallelFor

3 = ParallelForEach

ActionCount

System.Int32

The number of actions that will be executed in the parallel invoke.

EVENT_DESCRIPTOR.Task = 4

EVENT_DESCRIPTOR.Id = 4

Name

Type

Description

OriginatingTaskSchedulerID

System.Int32

The ID of the TaskScheduler that started the loop.

OriginatingTaskID

System.Int32

The ID of the task that started the loop.

ForkJoinContextID

System.Int32

A unique identifier used to indicate nesting and pairs for events with fork/join semantics.

The EVENT_HEADER.ProviderId GUID for PLINQ is:

0x159eeeec, 0x4a14, 0x4418, 0xa8, 0xfe, 0xfa, 0xab, 0xcd, 0x98, 0x78, 0x87

EVENT_DESCRIPTOR.Task = 1

EVENT_DESCRIPTOR.Id = 1

Name

Type

Description

OriginatingTaskSchedulerID

System.Int32

The ID of the TaskScheduler that started the loop.

OriginatingTaskID

System.Int32

The ID of the task that started the loop.

QueryID

System.Int32

A unique query identifier.

EVENT_DESCRIPTOR.Task = 2

EVENT_DESCRIPTOR.Id = 2

Name

Type

Description

OriginatingTaskSchedulerID

System.Int32

The ID of the TaskScheduler that started the loop.

OriginatingTaskID

System.Int32

The ID of the task that started the loop.

QueryID

System.Int32

A unique query identifier.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft