Share via


Win32_PerfFormattedData_PerfProc_Thread class

The Win32_PerfFormattedData_PerfProc_Thread formatted data class provides pre-calculated data from performance counters that monitor aspects of thread behavior. A thread is the basic object that executes instructions on a processor. All running processes have at least one thread.

This class represents the Thread object in System Monitor and returns the same data found in System Monitor. This class derives its raw data from the corresponding raw class Win32_PerfRawData_PerfProc_Thread. The original data source is the PerfProc performance library. Data is dynamically provided for this class from the performance library object by the WmiPerfInst provider.

Windows Server 2003 and Windows XP: WMI data for this class is supplied by the Formatted Performance Data Provider.

The following syntax is simplified from MOF code and shows all inherited properties, including the Frequency and Timestamp properties required for class display in System Monitor. For more information about required property qualifiers, see Property Qualifiers for Performance Counter Classes. For more information about CounterType values, see WMI Performance Counter Types.

Syntax

class Win32_PerfFormattedData_PerfProc_Thread : Win32_PerfFormattedData
{
  string Caption;
  uint32 ContextSwitchesPerSec;
  string Description;
  uint64 ElapsedTime;
  uint64 Frequency_Object;
  uint64 Frequency_PerfTime;
  uint64 Frequency_Sys100NS;
  uint32 IDProcess;
  uint32 IDThread;
  string Name;
  uint64 PercentPrivilegedTime;
  uint64 PercentProcessorTime;
  uint64 PercentUserTime;
  uint32 PriorityBase;
  uint32 PriorityCurrent;
  uint32 StartAddress;
  uint32 ThreadState;
  uint32 ThreadWaitReason;
  uint64 Timestamp_Object;
  uint64 Timestamp_PerfTime;
  uint64 Timestamp_Sys100NS;
};

Members

The Win32_PerfFormattedData_PerfProc_Thread class has these types of members:

  • Properties

Properties

The Win32_PerfFormattedData_PerfProc_Thread class has these properties.

Caption

Data type: string

Access type: Read-only

Short textual description for the statistic or metric. This property is inherited from CIM_StatisticalInformation.

ContextSwitchesPerSec

Data type: uint32

Access type: Read-only

Qualifiers: CookingType ("PERF_COUNTER_COUNTER") , Counter ("ContextSwitchesPerSec") , PerfTimeStamp ("Timestamp_PerfTime") , PerfTimeFreq ("Frequency_PerfTime")

Rate of switches from one thread to another. Thread switches can occur either inside of a single process or across processes. A thread switch can be caused either by one thread asking another for information, or by a thread being preempted by another, higher-priority thread becoming ready to run. The operating system uses process boundaries for subsystem protection, in addition to the traditional protection of user and privileged modes. These subsystem processes provide additional protection. Therefore, some work done by the operating system on behalf of an application appears in other subsystem processes in addition to the privileged time in the application. Switching to the subsystem process causes one context switch in the application thread. Switching back causes another context switch in the subsystem thread.

Description

Data type: string

Access type: Read-only

Textual description of the statistic or metric. This property is inherited from CIM_StatisticalInformation.

ElapsedTime

Data type: uint64

Access type: Read-only

Qualifiers: CookingType ("PERF_ELAPSED_TIME") , Counter ("ElapsedTime") , PerfTimeStamp ("Timestamp_PerfTime") , PerfTimeFreq ("Frequency_PerfTime")

Total elapsed time, in seconds, that this thread has been running.

For more information about using uint64 values in scripts, see Scripting in WMI.

Frequency_Object

Data type: uint64

Access type: Read-only

Frequency, in ticks per second, of Timestamp_Object. This property is defined by the provider. This property is inherited from Win32_Perf.

For more information about using uint64 values in scripts, see Scripting in WMI.

Frequency_PerfTime

Data type: uint64

Access type: Read-only

Frequency, in ticks per second, of Timestamp_Perftime. A value could be obtained by calling the Windows function QueryPerformanceCounter. This property is inherited from Win32_Perf.

For more information about using uint64 values in scripts, see Scripting in WMI.

Frequency_Sys100NS

Data type: uint64

Access type: Read-only

Frequency, in ticks per second, of Timestamp_Sys100NS (10000000). This property is inherited from Win32_Perf.

For more information about using uint64 values in scripts, see Scripting in WMI.

IDProcess

Data type: uint32

Access type: Read-only

Qualifiers: CookingType ("PERF_COUNTER_RAWCOUNT") , Counter ("IDProcess") , PerfTimeStamp ("Timestamp_PerfTime") , PerfTimeFreq ("Frequency_PerfTime")

Unique identifier of this process. Values for this property are reused, so they only identify a process for the lifetime of that process.

IDThread

Data type: uint32

Access type: Read-only

Qualifiers: CookingType ("PERF_COUNTER_RAWCOUNT") , Counter ("IDThread") , PerfTimeStamp ("Timestamp_PerfTime") , PerfTimeFreq ("Frequency_PerfTime")

Unique identifier of this thread. Values for this property are reused, so they only identify a thread for the lifetime of that thread.

Name

Data type: string

Access type: Read-only

Qualifiers: Key, MaxLen (256)

Label by which the statistic or metric is known. When sub-classed, the property can be overridden to be a key property. This property is inherited from CIM_StatisticalInformation.

PercentPrivilegedTime

Data type: uint64

Access type: Read-only

Qualifiers: CookingType ("PERF_100NSEC_TIMER") , Counter ("PercentPrivilegedTime") , PerfTimeStamp ("TimeStamp_Sys100NS") , PerfTimeFreq ("Frequency_Sys100NS")

Percentage of non-idle processor time spent in privileged mode. (Privileged mode is a processing mode designed for operating system components and hardware-manipulating drivers. It allows direct access to hardware and all memory. The alternative, user mode, is a restricted processing mode designed for applications, environment subsystems, and integral subsystems. The operating system switches application threads to privileged mode to access operating system services.) This property includes time servicing interrupts and DPCs (deferred procedure calls). A high rate of privileged time might be attributable to a large number of interrupts generated by a failing device. This property displays the average busy time as a percentage of the sample time.

For more information about using uint64 values in scripts, see Scripting in WMI.

PercentProcessorTime

Data type: uint64

Access type: Read-only

Qualifiers: CookingType ("PERF_100NSEC_TIMER") , Counter ("PercentProcessorTime") , PerfTimeStamp ("TimeStamp_Sys100NS") , PerfTimeFreq ("Frequency_Sys100NS")

Percentage of time that the processor is executing a non-idle thread. This property was designed as a primary indicator of processor activity. It is calculated by measuring the time that the processor spends executing the thread of the idle process in each sample interval, and subtracting that value from 100%. (Each processor has an idle thread which consumes cycles when no other threads are ready to run.) It can be viewed as the percentage of the sample interval spent doing useful work. This property displays the average percentage of busy time observed during the sample interval. It is calculated by monitoring the time the service was inactive, and then subtracting that value from 100%.

For more information about using uint64 values in scripts, see Scripting in WMI.

PercentUserTime

Data type: uint64

Access type: Read-only

Qualifiers: CookingType ("PERF_100NSEC_TIMER") , Counter ("PercentUserTime") , PerfTimeStamp ("TimeStamp_Sys100NS") , PerfTimeFreq ("Frequency_Sys100NS")

Percentage of non-idle processor time spent in user mode. User mode is a restricted processing mode designed for applications, environment subsystems, and integral subsystems. The alternative, privileged mode, is designed for operating system components and allows direct access to hardware and all memory. The operating system switches application threads to privileged mode to access operating system services. This property displays the average busy time as a percentage of the sample time.

For more information about using uint64 values in scripts, see Scripting in WMI.

PriorityBase

Data type: uint32

Access type: Read-only

Qualifiers: CookingType ("PERF_COUNTER_RAWCOUNT") , Counter ("PriorityBase") , PerfTimeStamp ("Timestamp_PerfTime") , PerfTimeFreq ("Frequency_PerfTime")

Current base priority of this thread. The system can raise the thread's dynamic priority above the base priority if the thread is handling user input, or lower it toward the base priority if the thread starts executing a CPU-intensive computation.

PriorityCurrent

Data type: uint32

Access type: Read-only

Qualifiers: CookingType ("PERF_COUNTER_RAWCOUNT") , Counter ("PriorityCurrent") , PerfTimeStamp ("Timestamp_PerfTime") , PerfTimeFreq ("Frequency_PerfTime")

Current dynamic priority of this thread. The system can raise the thread's dynamic priority above the base priority if the thread is handling user input, or lower it toward the base priority if the thread starts executing a CPU-intensive computation.

StartAddress

Data type: uint32

Access type: Read-only

Qualifiers: CookingType ("PERF_COUNTER_RAWCOUNT_HEX") , Counter ("StartAddress") , PerfTimeStamp ("Timestamp_PerfTime") , PerfTimeFreq ("Frequency_PerfTime")

Starting virtual address for this thread.

ThreadState

Data type: uint32

Access type: Read-only

Qualifiers: CookingType ("PERF_COUNTER_RAWCOUNT") , Counter ("ThreadState") , PerfTimeStamp ("Timestamp_PerfTime") , PerfTimeFreq ("Frequency_PerfTime")

Current state of the thread.

Value Meaning
0 (0x0)

Initialized

Thread is started.

1 (0x1)

Ready

Waiting for a processor because none are free.

2 (0x2)

Running

Using a processor.

3 (0x3)

Standby

About to use a processor.

4 (0x4)

Terminated

Thread has been ended.

5 (0x5)

Wait

Not ready for a processor because the thread is waiting for a peripheral operation to complete or a resource to become free.

6 (0x6)

Transition

Waiting for a resource to execute, such as waiting for the thread's execution stack to be paged in from disk.

7 (0x7)

Unknown

State of the thread cannot be determined by the system

 

ThreadWaitReason

Data type: uint32

Access type: Read-only

Qualifiers: CookingType ("PERF_COUNTER_RAWCOUNT") , Counter ("ThreadWaitReason") , PerfTimeStamp ("Timestamp_PerfTime") , PerfTimeFreq ("Frequency_PerfTime")

This property is only applicable when the thread is in the Wait state (see ThreadState.)

Value Meaning
0 (0x0)

Executive

1 (0x1)

Free page

2 (0x2)

Page In

3 (0x3)

Pool allocation

4 (0x4)

Execution delay

5 (0x5)

Suspended condition

6 (0x6)

User request

7 (0x7)

Executive

8 (0x8)

Free page

9 (0x9)

Page In

10 (0xA)

Pool allocation

11 (0xB)

Execution delay

12 (0xC)

Suspended condition

13 (0xD)

User request

14 (0xE)

Event Pair High *

15 (0xF)

Event Pair Low *

16 (0x10)

LPC Receive

17 (0x11)

LPC Reply

18 (0x12)

Virtual Memory

19 (0x13)

Page Out

20 and higher (0x14)

not assigned

 

* Event pairs are used to communicate with protected subsystems.

Timestamp_Object

Data type: uint64

Access type: Read-only

Object-defined timestamp, defined by the provider. This property is inherited from Win32_Perf.

For more information about using uint64 values in scripts, see Scripting in WMI.

Timestamp_PerfTime

Data type: uint64

Access type: Read-only

High-performance counter timestamp. A value could be obtained by calling the Windows function QueryPerformanceCounter. This property is inherited from Win32_Perf.

For more information about using uint64 values in scripts, see Scripting in WMI.

Timestamp_Sys100NS

Data type: uint64

Access type: Read-only

Timestamp value in 100 nanosecond units. This property is inherited from Win32_Perf.

For more information about using uint64 values in scripts, see Scripting in WMI.

Remarks

All classes derived from Win32_Perf are designed to be used with a refresher object. For more information about how to create and use a refresher object in C++, see Accessing Performance Data in C++. For more information about how to create and use a refresher object using scripts, see Refreshing WMI Data in Scripts.

The performance class and property qualifiers determine how to interpret the class data. For more information, see Class Qualifiers for Performance Counter Classes and Property Qualifiers for Performance Counter Classes.

Examples

For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.

For C++ code examples, see WMI C++ Application Examples.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Namespace

\root\CIMV2

DLL

WmiPerfInst.dll; WmiCookr.dll on Windows Server 2003 and Windows XP

See also

Performance Counter Classes

Accessing WMI Preinstalled Performance Classes

WMI Tasks: Performance Monitoring

Accessing Performance Data in Script