monado性能分析系列文章索引汇总:
XR VR AR monado oculus quest pico性能分析工具综述
Monado timing frame pacing frame timing 时间点分析
monado metrics tool离线性能指标工具分析
vr ar xr monado性能分析工具 percetto编译和monado集成
本文是XR性能分析综述,包含Monado Oculus Pico的性能分析方法介绍,关于Monado性能分析的详细介绍,参加后续博文。
https://gitlab.freedesktop.org/monado/utilities/metrics
https://gitlab.freedesktop.org/monado/monado/-/blob/main/doc/metrics.md
@monado/src/external/naopb/monado_metrics.pb.hLaunch the service with the env variable `XRT_METRICS_FILE` set.
XRT_METRICS_FILE=/path/to/file.protobuf monado-service参加metrics源码cmd.py脚本
通常,renderdoc通过hook present函数来捕获帧,以识别应用程序何时完成了帧的渲染。
OpenXR应用程序可能不会显示在窗口中。因此,使用renderdoc API来捕获xrBeginFrame和xrEndFrame之间的应用程序帧。
这允许renderdoc捕获应用程序框架,而不需要修改应用程序。
https://gitlab.freedesktop.org/monado/monado/-/commit/c162ff655b3b076fa15d21b9532f7864cb74161c
oxr_xrBeginFrame() {Monado has two tracing backends, one based on PerCetto and the other based on Tracy.
https://github.com/olvaffe/percetto
PerCetto is a minimal C wrapper for Perfetto SDK to enable app-specific tracing.
https://github.com/olvaffe/percetto/blob/main/examples/timestamps.c
// u_trace_marker.c/.hhttps://gitlab.freedesktop.org/monado/monado/-/blob/main/doc/tracing-tracy.md
https://github.com/wolfpld/tracy
https://perfetto.dev/ System profiling, app tracing and trace analysis
https://perfetto.dev/docs/tracing-101
Tracing和Profiling是两种用于性能分析的广泛使用的技术。Perfetto是一套开源工具,结合了tracing和profiling,为用户提供了对其系统的强大洞察。
跟踪包括收集关于系统执行的非常详细的数据。
跟踪包含足够的细节来完全重建事件的时间轴。它们通常包括低级内核事件,如调度器上下文切换、线程唤醒、系统调用等。有了“正确的”跟踪,就不需要重现性能错误,因为跟踪提供了所有必要的上下文。
@u_pacing_compositor.c -> do_tracing()
指标是高级概念,跟踪系统在一段时间内的性能,如CPU、内存使用率,网络带宽等,在程序运行时直接从应用程序或操作系统收集。
指标可以从trace数据分析得到,但对于线上环境,使用trace数据过于庞大(MB),一般直接进行指标分析(字节级)
日志用于功能测试;Tracing用于性能分析。
Tracing是结构化的日志,以结构化的方式反映系统的详细状态,以允许重建事件的时间轴。
对资源使用进行抽样,统计分析(如50ms),包括memory profiling和cpu profiling。
Trace不可能捕获极端高频事件的执行,例如每个函数调用。Profiling工具填补了这一生态位:通过抽样,它们可以显著减少存储的信息量。Profiler的统计性质很少是一个问题; Profiler的采样算法是专门为捕获高度代表实际资源使用情况的数据而设计的。
Tracing提供确切的上下文信息。
Perfetto vs Tracy
Tracy 支持Linux和windows,实时查看数据流,只能同时跟踪一个应用程序
Perfetto 支持Linux和安卓,同时执行多个进程和整个系统跟踪
FPS (Compositor)
Frame Times
u_var_add_root(c, "Compositor", true);https://gitlab.freedesktop.org/monado/monado/-/merge_requests/622/diffs?commit_id=30d7001df1532e0b739f8ffaa4520417114630af
/src/xrt/state_trackers/gui/
src/external/imgui/imgui_monado.cpp
PlotTimings
igPlotTimings
_draw_line
_draw_grid
/src/xrt/auxiliary/util/u_var.h
/*!https://github.com/google/agi
https://gpuinspector.dev/
RenderDoc
Metrics Tool
Logcat VrApi日志
Snapdragon Profiler
ovrgpuprofiler
https://news.nweon.com/68288
https://alexdai.notion.site/alexdai/Monitor-Performance-with-OVR-Metrics-Tool-ef69774b6c2d4e3a80610b4c67505680
adb shell am start omms://app
adb shell setprop debug.oculus.omms.enableOverlay true
includes the following metrics:
includes everything in Basic as well as the following metrics:
These statistics include the following:
ovrgpuprofiler
metrics
adb shell am broadcast -n com.oculus.ovrmonitormetricsservice/.SettingsBroadcastReceiver -a com.oculus.ovrmonitormetricsservice.ENABLE_OVERLAY
https://www.youtube.com/watch?v=OjRFr448JSE
OVR Metrics Tool可用于为在安卓设备上运行的Oculus应用程序提供性能指标,包括帧率,热量,GPU和CPU限制值,以及每秒的撕裂和过时帧数,OVR指标工具还提供远程设备管理功能。
报告模式:在VR会话结束后显示有关性能报告,报告数据可以轻松导出为包含PNG图像的CSV。
HUD模式:提供实时性能图表和信息叠加在正在运行应用上,以Overlay形式展示。
Basic
Advanced
Advanced with memory
Advanced with gpu
Advanced with memory and gpu
Display Stats on Overlay
Display Graph on Overlay
Display Debug Data on Overlay
Display App Name on Overlay
https://developer-global.pico-interactive.com/sdk?deviceId=1&platformId=1&itemId=15
v1.2.1 版本更新内容:更新时间:2022-10-09
Update:v1.2.0 版本更新内容:更新时间:2022-07-14
Update:v1.1.0 版本更新内容:更新时间:2022-07-07
New features:v1.0.0 版本更新内容:更新时间:2021-10-13
Features:https://developer-global.pico-interactive.com/document/unity/performance-target
https://developer-cn.pico-interactive.com/document/native/metrics-tool
实时监控监控工具统计的基础指标如下:
指标名称说明GPU Utilization (GPU U)总 GPU 占用率。CPU Utilization (CPU U)CPU 利用率百分比。Average FPS (FPS)帧速率(单位:帧/每秒)。注:一个好的应用程序的帧速率应等于屏幕的刷新率。Available Memory (A MEM)Android 上报的 VR 系统可用内存(单位:MB)。注:在 Android 上,内存是以某种不透明的方式处理的,因此该值仅用于一般指导。例如,如果一个应用程序转到后台,新的前景应用程序和操作系统操作将占用大量内存,可能会导致应用程序崩溃。因此,可利用该指标来监视内存的分配速度是否比预期的快,或者是否没有按预期释放内存。