Improve SurfaceControlRegistry logging for applied transactions
- For bugs like b/320403561, it's important to know both when specific
SurfaceControl transaction calls are made, and when those changes are
actually applied. The existing logging is insufficient because merges
were not being tracked, and manually tracing when a call is actually
applied through various merged transactions is complicated.
This CL updates the apply() call tracking to include logs for all
calls that are made on that transaction, filtered to the set of calls
that are requested. It only works if there are other specific calls
requested (ie. it doesn't currently track all calls on a surface).
ie. If you want to track show/hides across merged transactions:
adb shell setprop persist.wm.debug.sc.tx.log_match_call show,hide,merge,apply
adb reboot
adb logcat -s "SurfaceControlRegistry"
Outputs:
java.lang.Throwable
at android.view.SurfaceControlRegistry.checkCallStackDebugging()
at android.view.SurfaceControl$Transaction.apply(
at android.view.SurfaceControl$Transaction.apply(
at android.view.SurfaceControl$Transaction.apply(
at com.android.wm.shell.transition.Transitions.onFinish()
at com.android.wm.shell.transition.Transitions.lambda$playTransition$2()
at com.android.wm.shell.transition.Transitions.$r8$lambda$W7xYOftIaREiTW7mnjUmUz2jYkA()
at com.android.wm.shell.transition.Transitions$$ExternalSyntheticLambda7.onTransitionFinished()
at com.android.wm.shell.recents.RecentsTransitionHandler$RecentsController.finishInner()
at com.android.wm.shell.recents.RecentsTransitionHandler$RecentsController.lambda$finish$9()
at com.android.wm.shell.recents.RecentsTransitionHandler$RecentsController.$r8$lambda$dOp5QZTviEiK1rNS9-7xP7CDnzM()
at com.android.wm.shell.recents.RecentsTransitionHandler$RecentsController$$ExternalSyntheticLambda4.run()
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.os.HandlerThread.run(HandlerThread.java:85)
hide (tx=135484743353255 sc=Task=13)
show (tx=135484743353255 sc=Task=1)
hide (tx=135484743353255 sc=Task=13)
hide (tx=135484743353255 sc=Task=19)
merge (tx=135484743353255 ) otherTx=136618614719772
merge (tx=135484743353255 ) otherTx=135484743353292
hide (tx=135484743353292 sc=Task=13)
show (tx=135484743353292 sc=Task=19)
Which can be cross referenced further with the actual calls on
tx=135484743353292 earlier in the logs
Flag: EXEMPT bugfix
Bug: 320403561
Test: atest SurfaceControlRegistryTests
Change-Id: Iea772d0fdad5ae54cfa82136494538538e549e48
Signed-off-by: Winson Chung <winsonc@google.com>
Loading
Please register or sign in to comment