summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_options.h
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2025-02-07 14:15:41 +0000
committer Mythri Alle <mythria@google.com> 2025-02-18 12:15:33 -0800
commitff7c1a9d5b07f1a761fba6fe89b0d446b0eea468 (patch)
tree5587e97e5a82438baa83958c24f942317a759e1a /compiler/driver/compiler_options.h
parent73067c5af49735755b6da2cc27c0dd082c248c9b (diff)
Fix lock level violations when dumping low overhead traces
There were two lock level violations in the code that dumps low overhead traces 1. We should not wait for checkpoints to finish while holding the trace_lock_. This CL fixes it by waiting for the checkpoints after releasing the trace_lock_. Since we release trace_lock_ while waiting we need additional synchronization to make sure trace_data_ isn't deleted while checkpoints are still running. This is done using a ConditionVariable and waiting on it if a trace dump is in progress before deleting the trace_data_. 2. We should not enter a ScopedObjectAccess (that acquires mutator lock) while holding the bottom level trace_data_lock_. We now take a snapshot of the traced_methods and traced_threads when holding the trace_data_lock_ and then dump thread and method information outside the lock. Dumping methods requires mutator lock to get the information about the method. Bug: 352518093 Test: Manual testing with feature enabled and kDebugLocking enabled. Change-Id: I42a61f4d43eb985a93bc7884c09f771a5fbcd8f2
Diffstat (limited to 'compiler/driver/compiler_options.h')
0 files changed, 0 insertions, 0 deletions