Skip to content
Commit 023ecb5f authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Allow for different log levels on WM traces

Currently only a boolean value (trim) is supported. If trim is true then the configuration (Configuration.java) is written only once, otherwise it is written 3 times. With this implementation too much information is written in the log and it is not possible to activate a continuous tracing mode without affecting system performance. Trace logging currently consumes ~1ms for each log write  on a Pixel 2 device, divided into ~0.6ms to write the data to the ProtoBuf and ~0.4ms to it to the circular buffer.

This implementation converts this boolean into an enum and defines 3 different log levels (WindowTraceLogLevel enum): "Critical", "Trim" and "All".

"Trim" and "All" behave as the previously existing boolean. "Critical" is a new log level which logs only the elements which are visible with the minimum amount of information required for analysis. With this mode the average overhead of continuous logging drops to ~0.26ms on the same Pixel 2 device (0.2ms to write to ProtoBuf and 0.06 to add ot circular buffer).

The system automatically configures the log level between "Trim" and "Critical" according to the trace strategy used. When using continuous tracing mode it automatically uses the "Critical" level, otherwise it uses "Trim".

To activate the continuous mode use:
- adb shell cmd window tracing continuous true

Test: Flash a device. Set continuous mode to true and enable Winscope tracing. Start a systrace test for wm category and use the device. Check the "writeToProto" item to inspect the overhead.
Change-Id: I7abd74969b94abe44af4f7c65be5fefdd0860155
parent f8e82809
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment