Move SF trace logging into a separate thread
SF trace logging currently happens on the main thread, which affects performance. Move it to a separate thread to mitigate the overhead. Use a lock to prevent the drawing state to be updated while it is being dumped. Also, allow the buffer size for SF traces to be configured. Current buffer size is fixed to 100MB, which is unfeasible for phones with lower resources. Created option 1029 to manually update the buffer size. To trigger the option use: - adb shell su root service call SurfaceFlinger 1029 i32 <SIZE> This option trigger an "Invalid Argument" error if it receives a negative value. Finally, just log Winscope trace if visible regions are dirty. SF currently logs all Winscope frames. It should log only if there is a change to mitigate resource consumption. Test: Flash a device. Start a trace. Run systrace. Record a trace. Check if the `commitTransaction` trace happens in a separate SF thread and doesn't block the critical path Change-Id: Ie05ad5c025a185b28209bbc5d26655ba9ff9042b
Loading
Please register or sign in to comment