Skip to content

Commit 949300b

Browse files
authored
Add recommended perfetto configuration for automotive to public docs (#3035)
* Add recomended perfetto configuration for automotive to public docs * Combine Perfetto configuration with recording over USB section * Add link to record trace and describe configuration screenshots
1 parent 2899016 commit 949300b

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

DEVELOPING.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,36 @@ There are 2 types of traces that could be enabled:
498498

499499
It is also possible to enable all the traces with `MapboxTracing.enableAll()`. Tracing could be disabled with `MapboxTracing.disableAll()`.
500500

501+
### Recording traces using Perfetto UI
502+
503+
The Perfetto Record settings can be edited when recording a new trace from [ui.perfetto.dev](https://ui.perfetto.dev/#!/record).
504+
We recommend to enable the following options in Perfetto and combine them with `MapboxTracing.enableAll()` enabled in application code:
505+
506+
In **GPU** section. Enable `GPU frequency`, `GPU memory` and `GPU work period`:
507+
508+
<img src="https://github.com/user-attachments/assets/7cc524c6-5253-4c33-a399-11a95d8f4315" width="400" height="300" alt="image">
509+
510+
511+
In **CPU** section.
512+
Enable `Coarse CPU usage counter`, `Scheduling details` and `CPU frequency and idle states` (with default `Poll interval`).
513+
Please make sure the “Syscalls” **is not** selected, otherwise the trace gets bloated with these records and becomes unreadable.
514+
515+
<img src="https://github.com/user-attachments/assets/2d6a29b1-3087-4501-998f-077db5038bce" width="400" height="300" alt="image">
516+
517+
518+
**Android apps & svcs**
519+
520+
Please make sure the “Atrace userspace annotations” is selected and “Record events from all Android apps and services” is enabled (it is also required to record the Mapbox trace annotations).
521+
522+
<img src="https://github.com/user-attachments/assets/f4978e0d-3165-4aa1-80e0-b747e7eda791" width="400" height="300" alt="image">
523+
524+
Please note that this UI auto-generates the corresponding command line instructions - “Cmdline instructions” section
525+
526+
<img src="https://github.com/user-attachments/assets/f55532df-fdff-4ba2-ac87-823deebfb1c0" width="400" height="300" alt="image">
527+
528+
Produced html file can be opened in https://ui.perfetto.dev viewer.
529+
530+
501531
### Recording traces using Android studio
502532

503533
There are several ways of capturing traces for Android which are described in [official documentation](https://developer.android.com/topic/performance/tracing). As a reference we will describe the steps of recording traces using Android Studio Profiler:
@@ -527,16 +557,6 @@ After we exported trace recording we could use [Perfetto](https://ui.perfetto.de
527557

528558
There are several other ways how to record traces.
529559

530-
#### From ui.perfetto.dev over WebUSB
531-
532-
<img width="240" alt="image" src="https://github.com/mapbox/mapbox-maps-android-internal/assets/1001009/ee1f1ff9-350a-436e-898a-8e0d05fae920">
533-
534-
Enable Atrace events (other optional probes can be enabled if needed).
535-
536-
<img width="70%" alt="image" src="https://github.com/mapbox/mapbox-maps-android-internal/assets/1001009/36cad2eb-9b0b-4545-ab4f-b3fb0cd5da7f">
537-
538-
After `stop recording` is pressed, trace will be visible in the UI.
539-
540560
#### Directly from the device (supported on Google Pixel devices)
541561

542562
<img src="https://github.com/mapbox/mapbox-maps-android-internal/assets/1001009/f81f3217-55a6-4d07-a6c1-b40842cc1d83" width="60%">

0 commit comments

Comments
 (0)