Bug 1328378 (part 3) - Remove unnecessary locking in profiler_get_backtrace(). r=mstange.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 27 Feb 2017 12:32:18 +1100
changeset 374173 6b7e1d039956e207ca24ebfc2629ebd3b6f3c3f0
parent 374172 16d6cb0afff570c36c5aea1e4b9f59a86abc75a5
child 374174 6c2a029b41ea26131a0abae7d6e304567ff2615a
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1328378
milestone54.0a1
Bug 1328378 (part 3) - Remove unnecessary locking in profiler_get_backtrace(). r=mstange. There's no need to lock when calling Tick() on a local TickSample that uses a fresh SyncProfile with its own fresh ProfileBuffer -- none of that data can be touched by another thread.
tools/profiler/core/platform.cpp
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -2454,19 +2454,17 @@ profiler_get_backtrace()
 #else
 # error "unknown platform"
 #endif
 #endif
 
   sample.isSamplingCurrentThread = true;
   sample.timestamp = mozilla::TimeStamp::Now();
 
-  profile->GetMutex().Lock();
   Tick(&sample);
-  profile->GetMutex().Unlock();
 
   return UniqueProfilerBacktrace(new ProfilerBacktrace(profile));
 }
 
 void
 ProfilerBacktraceDestructor::operator()(ProfilerBacktrace* aBacktrace)
 {
   delete aBacktrace;