@@ -366,22 +366,39 @@ extern "C" {
366
366
typedef struct PM_FRAME_QUERY * PM_FRAME_QUERY_HANDLE;
367
367
typedef struct PM_SESSION * PM_SESSION_HANDLE;
368
368
369
+ // open a session (connection) to the PresentMon service, outputting a session handle required for most other API calls
369
370
PRESENTMON_API2_EXPORT PM_STATUS pmOpenSession (PM_SESSION_HANDLE* pHandle);
371
+ // open a session (connection) to the PresentMon service using a pipe name other than the default one
370
372
PRESENTMON_API2_EXPORT PM_STATUS pmOpenSessionWithPipe (PM_SESSION_HANDLE* pHandle, const char * controlPipeName);
373
+ // close an existing session by handle, deallocating all associated resources
371
374
PRESENTMON_API2_EXPORT PM_STATUS pmCloseSession (PM_SESSION_HANDLE handle);
375
+ // command the service to process and make available frame/metric data for the specified process id
372
376
PRESENTMON_API2_EXPORT PM_STATUS pmStartTrackingProcess (PM_SESSION_HANDLE handle, uint32_t process_id);
377
+ // command the service to cease processing and exporting frame/metric data for the specified process id
373
378
PRESENTMON_API2_EXPORT PM_STATUS pmStopTrackingProcess (PM_SESSION_HANDLE handle, uint32_t process_id);
379
+ // allocate and populate a tree data structure describing the available metrics, devices, etc.
374
380
PRESENTMON_API2_EXPORT PM_STATUS pmGetIntrospectionRoot (PM_SESSION_HANDLE handle, const PM_INTROSPECTION_ROOT** ppRoot);
381
+ // free the introspection tree structure
375
382
PRESENTMON_API2_EXPORT PM_STATUS pmFreeIntrospectionRoot (const PM_INTROSPECTION_ROOT* pRoot);
383
+ // sets the rate at which hardware telemetry (including CPU) is polled on a per-device basis
376
384
PRESENTMON_API2_EXPORT PM_STATUS pmSetTelemetryPollingPeriod (PM_SESSION_HANDLE handle, uint32_t deviceId, uint32_t timeMs);
385
+ // sets the rate at which ETW event buffers are flushed, affecting the delay of frame data reported by PresentMon
377
386
PRESENTMON_API2_EXPORT PM_STATUS pmSetEtwFlushPeriod (PM_SESSION_HANDLE handle, uint32_t periodMs);
387
+ // register a dynamic query used for polling metric data with (optional) statistic processing such as average or percentile
378
388
PRESENTMON_API2_EXPORT PM_STATUS pmRegisterDynamicQuery (PM_SESSION_HANDLE sessionHandle, PM_DYNAMIC_QUERY_HANDLE* pHandle, PM_QUERY_ELEMENT* pElements, uint64_t numElements, double windowSizeMs, double metricOffsetMs);
389
+ // free the resources associated with a registered dynamic query
379
390
PRESENTMON_API2_EXPORT PM_STATUS pmFreeDynamicQuery (PM_DYNAMIC_QUERY_HANDLE handle);
391
+ // poll a dynamic query, writing the query poll results into the specified memory blob (byte buffer)
380
392
PRESENTMON_API2_EXPORT PM_STATUS pmPollDynamicQuery (PM_DYNAMIC_QUERY_HANDLE handle, uint32_t processId, uint8_t * pBlob, uint32_t * numSwapChains);
393
+ // query a static metric immediately, writing the result into the specified memory blob (byte buffer)
381
394
PRESENTMON_API2_EXPORT PM_STATUS pmPollStaticQuery (PM_SESSION_HANDLE sessionHandle, const PM_QUERY_ELEMENT* pElement, uint32_t processId, uint8_t * pBlob);
395
+ // register a frame query used for consuming desired metrics from a queue of frame events
382
396
PRESENTMON_API2_EXPORT PM_STATUS pmRegisterFrameQuery (PM_SESSION_HANDLE sessionHandle, PM_FRAME_QUERY_HANDLE* pHandle, PM_QUERY_ELEMENT* pElements, uint64_t numElements, uint32_t * pBlobSize);
397
+ // consume frame event metric data based on the filter registered with pmRegisterFrameQuery
383
398
PRESENTMON_API2_EXPORT PM_STATUS pmConsumeFrames (PM_FRAME_QUERY_HANDLE handle, uint32_t processId, uint8_t * pBlobs, uint32_t * pNumFramesToRead);
399
+ // free the resources associated with a frame event query
384
400
PRESENTMON_API2_EXPORT PM_STATUS pmFreeFrameQuery (PM_FRAME_QUERY_HANDLE handle);
401
+ // retrieve the API version of the PresentMon service / middleware DLL
385
402
PRESENTMON_API2_EXPORT PM_STATUS pmGetApiVersion (PM_VERSION* pVersion);
386
403
387
404
#ifdef __cplusplus
0 commit comments