PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR structure (ntddk.h)

The PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR structure describes the counter resources available on the platform.

Syntax

typedef struct _PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR {
  PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE Type;
  ULONG                                     Flags;
  union {
    ULONG                                       CounterIndex;
    struct {
      ULONG Begin;
      ULONG End;
    } Range;
    PPHYSICAL_COUNTER_OVERFLOW_HANDLER          OverflowHandler;
    PHYSICAL_COUNTER_EVENT_BUFFER_CONFIGURATION EventBufferConfiguration;
    ULONG                                       IdentificationTag;
  } u;
} PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR, *PPHYSICAL_COUNTER_RESOURCE_DESCRIPTOR;

Members

Type

Indicates the type of counter resource described by the structure. Set this parameter to one of the following PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE enumeration constants:

  • ResourceTypeSingle
  • ResourceTypeRange
  • ResourceTypeOverflow
  • ResourceTypeEventBuffer

Flags

No flags are currently defined. Set this member to zero.

u

A union that can contain a CounterIndex, Range, OverflowHandler, or EventBufferConfiguration value.

u.CounterIndex

A physical counter index.

u.Range

A range of counter indexes.

u.Range.Begin

The starting counter index of a block of contiguous counters.

u.Range.End

The ending counter index of a block of contiguous counters.

u.OverflowHandler

A pointer to the driver-supplied PPHYSICAL_COUNTER_OVERFLOW_HANDLER routine that will be called when an associated hardware counter (specified by another PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR) overflows.

u.EventBufferConfiguration

A configuration for event buffer based sampling (such as Intel's PEBS). The configuration fields are defined by the PHYSICAL_COUNTER_EVENT_BUFFER_CONFIGURATION type.

u.IdentificationTag

Remarks

Most processors have performance monitor units that contain a number of hardware counters for measuring various aspects of system performance. The PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR structure describes a counter resource, which can be a single hardware counter, a block of contiguous counters, a counter overflow interrupt, or an event buffer configuration. This structure's Type member indicates which type of counter resource is described by the structure.

To specify a set of counter resources, a kernel-mode client can provide an array of PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR structures. A PHYSICAL_COUNTER_RESOURCE_LIST structure serves as a header for the array. The client can allocate and free the set of counter resources described by the array as a single unit. To do so, the driver calls HalAllocateHardwareCounters and HalFreeHardwareCounters

Requirements

Requirement Value
Minimum supported client Supported in Windows 7 and later versions of Windows.
Header ntddk.h (include Ntddk.h, Ntifs.h)

See also

PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE

PHYSICAL_COUNTER_RESOURCE_LIST