CSwitch Class

[This documentation is preliminary and is subject to change.]

This class is the event type class for context switch events.

The following syntax is simplified from MOF code.

Syntax


[EventType{36}, EventTypeName{"CSwitch"}]
class CSwitch : Thread_V2
{
  uint32 NewThreadId;
  uint32 OldThreadId;
  sint8  NewThreadPriority;
  sint8  OldThreadPriority;
  uint8  PreviousCState;
  sint8  SpareByte;
  sint8  OldThreadWaitReason;
  sint8  OldThreadWaitMode;
  sint8  OldThreadState;
  sint8  OldThreadWaitIdealProcessor;
  uint32 NewThreadWaitTime;
  uint32 Reserved;
};

Methods

The CSwitch class does not define any methods.

Properties

The CSwitch class defines the following properties.

NewThreadId

Data type: uint32

Access type: Read-only

Qualifiers: WmiDataId(1), Format("x")

New thread ID after the switch.

NewThreadPriority

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(3)

Thread priority of the new thread.

NewThreadWaitTime

Data type: uint32

Access type: Read-only

Qualifiers: WmiDataId(11), Format("x")

Wait time for the new thread.

OldThreadId

Data type: uint32

Access type: Read-only

Qualifiers: WmiDataId(2), Format("x")

Previous thread ID.

OldThreadPriority

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(4)

Thread priority of the previous thread.

OldThreadState

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(9)

State of the previous thread. The following are the possible state values:

State Description
0 Initialized
1 Ready
2 Running
3 Standby
4 Terminated
5 Waiting
6 Transition
7 DeferredReady (added for Windows Server 2003)

 

OldThreadWaitIdealProcessor

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(10), Format("x")

Ideal wait time of the previous thread.

OldThreadWaitMode

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(8)

Wait mode for the previous thread.

OldThreadWaitReason

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(7)

Wait reason for the previous thread.

PreviousCState

Data type: uint8

Access type: Read-only

Qualifiers: WmiDataId(5)

The index of the C-state that was last used by the processor. A value of 0 represents the lightest idle state with higher values representing deeper C-states.

Reserved

Data type: uint32

Access type: Read-only

Qualifiers: WmiDataId(12)

Reserved.

SpareByte

Data type: sint8

Access type: Read-only

Qualifiers: WmiDataId(6)

Not used.

Remarks

These events produce a high volume of events.

Requirements

Minimum supported client Windows Vista
Minimum supported server Windows Server 2008

See Also

Thread

Thread_V2

Send comments about this topic to Microsoft

Build date: 5/7/2009