summaryrefslogtreecommitdiff
path: root/libs/binder/TextOutput.cpp
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2019-09-16 18:22:19 +0200
committer Nataniel Borges <natanieljr@google.com> 2019-09-24 12:27:28 +0200
commitb57b01e59d10f943a2ea6039a7c097bdbbcf02e7 (patch)
tree5c18cce838420723205bea90921e0ce5b200c0fc /libs/binder/TextOutput.cpp
parentb5f8331e88468625a58fa161935acd083ffa9c85 (diff)
Fix locking issues with proto dumps
Proto dumps are generated from: - binder threads when generating bugreports or triggering dumpstate - main thread when mLayerStats is enabled - tracing thread when winscope tracing is enabled. The binder thread reads current state while the other threads reads drawing state. The writeToProto function accesses a mix of current and drawing states. mPendingState should only be accessed with the mStateLock held and the visible regions should be read from the main or tracing threads. This causes some invalid access issues. To make the locking requirements clear, this change 1. moves drawing specific data to a new function 2. copies mPendingState so we can dump the copy safely in main thread 3. dumps drawing data from binder threads by posting a message onto the main thread Bug: 138318680 Test: adb shell dumpsys SurfaceFlinger, winscope Change-Id: Ib2b49aedf06ee5a262d3162366ddf75d08432e05 Merged-In: I8bb93e9b9f81faec59585b770eb7ba0fbcd9b51b
Diffstat (limited to 'libs/binder/TextOutput.cpp')
0 files changed, 0 insertions, 0 deletions