Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

hz-perfetto-debughz 完美调试

Agent Skill

hz-perfetto-debug 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

318

周安装

13

GitHub Stars

31

下载量

102
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:hz-perfetto-debug(hz 完美调试)
来源仓库:https://github.com/meta-quest/agentic-tools
仓库路径:skills/hz-perfetto-debug
安装命令:
npx skills add https://github.com/meta-quest/agentic-tools --skill hz-perfetto-debug
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/meta-quest/agentic-tools --skill hz-perfetto-debug

简介

hz-perfetto-debug 用于查找、检索和筛选相关信息,支持基于关键词的任务场景定位。

  • 适用于性能调试、日志分析和问题排查相关查询。
  • 可在 Codex、Claude、Cursor、Gemini CLI 中快速获取候选结果。
  • 需确认权限范围和维护状态,避免触发联网或文件读写操作。
  • 建议结合来源仓库和原始 README 继续核验具体用法。

SKILL.md

Perfetto Debug Skill

When to Use

Use this skill when investigating VR performance issues on Meta Quest devices:

  • Frame drops, jank, or stuttering
  • CPU or GPU bottlenecks
  • Render pass overhead and GPU utilization
  • Thermal throttling and clock frequency changes
  • Frame timing variance and missed vsync deadlines
  • Thread contention and synchronization issues
  • High draw call counts or overdraw

VR Frame Time Targets

These are the hard deadlines for each refresh rate. If a frame exceeds its target, the compositor must reproject or the user sees a stale frame.

Refresh RateFrame Time BudgetNotes
120 Hz8.3 msSupported on Quest 2, Quest 3, Quest 3S
90 Hz11.1 msSupported on Quest 2, Quest Pro, Quest 3, Quest 3S
72 Hz13.9 msDefault on all Quest devices
60 Hz16.7 msMedia apps only (Quest 2); interactive apps must use 72 Hz+

Missing a frame deadline by even 1 ms causes a stale frame (reprojection). Stale frames above 10% of total frames indicate a serious performance problem.

hzdb Setup

Perfetto tracing is powered by the hzdb CLI. Install once:

npm install -g @meta-quest/hzdb

Verify with hzdb --version. Connect your Quest via USB with developer mode enabled before capturing traces.

Quick Start Workflow

1. Capture a Trace

# Capture a 5-second trace from the currently running VR app
hzdb perf capture

# Specify duration and target app
hzdb perf capture --duration 10000 --app com.example.myapp

# Enable GPU render stage tracing for detailed pass analysis
hzdb perf capture --gpu-render-stage

# Enable XR runtime metrics
hzdb perf capture --xr-runtime

# Custom output name
hzdb perf capture -o my-session-name

The capture auto-detects the foreground VR app if --app is not specified. CPU scheduling and GPU metrics tracing are enabled by default. The trace is pulled to your local machine automatically.

2. List Available Traces

hzdb perf traces

Returns .pftrace files sorted by modification time (newest first). Searches standard directories including ~/Documents, ~/Downloads, and the current working directory.

3. Load a Trace

hzdb perf load <trace-file>

Loads and processes the trace for analysis. Accepts a hex session ID, filename (with or without .pftrace extension), or a full/relative path.

4. Get Performance Overview

hzdb perf context

Returns a structured performance analysis including:

  • CPU and GPU frame timing statistics
  • Thread breakdown with utilization percentages
  • GPU counter summaries (if available)
  • Detected bottlenecks and recommendations

5. Run SQL Queries

hzdb perf query <session-id> "SELECT ts, dur, name FROM slice WHERE name LIKE '%PlayerLoop%' LIMIT 20"

Executes arbitrary SQL against the loaded Perfetto trace database. All Perfetto tables are available: slice, thread_track, thread, process, counter, counter_track, args, sched_slice, and more.

6. Analyze Thread States

hzdb perf thread-state <session-id> <utid>

# With time range
hzdb perf thread-state <session-id> <utid> --start-ts 1000000 --end-ts 5000000000

Returns a thread state breakdown showing how much time the thread spent running, sleeping, blocked, or waiting for CPU. Useful for identifying whether a thread is CPU-bound, I/O-bound, or starved.

7. Get GPU Metrics

hzdb perf gpu-counters <session-id> --start-ts 100,200,300 --end-ts 150,250,350

Returns GPU metric counters (mean, standard deviation, quantiles) for GPU frame ranges. Requires at least 20 frames for statistical accuracy. Metrics include texture fetch rates, shader ALU capacity, vertex processing, and fragment shading statistics.

Detailed Analysis Workflow

Follow these steps in order for a thorough performance investigation.

Step 1: Validate Trace Quality

Before analyzing, confirm the trace is usable:

  • Duration: At least 2 seconds of data (ideally 3-5 seconds)
  • Slice count: Should have thousands of slices for a meaningful trace
  • Process presence: The target app process must be present
SELECT
  (MAX(ts) - MIN(ts)) / 1e9 AS duration_seconds,
  COUNT(*) AS total_slices
FROM slice

If the trace has fewer than 1000 slices or is under 1 second, it may not contain enough data for meaningful analysis. Capture a new trace with hzdb perf capture.

Step 2: Identify Target Process

Find the application process (not system services):

SELECT upid, pid, name
FROM process
WHERE name NOT LIKE 'com.oculus%'
  AND name NOT LIKE '/system%'
  AND name NOT LIKE 'com.android%'
  AND name IS NOT NULL
ORDER BY pid

For known apps, filter directly by package name.

Step 3: Identify Game Engine

Look for engine-specific markers:

EngineKey Markers
UnityPlayerLoop, UnityMain, PhaseSync, PostLateUpdate.FinishRendering
UnrealUGameEngine::Tick, FEngineLoop::Tick, RHI Thread
Native OpenXRxrWaitFrame, xrBeginFrame, xrEndFrame without engine markers

Step 4: Find Key Threads

Identify the threads that matter for VR rendering:

SELECT t.utid, t.tid, t.name, p.name AS process_name
FROM thread t
JOIN process p USING(upid)
WHERE p.name = '<target-process>'
ORDER BY t.name

Critical threads to locate:

ThreadPurpose
Main thread (UnityMain / GameThread)Game logic, physics, scripts
Render thread (UnityGfx / RenderThread)Draw call submission
GPU completion (GPU completion / RHI Thread)GPU fence waiting
Worker threads (Job.Worker / TaskGraph)Parallel workloads

Once you have a thread's utid, use hzdb perf thread-state <session-id> <utid> to get a quick breakdown of its running/sleeping/blocked time.

Step 5: Detect Frame Boundaries

Find frame start/end markers to segment per-frame analysis:

  • Unity: PlayerLoop slices on the main thread define frame boundaries
  • Unreal: FEngineLoop::Tick slices on the game thread
  • OpenXR: xrWaitFrame to xrEndFrame sequences

Step 6: Analyze Expensive Functions

Find what consumes the most time per frame:

SELECT name, COUNT(*) AS call_count, SUM(dur)/1e6 AS total_ms, AVG(dur)/1e6 AS avg_ms
FROM slice
WHERE track_id IN (
  SELECT id FROM thread_track WHERE utid = <main_thread_utid>
)
GROUP BY name
ORDER BY total_ms DESC
LIMIT 20

Step 7: Check High-Frequency Calls

Functions called excessively per frame can indicate batching issues:

SELECT name, COUNT(*) AS calls
FROM slice
WHERE track_id IN (
  SELECT id FROM thread_track WHERE utid = <utid>
)
  AND dur < 100000
GROUP BY name
HAVING calls > 1000
ORDER BY calls DESC

Step 8: Analyze GPU Render Passes

See the GPU analysis reference for detailed render pass breakdown, surface analysis, and GPU counter interpretation.

Key Perfetto Concepts

ConceptDescription
SliceA timed span of execution (function call, frame, render pass). Has ts (start), dur (duration), name, and track_id.
TrackA timeline lane. Thread tracks hold slices for a specific thread. Counter tracks hold metric values over time.
Thread (utid)Unique thread ID within the trace. Use utid (not tid) for joins — tid can be reused.
Process (upid)Unique process ID within the trace. Use upid (not pid) for joins.
TimestampsAll timestamps are in nanoseconds. Divide by 1e6 for milliseconds, 1e9 for seconds.
CounterA time-series metric (GPU utilization, clock frequency, temperature). Stored in the counter table.
ArgsKey-value metadata attached to slices. Accessed via the args table joined on arg_set_id.

Performance Targets

MetricTargetWarningCritical
Frame time (90 Hz)< 11.1 ms> 11.1 ms> 16.7 ms
Stale frame rate< 5%> 10%> 25%
Main thread utilization< 80% of budget> 80%> 95%
GPU utilization< 85% of budget> 85%> 95%
Frame variance (std dev)< 1 ms> 2 ms> 4 ms
Draw calls per frame< 100> 200> 500

Engine-Specific Notes

Unity

  • PhaseSync: VR vsync alignment mechanism. Appears as idle time at the start of PlayerLoop. This is normal and intentional — do NOT flag as wasted time.
  • Single-pass multiview: Both eyes rendered in one pass. If you see two render passes per frame, the app may be using multi-pass rendering (less efficient).
  • Dynamic batching: Watch for high SetPass call counts, which indicate materials are not being batched.
  • IL2CPP vs Mono: IL2CPP builds have different function naming in traces. Look for mangled C++ names instead of C# method names.

Unreal Engine

  • RHI Thread: Unreal uses a separate RHI (Render Hardware Interface) thread for GPU command submission. Check this thread for driver overhead.
  • Forward vs Deferred: Forward rendering is preferred on Quest. Deferred rendering has significantly higher GPU cost.
  • Blueprint Tick: Heavy Blueprint usage shows up as UObject::ProcessEvent. High counts indicate Blueprints should be converted to C++.
  • Nativized Blueprints: Show up with __StaticExec suffix in trace names.

Common Pitfalls

  • Do NOT report PhaseSync or xrWaitFrame idle time as a performance problem — these are intentional frame pacing mechanisms.
  • GPU render pass names like surface#0 are not descriptive — correlate them with the resolution and MSAA level to identify what they render.
  • Thread names can be truncated in traces. UnityMain may appear as UnityMai or similar.
  • Always use utid (not tid) when joining thread-related tables in SQL queries.
  • Timestamps are nanoseconds. A common mistake is treating them as microseconds.
  • Counter values are instantaneous samples, not averages over a period.

References

For detailed guides on specific topics, see:

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.26%
按下载量换算35

Claude

32.05%
按下载量换算33

Cursor

21.49%
按下载量换算22

Gemini CLI

9.75%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills