Export (0) Print
Expand All
0 out of 5 rated this helpful - Rate this topic

CSwitch class

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;
};

Members

The CSwitch class has these types of members:

Properties

The CSwitch class has these 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:

StateDescription
0Initialized
1Ready
2Running
3Standby
4Terminated
5Waiting
6Transition
7DeferredReady (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. The following are the possible values:

StateDescription
0KernelMode
1UserMode

 

OldThreadWaitReason
Data type: sint8
Access type: Read-only
Qualifiers: WmiDataId(7)

Wait reason for the previous thread. The following are the possible values:

StateDescription
0Executive
1FreePage
2PageIn
3PoolAllocation
4DelayExecution
5Suspended
6UserRequest
7WrExecutive
8WrFreePage
9WrPageIn
10WrPoolAllocation
11WrDelayExecution
12WrSuspended
13WrUserRequest
14WrEventPair
15WrQueue
16WrLpcReceive
17WrLpcReply
18WrVirtualMemory
19WrPageOut
20WrRendezvous
21WrKeyedEvent
22WrTerminated
23WrProcessInSwap
24WrCpuRateControl
25WrCalloutStack
26WrKernel
27WrResource
28WrPushLock
29WrMutex
30WrQuantumEnd
31WrDispatchInt
32WrPreempted
33WrYieldExecution
34WrFastMutex
35WrGuardedMutex
36WrRundown
37MaximumWaitReason

 

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 [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

See also

Thread
Thread_V2

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.