Analyzing trace data with Perfetto
In another article, you learned
how to capture a trace using the Utilities menu found on your wearable. Taking it one step further, this guide will help you understand where to find those traces and how to get the most out of the information you’ve captured. We’ve also include a handy guide to
Perfetto Tool Keyboard shortcuts that you can reference while working within
Perfetto.
By the end of this user guide, you’ll know how to:
- Download a trace file
- View a trace file
- Examine a process
- Control how you see traces
- Examine network costs
- Examine scripting costs
- Examine rendering costs
The first step in analyzing traces is downloading them once they’ve been captured.
- Access the performance trace files from the Horizon Creator portal.
- The most recent trace is at the top of the page.
- Select the trace file to download.
To view a trace file, drag the file onto the Perfetto UI.
- Main Thread: Select the collapsible arrow Process XXXX. You should see the main thread and script actions and events to better understand performance.
- Rendering Metrics: Select the collapsible arrow Process 10101010 and should see the rendering threads.
- Audio Thread: Select the collapsible arrow Process 20202020 and you should see the audio thread.
- UI/ReactVR: Select the collapsible arrow Process 30303030 and you should see the UI/React VR threads.
- Hardware and GPU: Select the collapsible arrow Process 40404040 and you should see hardware and memory threads.
- Use CTRL + mouse wheel or the w/s keys on the keyboard to zoom in and zoom out on the specific thread and event. Use the a/d keys to pan left and right, respectively.
- Use the Search input box at the top of the Prefetto UI tool to find a thread or process.
- Selecting an event on the thread to get more information, such as:
- Name
- Sampler category
- Rendering
- Scripting
- Networking
- Sampler Start time
- Duration
- Process ID
Any sampler block name with the string Vert in it is related to the networking category. You might need to debug this when there are too many network calls or too many dynamic entities, such as position, color, or changing states at a rapid rate. Networking blocks have the following names:
- NuVertsNetworkTransformManager
- Verts
Select a script sampler block to inspect its scripted actions or events for details. Scripting blocks have the following names:
- ScriptingRuntimeIntegration
- ScriptMessage
- ScriptEvent
- ScriptAction
For rendering information, select a sampler block, such as MainCamera, Sunlight, or BatchManager. The block shows Rendering as the category in the detail pane.