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 379004 5091aed32a4885392f7161af4d8bf92a6ebc2668
parent 379003 e7c5970badab988fa220c818162273be8c3683ba
child 379005 d5f74115c95b1e3586e20333098e3050d7f9a641
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm, lizzard
bugs1343729
milestone53.0
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)