summaryrefslogtreecommitdiff
path: root/compiler/linker/linker_patch.h
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2023-02-13 16:27:22 +0000
committer Mythri Alle <mythria@google.com> 2023-02-17 16:12:20 +0000
commit71cb074032f1b42349df77fd9d143ff5971b87ae (patch)
tree64c797f0232f4c90e37e1142108bb4d28c71f927 /compiler/linker/linker_patch.h
parentb0bdf29f81eda70342e898ec151d1165e5a758f0 (diff)
Don't reset the_trace_ before flushing per-thread buffers
When we stop tracing, we set the_trace_ to nullptr and maintain a copy of a local trace to flush the trace to file. The thread buffers were cleared later as a part of flushing the trace to file. However, if a thread gets destroyed after setting the_trace_ to nullptr but before we clear the thread buffer it causes problems since we expect the_trace_ to be valid to flush any data from the buffer. This used to work fine before we used per-thread buffers. This CL changes it so we reset the_trace_ to nullptr only after clearing thread buffers. We do this in a suspend all scope to avoid any races with stopping the trace and thread getting destroyed. This CL also moves resetting sampling_thread_ to a later point where we have acquired trace_lock_ to be consistent. Bug: 259258187 Test: art/test.py Change-Id: I8f2e59bad1508e26ee43302ee1d619a35bb2f660
Diffstat (limited to 'compiler/linker/linker_patch.h')
0 files changed, 0 insertions, 0 deletions