// ntddk.h
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;
View the official Windows Driver Kit DDI referenceNo description available.
The PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR structure describes the counter resources available on the platform.
TypeIndicates the type of counter resource described by the structure. Set this parameter to one of the following PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE enumeration constants:
FlagsNo flags are currently defined. Set this member to zero.
uA union that can contain a CounterIndex, Range, OverflowHandler, or EventBufferConfiguration value.
u.CounterIndexA physical counter index.
u.Range.BeginThe starting counter index of a block of contiguous counters.
u.Range.EndThe ending counter index of a block of contiguous counters.
u.RangeA range of counter indexes.
u.OverflowHandlerA 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.EventBufferConfigurationA 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.IdentificationTagMost 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
PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE
PHYSICAL_COUNTER_RESOURCE_LIST