This page describes how to record and visualize a trace on a Fuchsia device with the Fuchsia tracing system.
Prerequisites Important: Tracing is only enabled forcore
and eng
build types in Fuchsia images. Make sure that the Fuchsia image you use is of core
or eng
build type. In other words, if you're to build a Fuchsia image from the Fuchsia source checkout or download a Fuchsia prebuilt image, make sure that the image's build type is not user
or userdebug
.
Many existing Fuchsia components are already registered as trace providers, whose trace data often provide a sufficient overview of the system. For this reason, if you only need to record a general trace (for instance, to include details in a bug report), you may proceed to the sections below. However, if you want to collect additional, customized trace events from a specific component, you need to complete the following tasks first:
Record a traceTo record a trace on a Fuchsia device from your host machine, run the following command:
ffx trace start --duration <SECONDS>
This command starts a trace with the default settings, capturing a general overview of the target device.
The trace continues for the specified duration (or until the ENTER
key is pressed if a duration is not specified). When the trace is finished, the trace data is automatically saved to the trace.fxt
file in the current directory (which can be changed by specifying the --output
flag; for example, ffx trace start --output <FILE_PATH>
). To visualize the trace results stored in this file, see the Visualize a trace section below.
ffx trace
commands and options, see Record traces for performance analysis. Visualize a trace
Fuchsia trace format (.fxt
) is Fuchsia's binary format that directly encodes the original trace data. To visualize an .fxt
trace file, you can use the Perfetto viewer.
Do the following:
.fxt
file from the host machine.This viewer also allows you to use SQL to query the trace data.
CategoriesCategories allow you to control which events you want to see. For example:
ffx trace start --categories '#default,cat'
ffx trace start --categories "kernel:sched,kernel:meta"
Useful categories kernel:sched + kernel:meta
High granularity overview of what is running on each CPU
kernel:ipcEmit an event for each FIDL call and connect them with flows
kernel:syscallEmit an event for every syscall system wide
gfxView frame timing breakdowns
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-28 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4