diff --git a/ipc/chromium/src/base/pickle.cc b/ipc/chromium/src/base/pickle.cc index 0c1dd1a74787..3a1e7433414b 100644 --- a/ipc/chromium/src/base/pickle.cc +++ b/ipc/chromium/src/base/pickle.cc @@ -465,10 +465,10 @@ bool Pickle::WriteSentinel(uint32_t sentinel) { void Pickle::EndRead(PickleIterator& iter, uint32_t ipcMsgType) const { DCHECK(iter.iter_.Done()); - if (ipcMsgType != 0) { + if (NS_IsMainThread() && ipcMsgType != 0) { uint32_t latencyMs = round((mozilla::TimeStamp::Now() - iter.start_).ToMilliseconds()); if (latencyMs >= kMinTelemetryIPCReadLatencyMs) { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::IPC_READ_LATENCY_MS, + mozilla::Telemetry::Accumulate(mozilla::Telemetry::IPC_READ_MAIN_THREAD_LATENCY_MS, nsDependentCString(mozilla::ipc::StringFromIPCMessageType(ipcMsgType)), latencyMs); } diff --git a/ipc/glue/MessageChannel.cpp b/ipc/glue/MessageChannel.cpp index 51efd5b47489..002a47b31e3f 100644 --- a/ipc/glue/MessageChannel.cpp +++ b/ipc/glue/MessageChannel.cpp @@ -786,12 +786,12 @@ MessageChannel::Send(Message* aMsg) } // If the message was created by the IPC bindings, the create time will be - // recorded. Use this information to report the IPC_WRITE_LATENCY_MS (time + // recorded. Use this information to report the IPC_WRITE_MAIN_THREAD_LATENCY_MS (time // from message creation to it being sent). - if (aMsg->create_time()) { + if (NS_IsMainThread() && aMsg->create_time()) { uint32_t latencyMs = round((mozilla::TimeStamp::Now() - aMsg->create_time()).ToMilliseconds()); if (latencyMs >= kMinTelemetryIPCWriteLatencyMs) { - mozilla::Telemetry::Accumulate(mozilla::Telemetry::IPC_WRITE_LATENCY_MS, + mozilla::Telemetry::Accumulate(mozilla::Telemetry::IPC_WRITE_MAIN_THREAD_LATENCY_MS, nsDependentCString(aMsg->name()), latencyMs); } diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 5a214f1014c1..1f61beb5a67e 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -11019,7 +11019,7 @@ "description": "Results of displaying add-on installation notifications.", "releaseChannelCollection": "opt-out" }, - "IPC_READ_LATENCY_MS": { + "IPC_READ_MAIN_THREAD_LATENCY_MS": { "alert_emails": ["mlayzell@mozilla.com"], "bug_numbers": [1342635], "expires_in_version": "60", @@ -11027,9 +11027,9 @@ "high": 500, "n_buckets": 20, "keyed": true, - "description": "Measures the number of milliseconds we spend waiting for IPC messages to deserialize their parameters. Note: only messages that take more than 500 microseconds are included in this probe. This probe is keyed on the IPDL message name." + "description": "Measures the number of milliseconds we spend waiting on the main thread for IPC messages to deserialize their parameters. Note: only messages that take more than 500 microseconds are included in this probe. This probe is keyed on the IPDL message name." }, - "IPC_WRITE_LATENCY_MS": { + "IPC_WRITE_MAIN_THREAD_LATENCY_MS": { "alert_emails": ["mlayzell@mozilla.com"], "bug_numbers": [1342635], "expires_in_version": "60", @@ -11037,6 +11037,6 @@ "high": 500, "n_buckets": 20, "keyed": true, - "description": "Measures the number of milliseconds we spend waiting for IPC messages to serialize their parameters. Note: only messages that take more than 500 microseconds are included in this probe. This probe is keyed on the IPDL message name." + "description": "Measures the number of milliseconds we spend waiting on the main thread for IPC messages to serialize their parameters. Note: only messages that take more than 500 microseconds are included in this probe. This probe is keyed on the IPDL message name." } }