• Home
  • Raw
  • Download

Lines Matching +full:cmdline +full:- +full:tools

3 Perfetto allows you to collect system-wide performance traces from Android
9 Perfetto is based on [platform services](/docs/concepts/service-model.md)
16 # Needed only on Android 9 (P) and 10 (Q) on non-Pixel phones.
23 [Recording a trace through the cmdline](#recording-a-trace-through-the-cmdline)
28 Command line tools (usage examples below in this page):
30 * Using the [`tools/record_android_trace`](/tools/record_android_trace) helper script.
31 …rectly the `/system/bin/perfetto` command on device [[reference](/docs/reference/perfetto-cli.md)].
33 UI tools:
36 * Using the on-device [System Tracing App](https://developer.android.com/topic/performance/tracing/…
46 ![Record page of the Perfetto UI](/docs/images/record-trace.png)
56 ![Perfetto UI with a trace loaded](/docs/images/trace-view.png)
60 ### Recording a trace through the cmdline
64 For the cmdline based workflow you will need the `adb` (Android Debug Bridge)
66 downloaded from https://developer.android.com/studio/releases/platform-tools .
70 We suggest using the `tools/record_android_trace` script to record traces from
72 helps with getting the paths right, auto-pulling the trace once done and opening
77 If you are already familiar with `systrace` or `atrace`, both cmdline tools
78 support a systrace-equivalent syntax:
83 curl -O https://raw.githubusercontent.com/google/perfetto/main/tools/record_android_trace
86 # See ./record_android_trace --help for more
87 ./record_android_trace -o trace_file.perfetto-trace -t 30s -b 64mb \
94 curl -O https://raw.githubusercontent.com/google/perfetto/main/tools/record_android_trace
95 python3 record_android_trace -o trace_file.perfetto-trace -t 30s -b 64mb \
99 **Using the on-device /system/bin/perfetto command**
101 Or, if you want to use directly the on-device binary do instead:
104 adb shell perfetto -o /data/misc/perfetto-traces/trace_file.perfetto-trace -t 20s \
112 interactive PTY-based session via `adb shell`.
113 * On non-rooted devices before Android 12, the config can only be passed as
114 `cat config | adb shell perfetto -c -` (-: stdin) because of over-restrictive
115 SELinux rules. Since Android 12 `/data/misc/perfetto-configs` can be used for
118 `/data/misc/perfetto-traces`. Use
119 `adb shell cat /data/misc/perfetto-traces/trace > trace` to work around.
121 `PID=$(perfetto --background)` and then `kill $PID` to stop.
132 If you are running on a Mac or Linux host, or are using a bash-based terminal
135 WARNING: The below command does not work on Android P because the `--txt` option
138 [_Trace configuration_ page](https://perfetto.dev/docs/concepts/config#pbtx-vs-binary-format).
183 ./record_android_trace -c config.pbtx -o trace_file.perfetto-trace
186 Or alternatively, when using directly the on-device command:
189 cat config.pbtx | adb shell perfetto -c - --txt -o /data/misc/perfetto-traces/trace.perfetto-trace
196 …ell 'cat /data/local/tmp/config.pbtx | perfetto --txt -c - -o /data/misc/perfetto-traces/trace.per…
199 NOTE: because of strict SELinux rules, on non-rooted builds of Android, passing
200 directly the file path as `-c /data/local/tmp/config` will fail, hence the
201 `-c -` + stdin piping above. From Android 12 (S), `/data/misc/perfetto-configs/`
204 Pull the file using `adb pull /data/misc/perfetto-traces/trace ~/trace.perfetto-trace`
208 `/data/misc/perfetto-traces`. Use
209 `adb shell cat /data/misc/perfetto-traces/trace > trace.perfetto-trace`
212 The full reference for the `perfetto` cmdline interface can be found
213 [here](/docs/reference/perfetto-cli.md).