Skip to content

Commit 9d135db

Browse files
committed
docs: add more details on how to use perfetto to backend-platform
1 parent 1783c57 commit 9d135db

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/backend-platform/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ You can record and view traces in two ways:
8080
- using Android Studio's Profiler's 'Capture System Activities' option, as per the [documentation](https://developer.android.com/studio/profile); this method works both on physical devices & the Android emulator
8181
- using the `perfetto` CLI tool, which is distributed as part of the Android OS onboard most modern devices. More details can be found in the [documentation](https://perfetto.dev/docs/getting-started/system-tracing); the resulting file can be viewed in [Perfetto UI](https://ui.perfetto.dev/); this method works only on a physical device
8282

83+
> [!NOTE]
84+
> Make sure that the app you are profiling is `profileable` by placing an [appropriate element](https://developer.android.com/guide/topics/manifest/profileable-element) within your `AndroidManifest.xml`'s `<application>` element: `<profileable android:shell="true" />`
85+
86+
> [!NOTE]
87+
> If using the Perfetto CLI via the `record_android_trace` script, make sure to adjust the `--app` argument to match your app's package. We discovered that on some devices it is needed to set it, otherwise some userspace events may be missing. Some devices allow to pass an additional tracing category, `app`, which can also be considered in such cases. An example invocation might look like the following: `./record_android_trace --app=com.callstack.ottrelite.demo -o trace_file.perfetto-trace -t 40s -b 64mb sched freq idle am wm gfx view binder_driver hal dalvik camera input res memory rs app`.
88+
>
89+
> If your events are still missing, make sure your app is `profileable`.
90+
>
91+
> The Android Studio Profiler does not require any kind of configuration as the one described here and it should always work out of the box; it will also warn you in case your app is not `profileable`.
92+
8393
### iOS
8494

8595
You can view the traces in Xcode Instruments, as per the [documentation](https://developer.apple.com/documentation/os/recording-performance-data#Review-Signposts-in-Instruments).

0 commit comments

Comments
 (0)