Bug 1343729 - Only collect IPC_SYNC_LATENCY_MS on the main thread. r=billm, a=lizzard
authorMichael Layzell <michael@thelayzells.com>
Tue, 07 Mar 2017 14:16:53 -0500
changeset 395107 0dc9b3b87501334f921fefe17813a5ccca7e6675
parent 395106 d05ad8f64da72a900357fce8598574a49295c841
child 395108 3322424b416aa47256017a2614f324cd5a1b371b
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm, lizzard
bugs1343729
milestone54.0a2
Bug 1343729 - Only collect IPC_SYNC_LATENCY_MS on the main thread. r=billm, a=lizzard MozReview-Commit-ID: GtsujcVJNtW
ipc/glue/MessageChannel.cpp
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -1274,17 +1274,18 @@ MessageChannel::Send(Message* aMsg, Mess
     MOZ_RELEASE_ASSERT(reply->is_sync());
 
     *aReply = Move(*reply);
     if (aReply->size() >= kMinTelemetryMessageSize) {
         Telemetry::Accumulate(Telemetry::IPC_REPLY_SIZE,
                               nsDependentCString(msgName), aReply->size());
     }
 
-    if (latencyMs >= kMinTelemetrySyncIPCLatencyMs) {
+    // NOTE: Only collect IPC_SYNC_LATENCY_MS on the main thread (bug 1343729)
+    if (NS_IsMainThread() && latencyMs >= kMinTelemetrySyncIPCLatencyMs) {
       Telemetry::Accumulate(Telemetry::IPC_SYNC_LATENCY_MS,
                             nsDependentCString(msgName), latencyMs);
     }
     return true;
 }
 
 bool
 MessageChannel::Call(Message* aMsg, Message* aReply)