The PresentMon/ directory contains source for a standalone console application that uses the
PresentMon SDK to capture and analyze graphics applications, outputting data to the console and/or
CSV file(s).
PresentMon/ 目录包含了一个独立控制台应用程序的源代码,该程序使用了
PresentMon SDK 用于捕获和分析图形应用程序,将数据输出到控制台和/或 CSV 文件。
A binary of the console application is provided in the release, e.g.:
PresentMon-2.3.0-x64.exe.
在发布版本中提供了控制台应用程序的二进制文件,例如:
PresentMon-2.3.0-x64.exe
Capture Target Options 捕获目标选项 | |
---|---|
--process_name name |
Only record processes with the specified exe name. This argument can be repeated to capture multiple processes. 仅记录具有指定 exe 名称的进程。该参数可重复使用以捕获多个进程。 |
--exclude name |
Do not record processes with the specified exe name. This argument can be repeated to exclude multiple processes. 不记录具有指定 exe 名称的进程。此参数可重复使用以排除多个进程。 |
--process_id id |
Only record the process with the specified process ID. 仅记录具有指定进程 ID 的进程。 |
--etl_file path |
Analyze an ETW trace log file instead of the actively running processes. 分析 ETW 跟踪日志文件而非正在运行的进程。 |
Output Options 输出选项 | |
---|---|
--output_file path |
Write CSV output to the specified path. 将 CSV 输出写入指定路径。 |
--output_stdout |
Write CSV output to STDOUT. 将 CSV 输出写入标准输出(STDOUT)。 |
--multi_csv |
Create a separate CSV file for each captured process. 为每个捕获的进程创建单独的 CSV 文件。 |
--no_csv |
Do not create any output CSV file. 不生成任何 CSV 输出文件。 |
--no_console_stats |
Do not display active swap chains and frame statistics in the console. 不在控制台中显示活动的交换链和帧统计信息。 |
--qpc_time |
Output the CPU start time as a performance counter value. 输出 CPU 起始时间作为性能计数器值。 |
--qpc_time_ms |
Output the CPU start time as a performance counter value converted to milliseconds. 输出 CPU 起始时间作为性能计数器值并转换为毫秒。 |
--date_time |
Output the CPU start time as a date and time with nanosecond precision. 以日期和时间格式输出 CPU 起始时间,精确到纳秒。 |
--exclude_dropped |
Exclude frames that were not displayed to the screen from the CSV output. 从 CSV 输出中排除未显示在屏幕上的帧。 |
--v1_metrics |
Output a CSV using PresentMon 1.x metrics. 输出使用 PresentMon 1.x 指标的 CSV 文件。 |
Recording Options 录制选项 | |
---|---|
--hotkey key |
Use the specified key press to start and stop recording. 'key' is of the form MODIFIER+KEY, e.g., "ALT+SHIFT+F11". 使用指定按键组合开始和停止记录。'key'格式为 MODIFIER+KEY,例如"ALT+SHIFT+F11"。 |
--delay seconds |
Wait for specified amount of time before starting to record. If using --hotkey, the delay occurs each time the recording key is pressed. 在开始记录前等待指定的时间。如果使用 --hotkey 参数,每次按下记录键时都会执行该延迟。 |
--timed seconds |
Stop recording after the specified amount of time. 在指定时间后停止录制。 |
--scroll_indicator |
Enable scroll lock while recording. 录制时启用滚动锁定。 |
--track_gpu_video |
Track the video encode/decode portion of GPU work separately from other engines. 单独追踪 GPU 工作中视频编码/解码部分,与其他引擎分开统计。 |
--no_track_display |
Do not track frames all the way to display. 不跟踪帧直到显示。 |
--no_track_input |
Do not track keyboard/mouse clicks impacting each frame. 不追踪影响每帧的键盘/鼠标点击。 |
--no_track_gpu |
Do not track the duration of GPU work in each frame. 不追踪每帧中 GPU 工作的持续时间。 |
Execution Options 执行选项 | |
---|---|
--session_name name |
Use the specified session name instead of the default "PresentMon". This can be used to start multiple captures at the same time, as long as each is using a distinct, case-insensitive name. 使用指定的会话名称替代默认的"PresentMon"。这可用于同时启动多个捕获,只要每个会话使用不同的名称(不区分大小写)。 |
--stop_existing_session |
If a trace session with the same name is already running, stop the existing session before starting a new session. 如果已存在同名跟踪会话,请先停止现有会话再启动新会话。 |
--terminate_existing_session |
If a trace session with the same name is already running, stop the existing session then exit. 如果已存在同名跟踪会话正在运行,则停止现有会话后退出。 |
--restart_as_admin |
If not running with elevated privilege, restart and request to be run as administrator. 如果没有以管理员权限运行,请重新启动并以管理员身份运行。 |
--terminate_on_proc_exit |
Terminate PresentMon when all the target processes have exited. 在所有目标进程退出时终止 PresentMon。 |
--terminate_after_timed |
When using --timed, terminate PresentMon after the timed capture completes. 使用 --timed 参数时,在定时捕获完成后终止 PresentMon。 |
Beta Options 测试版选项 | |
---|---|
--track_frame_type |
Track the type of each displayed frame; requires application and/or driver instrumentation using Intel-PresentMon provider. 跟踪每个显示帧的类型;需要使用 Intel-PresentMon 提供程序对应用程序和/或驱动程序进行检测。 |
--track_hw_measurements |
Tracks HW-measured latency and/or power data coming from a LMT and/or PCAT device. 追踪来自 LMT 和/或 PCAT 设备的硬件测量延迟和/或功耗数据。 |
--track_app_timing |
Track app timines for each displayed frame; requires application and/or driver instrumentation using Intel-PresentMon provider. 跟踪每个显示帧的应用程序时间;需要使用 Intel-PresentMon 提供程序对应用程序和/或驱动程序进行检测。 |
By default, PresentMon creates a CSV file named "PresentMon-<Time>.csv", where "<Time>" is the
creation time in ISO 8601 format. To specify your own output location, use the --output_file PATH
command line argument.
默认情况下,PresentMon 会生成一个名为"PresentMon-<Time>.csv"的 CSV 文件,其中"<Time>"是 ISO 8601 格式的创建时间。若要指定自定义输出路径,请使用 --output_file PATH
参数
命令行参数。
If --multi_csv
is used, then one CSV is created for each process captured and
"-<ProcessName>-<ProcessId>" is appended to the file name.
如果使用了 --multi_csv
参数,则会为每个捕获的进程创建一个 CSV 文件,并在文件名后追加"--"后缀。
If --hotkey
is used, then one CSV is created for each time recording is started and "-<Index>" is
appended to the file name.
如果使用了 --hotkey
参数,则每次开始录制时都会创建一个 CSV 文件,并在文件名后追加"-"符号。
Each row of the CSV represents a frame that an application rendered and presented to the system for display, and each column contains a particular metric value associated with that frame. All time values are in milliseconds.
Default metrics include:
Column Header | Description |
---|---|
Application | The name of the process that generated the frame. |
ProcessID | The process ID of the process that generated the frame. |
SwapChainAddress | The address of the swap chain used to present the frame. |
PresentRuntime | The API used to present the frame. |
SyncInterval | The sync interval provided by the application when presenting the frame. Note: this value may be modified later by the driver, e.g., based on control panel overrides. |
PresentFlags | The present flags provided by the application when presenting the frame. |
AllowsTearing | 1 if partial frames might be displayed on the screen, or 0 if only full frames are displayed. |
PresentMode | The presentation mode used by the system for this frame. See the table below for more details. |
FrameType | Whether the frame was rendered by the application or generated by a driver/SDK. |
CPUStartTime (CPUStartQPC) (CPUStartQPCTime) (CPUStartDateTime) |
The time the CPU started working on this frame. By default, this is the time since recording started unless: • When --qpc_time is used, the value is a performance counter value and the column is named CPUStartQPC.• When --qpc_time_ms is used, the value is the query performance counter value converted to milliseconds and the column is named CPUStartQPCTime.• When --date_time is used, the value is a date and the column is named CPUStartDateTime. |
FrameTime | How long it took from the start of this frame until the CPU started working on the next frame. |
CPUBusy | How long the CPU spent working on this frame before presenting it. |
CPUWait | How long the CPU spent waiting before starting the next frame. |
GPULatency | How long it took from the start of this frame until the GPU started working on it. |
GPUTime | The total amount of time that GPU was working on this frame. |
GPUBusy | How long the GPU was actively working on this frame (i.e., the time during which at least one GPU engine is executing work from the target process). |
GPUWait | How long the GPU was idle while working on this frame. |
VideoBusy | How long the GPU video encode/decode engines were actively working on this frame. |
DisplayLatency | How long it took from the start of this frame until the frame was displayed on the screen. |
DisplayedTime | How long the frame was displayed on the screen, or 'NA' if the frame was not displayed. |
AnimationError | The difference between the previous frame's CPU delta and display delta. |
AnimationTime | The time the CPU started animation work on this frame. |
ClickToPhotonLatency | How long it took from the earliest mouse click that contributed to this frame until this frame was displayed. When supported HW measuring devices are not available, this is the software-visible subset of the full click-to-photon latency and doesn't include: • time spent processing input in the keyboard/controller hardware or drivers (typically a fixed additional overhead), • time spent processing the output in the display hardware or drivers (typically a fixed additional overhead), and • a combination of display blanking interval and scan time (which varies, depending on timing and tearing). |
AllInputToPhotonLatency | How long it took from the earliest keyboard or mouse interaction that contributed to this frame until this frame was displayed. |
InstrumentedLatency | Instrumented Frame Start To Display Latency |
Some metrics are enabled or disabled depending on the command line options:
Command line option | Enabled metrics | Disabled metrics |
---|---|---|
--track_frame_type |
FrameType | |
--track_gpu_video |
VideoBusy | |
--no_track_gpu |
GPULatency GPUBusy GPUWait VideoBusy |
|
--no_track_input |
ClickToPhotonLatency | |
--no_track_display (requires --no_track_gpu and --no_track_input as well) |
AllowsTearing PresentMode DisplayLatency DisplayedTime |
|
--v1_metrics |
Most of the above metrics. See a 1.x README.md for details on Presentmon 1.x metrics. |
The following values are used in the PresentMode column:
PresentMode | Description |
---|---|
Hardware: Legacy Flip | Indicates the app took ownership of the screen, and is swapping the displayed surface every frame. |
Hardware: Legacy Copy to front buffer | Indicates the app took ownership of the screen, and is copying new contents to an already-on-screen surface every frame. |
Hardware: Independent Flip | Indicates the app does not have ownership of the screen, but is still swapping the displayed surface every frame. |
Composed: Flip | Indicates the app is windowed, is using "flip model" swapchains, and is sharing its surfaces with DWM to be composed. |
Hardware Composed: Independent Flip | Indicates the app is using "flip model" swapchains, and has been granted a hardware overlay plane. |
Composed: Copy with GPU GDI | Indicates the app is windowed, and is copying contents into a surface that's shared with GDI. |
Composed: Copy with CPU GDI | Indicates the app is windowed, and is copying contents into a dedicated DirectX window surface. GDI contents are stored separately, and are composed together with DX contents by the DWM. |
For more information on the performance implications of these, see: