diff options
author | Ian Rogers <irogers@google.com> | 2014-07-09 18:00:50 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-07-09 18:00:50 -0700 |
commit | 8ab25ef11aed383bf7d3aa96e95f777972d1b58f (patch) | |
tree | 905b37556c225ab44e94f39292bbc558d7506376 /runtime/trace.cc | |
parent | bcb3b29095817ce8987d8310d4db87271f5114ad (diff) | |
download | art-8ab25ef11aed383bf7d3aa96e95f777972d1b58f.zip art-8ab25ef11aed383bf7d3aa96e95f777972d1b58f.tar.gz art-8ab25ef11aed383bf7d3aa96e95f777972d1b58f.tar.bz2 |
Move another field away from android_atomic_cas.
Change-Id: If63aa2811e06ec401a601286a3bacb62a0da96ad
Diffstat (limited to 'runtime/trace.cc')
-rw-r--r-- | runtime/trace.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/trace.cc b/runtime/trace.cc index 032a566..a522e88 100644 --- a/runtime/trace.cc +++ b/runtime/trace.cc @@ -459,7 +459,7 @@ Trace::Trace(File* trace_file, int buffer_size, int flags, bool sampling_enabled } // Update current offset. - cur_offset_ = kTraceHeaderLength; + cur_offset_.StoreRelaxed(kTraceHeaderLength); } static void DumpBuf(uint8_t* buf, size_t buf_size, ProfilerClockSource clock_source) @@ -480,7 +480,7 @@ void Trace::FinishTracing() { // Compute elapsed time. uint64_t elapsed = MicroTime() - start_time_; - size_t final_offset = cur_offset_; + size_t final_offset = cur_offset_.LoadRelaxed(); uint32_t clock_overhead_ns = GetClockOverheadNanoSeconds(this); if ((flags_ & kTraceCountAllocs) != 0) { @@ -623,13 +623,13 @@ void Trace::LogMethodTraceEvent(Thread* thread, mirror::ArtMethod* method, int32_t new_offset; int32_t old_offset; do { - old_offset = cur_offset_; + old_offset = cur_offset_.LoadRelaxed(); new_offset = old_offset + GetRecordSize(clock_source_); if (new_offset > buffer_size_) { overflow_ = true; return; } - } while (android_atomic_release_cas(old_offset, new_offset, &cur_offset_) != 0); + } while (cur_offset_.CompareExchangeWeakSequentiallyConsistent(old_offset, new_offset) != 0); TraceAction action = kTraceMethodEnter; switch (event) { |