Skip to content

Commit 7d28b20

Browse files
committed
add some comments for api functions
1 parent dc26550 commit 7d28b20

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

IntelPresentMon/CommonUtilities/log/DiagnosticDriver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ namespace pmon::util::log
193193
{}
194194
DiagnosticMessage::DiagnosticMessage(const PM_DIAGNOSTIC_MESSAGE& msg)
195195
:
196+
// copies value-based fields, pointers will be set in subsequent SyncBuffers_() call
196197
PM_DIAGNOSTIC_MESSAGE{ msg }
197198
{
198199
if (!msg.pText) {

IntelPresentMon/PresentMonAPI2/PresentMonAPI.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,22 +366,39 @@ extern "C" {
366366
typedef struct PM_FRAME_QUERY* PM_FRAME_QUERY_HANDLE;
367367
typedef struct PM_SESSION* PM_SESSION_HANDLE;
368368

369+
// open a session (connection) to the PresentMon service, outputting a session handle required for most other API calls
369370
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
370372
PRESENTMON_API2_EXPORT PM_STATUS pmOpenSessionWithPipe(PM_SESSION_HANDLE* pHandle, const char* controlPipeName);
373+
// close an existing session by handle, deallocating all associated resources
371374
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
372376
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
373378
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.
374380
PRESENTMON_API2_EXPORT PM_STATUS pmGetIntrospectionRoot(PM_SESSION_HANDLE handle, const PM_INTROSPECTION_ROOT** ppRoot);
381+
// free the introspection tree structure
375382
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
376384
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
377386
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
378388
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
379390
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)
380392
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)
381394
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
382396
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
383398
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
384400
PRESENTMON_API2_EXPORT PM_STATUS pmFreeFrameQuery(PM_FRAME_QUERY_HANDLE handle);
401+
// retrieve the API version of the PresentMon service / middleware DLL
385402
PRESENTMON_API2_EXPORT PM_STATUS pmGetApiVersion(PM_VERSION* pVersion);
386403

387404
#ifdef __cplusplus

0 commit comments

Comments
 (0)