Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8b5c6bd0 authored by Kean Mariotti's avatar Kean Mariotti
Browse files

Add layer tracing's MODE_GENERATED_BUGREPORT_ONLY

The generated layers trace can be quite large (100-400 MB), which is way above
the perfetto's field upload budget.

On the field (AOT) we want the layers trace to be generated only when a bugreport
is taken and not when a perfetto's field upload happens. We achieve it as follows:
- In the AOT configuration, enable the 'android.surfaceflinger_layers' data source
  with MODE_GENERATED_BUGREPORT_ONLY.
- When LayerTracing receives perfetto's OnFlush event and MODE_GENERATED_BUGREPORT_ONLY is enabled,
  generate the layers trace only if the OnFlush event is due to a bugreport being taken:
    args.flush_flags.reason() == perfetto::FlushFlags::Reason::kTraceClone &&
    args.flush_flags.clone_target() == perfetto::FlushFlags::CloneTarget::kBugreport

In a test environment instead, we can use MODE_GENERATED to test the layers trace generation
without having to take a bugreport.

Bug: b/293429094
Test: 1. Manually start the perfetto's android.surfaceflinger_layers data source
         with MODE_GENERATED_BUGREPORT_ONLY setting a high bugreport_score (e.g. 50000)
      2. Take a bugreport (adb bugreport)
      3. Verify that FS/data/misc/perfetto-traces/bugreport/systrace.pftrace (in the bugreport)
         contains the generated layers trace. E.g. inspect bugreport with go/winscope.
Change-Id: I5b3ce59cc762fd5a22170e677e48be987380c94e
parent 3feea1b9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment