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
Loading
Please register or sign in to comment