使用以下函数来使用并提供性能数据。
使用者函数
性能数据帮助程序 (PDH) 函数
使用性能数据帮助程序(PDH)函数使用 V1 和 V2 性能数据提供程序中的性能数据。
注意
Windows OneCore 应用无法使用 PDH 函数。 如果要编写 Windows OneCore 应用,请使用 PerfLib V2 使用者函数。
- CounterPathCallBack
- PdhAddCounter
- PdhAddEnglishCounter
- PdhBindInputDataSource
- PdhBrowseCounters
- PdhBrowseCountersH
- PdhCalculateCounterFromRawValue
- PdhCloseLog
- PdhCloseQuery
- PdhCollectQueryData
- PdhCollectQueryDataEx
- PdhCollectQueryDataWithTime
- PdhComputeCounterStatistics
- PdhConnectMachine
- PdhEnumLogSetNames
- PdhEnumMachines
- PdhEnumMachinesH
- PdhEnumObjectItems
- PdhEnumObjectItemsH
- PdhEnumObjects
- PdhEnumObjectsH
- PdhExpandCounterPath
- PdhExpandWildCardPath
- PdhExpandWildCardPathH
- PdhFormatFromRawValue
- PdhGetCounterInfo
- PdhGetCounterTimeBase
- PdhGetDataSourceTimeRange
- PdhGetDataSourceTimeRangeH
- PdhGetDefaultPerfCounter
- PdhGetDefaultPerfCounterH
- PdhGetDefaultPerfObject
- PdhGetDefaultPerfObjectH
- PdhGetDllVersion
- PdhGetFormattedCounterArray
- PdhGetFormattedCounterValue
- PdhGetLogFileSize
- PdhGetRawCounterArray
- PdhGetRawCounterValue
- PdhIsRealTimeQuery
- PdhLookupPerfIndexByName
- PdhLookupPerfNameByIndex
- PdhMakeCounterPath
- PdhOpenLog
- PdhOpenQuery
- PdhOpenQueryH
- PdhParseCounterPath
- PdhParseInstanceName
- PdhReadRawLogRecord
- PdhRemoveCounter
- PdhSelectDataSource
- PdhSetCounterScaleFactor
- PdhSetDefaultRealTimeDataSource
- PdhSetQueryTimeRange
- PdhUpdateLog
- PdhUpdateLogFileCatalog
- PdhValidatePath
- PdhValidatePathEx
PerfLib V2 使用者函数
如果无法使用性能数据帮助程序(PDH)函数,请使用 PerfLib V2 使用者函数从 V2 性能数据提供程序使用性能数据。 编写 OneCore 应用程序以收集 V2 计数器集,或者需要收集具有最少依赖项和开销的特定 V2 计数器集时,可以使用这些函数。
提示
PerfLib V2 使用者函数比性能数据帮助程序(PDH)函数更难使用,并且仅支持从 V2 提供程序收集数据。 对于大多数应用程序,应首选 PDH 函数。
- PerfAddCounters
- PerfCloseQueryHandle
- PerfDeleteCounters
- PerfEnumerateCounterSet
- PerfEnumerateCounterSetInstances
- PerfOpenQueryHandle
- PerfQueryCounterData
- PerfQueryCounterInfo
- PerfQueryCounterSetRegistrationInfo
提供程序函数
PerfLib V2 提供程序函数
V2 性能数据提供程序 使用以下函数:
- AllocateMemory
- ControlCallback
- CounterCleanup
- CounterInitialize
- FreeMemory
- PerfCreateInstance
- PerfDecrementULongCounterValue
- PerfDecrementULongLongCounterValue
- PerfDeleteInstance
- PerfIncrementULongCounterValue
- PerfIncrementULongLongCounterValue
- PerfQueryInstance
- PerfSetCounterSetInfo
- PerfSetULongCounterValue
- PerfSetULongLongCounterValue
- PerfSetCounterRefValue
- PerfStartProvider
- PerfStartProviderEx
- PerfStopProvider
注意
若要安装和卸载 V2 提供程序,请使用 lodctr,并 unlodctr 工具。 LoadPerfCounterTextStrings 和 UnloadPerfCounterTextStrings 函数不能用于安装和卸载 V2 提供程序。
性能 DLL 函数
V1 性能数据提供程序 实现提供以下功能的 DLL:
注意
由于性能和可靠性问题显著,V1 性能数据提供程序已弃用。 尽管仍可以使用性能扩展 DLL 提供计数器数据,但建议改为 创建 V2 提供程序。 还建议将现有 V1 提供程序替换为 V2 提供程序。
可以使用 lodctr 和 unlodctr 工具或通过调用以下函数来安装和卸载 V1 提供程序: