From 54477899609fae7a2307e87f927f01b2df1092cb Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Wed, 15 Feb 2017 16:10:29 +0100 Subject: [PATCH] Backed out changeset 3a90f1f64d8d (bug 1339749) for bustage on a CLOSED TREE --HG-- rename : toolkit/components/telemetry/ipc/TelemetryComms.h => toolkit/components/telemetry/TelemetryComms.h rename : toolkit/components/telemetry/ipc/TelemetryIPCAccumulator.cpp => toolkit/components/telemetry/TelemetryIPCAccumulator.cpp rename : toolkit/components/telemetry/ipc/TelemetryIPCAccumulator.h => toolkit/components/telemetry/TelemetryIPCAccumulator.h extra : amend_source : 2f4229556609103157901609fee02aaedcdb8606 --- dom/ipc/ContentParent.cpp | 13 ++- dom/ipc/ContentParent.h | 4 +- dom/ipc/PContent.ipdl | 4 +- gfx/ipc/GPUChild.cpp | 13 ++- gfx/ipc/GPUChild.h | 4 +- gfx/ipc/PGPU.ipdl | 4 +- toolkit/components/telemetry/Telemetry.cpp | 30 ++++++- toolkit/components/telemetry/Telemetry.h | 28 ++++++ .../telemetry/{ipc => }/TelemetryComms.h | 0 .../telemetry/TelemetryHistogram.cpp | 3 +- .../{ipc => }/TelemetryIPCAccumulator.cpp | 90 ++++++++++--------- .../{ipc => }/TelemetryIPCAccumulator.h | 2 - .../components/telemetry/TelemetryScalar.cpp | 6 +- .../components/telemetry/TelemetryScalar.h | 4 +- .../components/telemetry/ipc/TelemetryIPC.cpp | 41 --------- .../components/telemetry/ipc/TelemetryIPC.h | 59 ------------ toolkit/components/telemetry/moz.build | 6 +- 17 files changed, 131 insertions(+), 180 deletions(-) rename toolkit/components/telemetry/{ipc => }/TelemetryComms.h (100%) rename toolkit/components/telemetry/{ipc => }/TelemetryIPCAccumulator.cpp (83%) rename toolkit/components/telemetry/{ipc => }/TelemetryIPCAccumulator.h (98%) delete mode 100644 toolkit/components/telemetry/ipc/TelemetryIPC.cpp delete mode 100644 toolkit/components/telemetry/ipc/TelemetryIPC.h diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 20c133416e4a..6c47609e9212 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -95,7 +95,6 @@ #include "mozilla/Services.h" #include "mozilla/StaticPtr.h" #include "mozilla/Telemetry.h" -#include "mozilla/TelemetryIPC.h" #include "mozilla/WebBrowserPersistDocumentParent.h" #include "mozilla/Unused.h" #include "nsAnonymousTemporaryFile.h" @@ -4889,18 +4888,18 @@ ContentParent::ForceTabPaint(TabParent* aTabParent, uint64_t aLayerObserverEpoch } mozilla::ipc::IPCResult -ContentParent::RecvAccumulateChildHistograms( +ContentParent::RecvAccumulateChildHistogram( InfallibleTArray&& aAccumulations) { - TelemetryIPC::AccumulateChildHistograms(GeckoProcessType_Content, aAccumulations); + Telemetry::AccumulateChild(GeckoProcessType_Content, aAccumulations); return IPC_OK(); } mozilla::ipc::IPCResult -ContentParent::RecvAccumulateChildKeyedHistograms( +ContentParent::RecvAccumulateChildKeyedHistogram( InfallibleTArray&& aAccumulations) { - TelemetryIPC::AccumulateChildKeyedHistograms(GeckoProcessType_Content, aAccumulations); + Telemetry::AccumulateChildKeyed(GeckoProcessType_Content, aAccumulations); return IPC_OK(); } @@ -4908,7 +4907,7 @@ mozilla::ipc::IPCResult ContentParent::RecvUpdateChildScalars( InfallibleTArray&& aScalarActions) { - TelemetryIPC::UpdateChildScalars(GeckoProcessType_Content, aScalarActions); + Telemetry::UpdateChildScalars(GeckoProcessType_Content, aScalarActions); return IPC_OK(); } @@ -4916,7 +4915,7 @@ mozilla::ipc::IPCResult ContentParent::RecvUpdateChildKeyedScalars( InfallibleTArray&& aScalarActions) { - TelemetryIPC::UpdateChildKeyedScalars(GeckoProcessType_Content, aScalarActions); + Telemetry::UpdateChildKeyedScalars(GeckoProcessType_Content, aScalarActions); return IPC_OK(); } diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index 372575cea900..8095addae39e 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -1113,9 +1113,9 @@ private: const int64_t& aLastModified, const bool& aIsFromNsIFile) override; - virtual mozilla::ipc::IPCResult RecvAccumulateChildHistograms( + virtual mozilla::ipc::IPCResult RecvAccumulateChildHistogram( InfallibleTArray&& aAccumulations) override; - virtual mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms( + virtual mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistogram( InfallibleTArray&& aAccumulations) override; virtual mozilla::ipc::IPCResult RecvUpdateChildScalars( InfallibleTArray&& aScalarActions) override; diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 3d365d343b3a..89a03878bcf1 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -1181,8 +1181,8 @@ parent: /** * Messages for communicating child Telemetry to the parent process */ - async AccumulateChildHistograms(Accumulation[] accumulations); - async AccumulateChildKeyedHistograms(KeyedAccumulation[] accumulations); + async AccumulateChildHistogram(Accumulation[] accumulations); + async AccumulateChildKeyedHistogram(KeyedAccumulation[] accumulations); async UpdateChildScalars(ScalarAction[] updates); async UpdateChildKeyedScalars(KeyedScalarAction[] updates); diff --git a/gfx/ipc/GPUChild.cpp b/gfx/ipc/GPUChild.cpp index 6ee125eb877c..f2d98424084e 100644 --- a/gfx/ipc/GPUChild.cpp +++ b/gfx/ipc/GPUChild.cpp @@ -10,7 +10,6 @@ #include "GPUProcessHost.h" #include "GPUProcessManager.h" #include "mozilla/Telemetry.h" -#include "mozilla/TelemetryIPC.h" #include "mozilla/dom/CheckerboardReportService.h" #include "mozilla/dom/MemoryReportRequest.h" #include "mozilla/gfx/gfxVars.h" @@ -142,30 +141,30 @@ GPUChild::RecvNotifyUiObservers(const nsCString& aTopic) } mozilla::ipc::IPCResult -GPUChild::RecvAccumulateChildHistograms(InfallibleTArray&& aAccumulations) +GPUChild::RecvAccumulateChildHistogram(InfallibleTArray&& aAccumulations) { - TelemetryIPC::AccumulateChildHistograms(GeckoProcessType_GPU, aAccumulations); + Telemetry::AccumulateChild(GeckoProcessType_GPU, aAccumulations); return IPC_OK(); } mozilla::ipc::IPCResult -GPUChild::RecvAccumulateChildKeyedHistograms(InfallibleTArray&& aAccumulations) +GPUChild::RecvAccumulateChildKeyedHistogram(InfallibleTArray&& aAccumulations) { - TelemetryIPC::AccumulateChildKeyedHistograms(GeckoProcessType_GPU, aAccumulations); + Telemetry::AccumulateChildKeyed(GeckoProcessType_GPU, aAccumulations); return IPC_OK(); } mozilla::ipc::IPCResult GPUChild::RecvUpdateChildScalars(InfallibleTArray&& aScalarActions) { - TelemetryIPC::UpdateChildScalars(GeckoProcessType_GPU, aScalarActions); + Telemetry::UpdateChildScalars(GeckoProcessType_GPU, aScalarActions); return IPC_OK(); } mozilla::ipc::IPCResult GPUChild::RecvUpdateChildKeyedScalars(InfallibleTArray&& aScalarActions) { - TelemetryIPC::UpdateChildKeyedScalars(GeckoProcessType_GPU, aScalarActions); + Telemetry::UpdateChildKeyedScalars(GeckoProcessType_GPU, aScalarActions); return IPC_OK(); } diff --git a/gfx/ipc/GPUChild.h b/gfx/ipc/GPUChild.h index 5b5ca5c7054e..d14ba300e222 100644 --- a/gfx/ipc/GPUChild.h +++ b/gfx/ipc/GPUChild.h @@ -43,8 +43,8 @@ public: mozilla::ipc::IPCResult RecvInitComplete(const GPUDeviceData& aData) override; mozilla::ipc::IPCResult RecvReportCheckerboard(const uint32_t& aSeverity, const nsCString& aLog) override; mozilla::ipc::IPCResult RecvInitCrashReporter(Shmem&& shmem) override; - mozilla::ipc::IPCResult RecvAccumulateChildHistograms(InfallibleTArray&& aAccumulations) override; - mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms(InfallibleTArray&& aAccumulations) override; + mozilla::ipc::IPCResult RecvAccumulateChildHistogram(InfallibleTArray&& aAccumulations) override; + mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistogram(InfallibleTArray&& aAccumulations) override; mozilla::ipc::IPCResult RecvUpdateChildScalars(InfallibleTArray&& aScalarActions) override; mozilla::ipc::IPCResult RecvUpdateChildKeyedScalars(InfallibleTArray&& aScalarActions) override; void ActorDestroy(ActorDestroyReason aWhy) override; diff --git a/gfx/ipc/PGPU.ipdl b/gfx/ipc/PGPU.ipdl index 4e1fb0df533e..63fc2862d495 100644 --- a/gfx/ipc/PGPU.ipdl +++ b/gfx/ipc/PGPU.ipdl @@ -109,8 +109,8 @@ child: async NotifyUiObservers(nsCString aTopic); // Messages for reporting telemetry to the UI process. - async AccumulateChildHistograms(Accumulation[] accumulations); - async AccumulateChildKeyedHistograms(KeyedAccumulation[] accumulations); + async AccumulateChildHistogram(Accumulation[] accumulations); + async AccumulateChildKeyedHistogram(KeyedAccumulation[] accumulations); async UpdateChildScalars(ScalarAction[] actions); async UpdateChildKeyedScalars(KeyedScalarAction[] actions); diff --git a/toolkit/components/telemetry/Telemetry.cpp b/toolkit/components/telemetry/Telemetry.cpp index e28980d0e9bf..95307adcb63e 100644 --- a/toolkit/components/telemetry/Telemetry.cpp +++ b/toolkit/components/telemetry/Telemetry.cpp @@ -45,7 +45,7 @@ #include "Telemetry.h" #include "TelemetryCommon.h" #include "TelemetryHistogram.h" -#include "ipc/TelemetryIPCAccumulator.h" +#include "TelemetryIPCAccumulator.h" #include "TelemetryScalar.h" #include "TelemetryEvent.h" #include "WebrtcTelemetry.h" @@ -3189,6 +3189,34 @@ AccumulateTimeDelta(ID aHistogram, TimeStamp start, TimeStamp end) static_cast((end - start).ToMilliseconds())); } +void +AccumulateChild(GeckoProcessType aProcessType, + const nsTArray& aAccumulations) +{ + TelemetryHistogram::AccumulateChild(aProcessType, aAccumulations); +} + +void +AccumulateChildKeyed(GeckoProcessType aProcessType, + const nsTArray& aAccumulations) +{ + TelemetryHistogram::AccumulateChildKeyed(aProcessType, aAccumulations); +} + +void +UpdateChildScalars(GeckoProcessType aProcessType, + const nsTArray& aScalarActions) +{ + TelemetryScalar::UpdateChildData(aProcessType, aScalarActions); +} + +void +UpdateChildKeyedScalars(GeckoProcessType aProcessType, + const nsTArray& aScalarActions) +{ + TelemetryScalar::UpdateChildKeyedData(aProcessType, aScalarActions); +} + const char* GetHistogramName(ID id) { diff --git a/toolkit/components/telemetry/Telemetry.h b/toolkit/components/telemetry/Telemetry.h index 5a78b48ca52c..ab52eac5738a 100644 --- a/toolkit/components/telemetry/Telemetry.h +++ b/toolkit/components/telemetry/Telemetry.h @@ -131,6 +131,34 @@ void AccumulateCategorical(ID id, const nsCString& label); */ void AccumulateTimeDelta(ID id, TimeStamp start, TimeStamp end = TimeStamp::Now()); +/** + * Accumulate child process data into histograms for the given process type. + * + * @param aAccumulations - accumulation actions to perform + */ +void AccumulateChild(GeckoProcessType aProcessType, const nsTArray& aAccumulations); + +/** + * Accumulate child process data into keyed histograms for the given process type. + * + * @param aAccumulations - accumulation actions to perform + */ +void AccumulateChildKeyed(GeckoProcessType aProcessType, const nsTArray& aAccumulations); + +/** + * Update scalars for the given process type with the data coming from child process. + * + * @param aScalarActions - actions to update the scalar data + */ +void UpdateChildScalars(GeckoProcessType aProcessType, const nsTArray& aScalarActions); + +/** + * Update keyed scalars for the given process type with the data coming from child process. + * + * @param aScalarActions - actions to update the keyed scalar data + */ +void UpdateChildKeyedScalars(GeckoProcessType aProcessType, const nsTArray& aScalarActions); + /** * Enable/disable recording for this histogram at runtime. * Recording is enabled by default, unless listed at kRecordingInitiallyDisabledIDs[]. diff --git a/toolkit/components/telemetry/ipc/TelemetryComms.h b/toolkit/components/telemetry/TelemetryComms.h similarity index 100% rename from toolkit/components/telemetry/ipc/TelemetryComms.h rename to toolkit/components/telemetry/TelemetryComms.h diff --git a/toolkit/components/telemetry/TelemetryHistogram.cpp b/toolkit/components/telemetry/TelemetryHistogram.cpp index 6c50f99ca629..81c1f0ca8f59 100644 --- a/toolkit/components/telemetry/TelemetryHistogram.cpp +++ b/toolkit/components/telemetry/TelemetryHistogram.cpp @@ -23,7 +23,7 @@ #include "TelemetryCommon.h" #include "TelemetryHistogram.h" -#include "ipc/TelemetryIPCAccumulator.h" +#include "TelemetryIPCAccumulator.h" #include "base/histogram.h" @@ -39,7 +39,6 @@ using mozilla::Telemetry::Accumulation; using mozilla::Telemetry::KeyedAccumulation; using mozilla::Telemetry::Common::LogToBrowserConsole; -namespace TelemetryIPCAccumulator = mozilla::TelemetryIPCAccumulator; //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// diff --git a/toolkit/components/telemetry/ipc/TelemetryIPCAccumulator.cpp b/toolkit/components/telemetry/TelemetryIPCAccumulator.cpp similarity index 83% rename from toolkit/components/telemetry/ipc/TelemetryIPCAccumulator.cpp rename to toolkit/components/telemetry/TelemetryIPCAccumulator.cpp index 2f3604681da5..92f4c1c1c711 100644 --- a/toolkit/components/telemetry/ipc/TelemetryIPCAccumulator.cpp +++ b/toolkit/components/telemetry/TelemetryIPCAccumulator.cpp @@ -28,8 +28,6 @@ using mozilla::Telemetry::ScalarAction; using mozilla::Telemetry::KeyedScalarAction; using mozilla::Telemetry::ScalarVariant; -namespace TelemetryIPCAccumulator = mozilla::TelemetryIPCAccumulator; - // Sending each remote accumulation immediately places undue strain on the // IPC subsystem. Batch the remote accumulations for a period of time before // sending them all at once. This value was chosen as a balance between data @@ -170,11 +168,17 @@ TelemetryIPCAccumulator::RecordChildKeyedScalarAction(mozilla::Telemetry::Scalar // This method takes the lock only to double-buffer the batched telemetry. // It releases the lock before calling out to IPC code which can (and does) // Accumulate (which would deadlock) -template -static void -SendAccumulatedData(TActor* ipcActor) +// +// To ensure we don't loop IPCTimerFired->AccumulateChild->arm timer, we don't +// unset gIPCTimerArmed until the IPC completes +// +// This function must be called on the main thread, otherwise IPC will fail. +void +TelemetryIPCAccumulator::IPCTimerFired(nsITimer* aTimer, void* aClosure) { - // Get the accumulated data and free the storage buffers. + MOZ_ASSERT(NS_IsMainThread()); + + // Get the accumulated data and free the storage buffer. nsTArray accumulationsToSend; nsTArray keyedAccumulationsToSend; nsTArray scalarsToSend; @@ -197,43 +201,47 @@ SendAccumulatedData(TActor* ipcActor) } // Send the accumulated data to the parent process. - mozilla::Unused << NS_WARN_IF(!ipcActor); - if (accumulationsToSend.Length()) { - mozilla::Unused << - NS_WARN_IF(!ipcActor->SendAccumulateChildHistograms(accumulationsToSend)); - } - if (keyedAccumulationsToSend.Length()) { - mozilla::Unused << - NS_WARN_IF(!ipcActor->SendAccumulateChildKeyedHistograms(keyedAccumulationsToSend)); - } - if (scalarsToSend.Length()) { - mozilla::Unused << - NS_WARN_IF(!ipcActor->SendUpdateChildScalars(scalarsToSend)); - } - if (keyedScalarsToSend.Length()) { - mozilla::Unused << - NS_WARN_IF(!ipcActor->SendUpdateChildKeyedScalars(keyedScalarsToSend)); - } -} - - -// To ensure we don't loop IPCTimerFired->AccumulateChild->arm timer, we don't -// unset gIPCTimerArmed until the IPC completes -// -// This function must be called on the main thread, otherwise IPC will fail. -void -TelemetryIPCAccumulator::IPCTimerFired(nsITimer* aTimer, void* aClosure) -{ - MOZ_ASSERT(NS_IsMainThread()); - - // Send accumulated data to the correct parent process. switch (XRE_GetProcessType()) { - case GeckoProcessType_Content: - SendAccumulatedData(mozilla::dom::ContentChild::GetSingleton()); + case GeckoProcessType_Content: { + mozilla::dom::ContentChild* contentChild = mozilla::dom::ContentChild::GetSingleton(); + mozilla::Unused << NS_WARN_IF(!contentChild); + if (contentChild) { + if (accumulationsToSend.Length()) { + mozilla::Unused << + NS_WARN_IF(!contentChild->SendAccumulateChildHistogram(accumulationsToSend)); + } + if (keyedAccumulationsToSend.Length()) { + mozilla::Unused << + NS_WARN_IF(!contentChild->SendAccumulateChildKeyedHistogram(keyedAccumulationsToSend)); + } + if (scalarsToSend.Length()) { + mozilla::Unused << + NS_WARN_IF(!contentChild->SendUpdateChildScalars(scalarsToSend)); + } + if (keyedScalarsToSend.Length()) { + mozilla::Unused << + NS_WARN_IF(!contentChild->SendUpdateChildKeyedScalars(keyedScalarsToSend)); + } + } break; - case GeckoProcessType_GPU: - SendAccumulatedData(mozilla::gfx::GPUParent::GetSingleton()); + } + case GeckoProcessType_GPU: { + if (mozilla::gfx::GPUParent* gpu = mozilla::gfx::GPUParent::GetSingleton()) { + if (accumulationsToSend.Length()) { + mozilla::Unused << gpu->SendAccumulateChildHistogram(accumulationsToSend); + } + if (keyedAccumulationsToSend.Length()) { + mozilla::Unused << gpu->SendAccumulateChildKeyedHistogram(keyedAccumulationsToSend); + } + if (scalarsToSend.Length()) { + mozilla::Unused << gpu->SendUpdateChildScalars(scalarsToSend); + } + if (keyedScalarsToSend.Length()) { + mozilla::Unused << gpu->SendUpdateChildKeyedScalars(keyedScalarsToSend); + } + } break; + } default: MOZ_ASSERT_UNREACHABLE("Unsupported process type"); break; @@ -245,8 +253,6 @@ TelemetryIPCAccumulator::IPCTimerFired(nsITimer* aTimer, void* aClosure) void TelemetryIPCAccumulator::DeInitializeGlobalState() { - MOZ_ASSERT(NS_IsMainThread()); - StaticMutexAutoLock locker(gTelemetryIPCAccumulatorMutex); if (gIPCTimer) { NS_RELEASE(gIPCTimer); diff --git a/toolkit/components/telemetry/ipc/TelemetryIPCAccumulator.h b/toolkit/components/telemetry/TelemetryIPCAccumulator.h similarity index 98% rename from toolkit/components/telemetry/ipc/TelemetryIPCAccumulator.h rename to toolkit/components/telemetry/TelemetryIPCAccumulator.h index 5dc37719c95a..68087dba32d5 100644 --- a/toolkit/components/telemetry/ipc/TelemetryIPCAccumulator.h +++ b/toolkit/components/telemetry/TelemetryIPCAccumulator.h @@ -14,7 +14,6 @@ class nsITimer; class nsAString; class nsCString; -namespace mozilla { namespace TelemetryIPCAccumulator { // Histogram accumulation functions. @@ -36,7 +35,6 @@ void DeInitializeGlobalState(); void DispatchToMainThread(already_AddRefed&& aEvent); -} } #endif // TelemetryIPCAccumulator_h__ diff --git a/toolkit/components/telemetry/TelemetryScalar.cpp b/toolkit/components/telemetry/TelemetryScalar.cpp index 0fe17ba887d0..fb8589b49acd 100644 --- a/toolkit/components/telemetry/TelemetryScalar.cpp +++ b/toolkit/components/telemetry/TelemetryScalar.cpp @@ -17,11 +17,11 @@ #include "mozilla/StaticMutex.h" #include "mozilla/Unused.h" +#include "TelemetryComms.h" #include "TelemetryCommon.h" +#include "TelemetryIPCAccumulator.h" #include "TelemetryScalar.h" #include "TelemetryScalarData.h" -#include "ipc/TelemetryComms.h" -#include "ipc/TelemetryIPCAccumulator.h" using mozilla::StaticMutex; using mozilla::StaticMutexAutoLock; @@ -33,8 +33,6 @@ using mozilla::Telemetry::Common::LogToBrowserConsole; using mozilla::Telemetry::ScalarActionType; using mozilla::Telemetry::ScalarVariant; -namespace TelemetryIPCAccumulator = mozilla::TelemetryIPCAccumulator; - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // diff --git a/toolkit/components/telemetry/TelemetryScalar.h b/toolkit/components/telemetry/TelemetryScalar.h index ef55e048b248..c87da34612cf 100644 --- a/toolkit/components/telemetry/TelemetryScalar.h +++ b/toolkit/components/telemetry/TelemetryScalar.h @@ -7,8 +7,6 @@ #define TelemetryScalar_h__ #include "mozilla/TelemetryScalarEnums.h" -#include "nsXULAppAPI.h" // for GeckoProcessType -#include "ipc/TelemetryComms.h" // This module is internal to Telemetry. It encapsulates Telemetry's // scalar accumulation and storage logic. It should only be used by @@ -69,4 +67,4 @@ void UpdateChildKeyedData(GeckoProcessType aProcessType, } // namespace TelemetryScalar -#endif // TelemetryScalar_h__ +#endif // TelemetryScalar_h__ \ No newline at end of file diff --git a/toolkit/components/telemetry/ipc/TelemetryIPC.cpp b/toolkit/components/telemetry/ipc/TelemetryIPC.cpp deleted file mode 100644 index adc4c093a2de..000000000000 --- a/toolkit/components/telemetry/ipc/TelemetryIPC.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "TelemetryIPC.h" -#include "../TelemetryScalar.h" -#include "../TelemetryHistogram.h" - -namespace mozilla { - -void -TelemetryIPC::AccumulateChildHistograms(GeckoProcessType aProcessType, - const nsTArray& aAccumulations) -{ - TelemetryHistogram::AccumulateChild(aProcessType, aAccumulations); -} - -void -TelemetryIPC::AccumulateChildKeyedHistograms(GeckoProcessType aProcessType, - const nsTArray& aAccumulations) -{ - TelemetryHistogram::AccumulateChildKeyed(aProcessType, aAccumulations); -} - -void -TelemetryIPC::UpdateChildScalars(GeckoProcessType aProcessType, - const nsTArray& aScalarActions) -{ - TelemetryScalar::UpdateChildData(aProcessType, aScalarActions); -} - -void -TelemetryIPC::UpdateChildKeyedScalars(GeckoProcessType aProcessType, - const nsTArray& aScalarActions) -{ - TelemetryScalar::UpdateChildKeyedData(aProcessType, aScalarActions); -} - -} diff --git a/toolkit/components/telemetry/ipc/TelemetryIPC.h b/toolkit/components/telemetry/ipc/TelemetryIPC.h deleted file mode 100644 index ee0ccdfd6ff8..000000000000 --- a/toolkit/components/telemetry/ipc/TelemetryIPC.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef TelemetryIPC_h__ -#define TelemetryIPC_h__ - -#include "nsTArray.h" -#include "nsXULAppAPI.h" - -// This module provides the interface to accumulate Telemetry from child processes. -// Top-level actors for different child processes types (ContentParent, GPUChild) -// will call this for messages from their respective processes. - -namespace mozilla { -namespace Telemetry { - -struct Accumulation; -struct KeyedAccumulation; -struct ScalarAction; -struct KeyedScalarAction; - -} - -namespace TelemetryIPC { - -/** - * Accumulate child process data into histograms for the given process type. - * - * @param aAccumulations - accumulation actions to perform - */ -void AccumulateChildHistograms(GeckoProcessType aProcessType, const nsTArray& aAccumulations); - -/** - * Accumulate child process data into keyed histograms for the given process type. - * - * @param aAccumulations - accumulation actions to perform - */ -void AccumulateChildKeyedHistograms(GeckoProcessType aProcessType, const nsTArray& aAccumulations); - -/** - * Update scalars for the given process type with the data coming from child process. - * - * @param aScalarActions - actions to update the scalar data - */ -void UpdateChildScalars(GeckoProcessType aProcessType, const nsTArray& aScalarActions); - -/** - * Update keyed scalars for the given process type with the data coming from child process. - * - * @param aScalarActions - actions to update the keyed scalar data - */ -void UpdateChildKeyedScalars(GeckoProcessType aProcessType, const nsTArray& aScalarActions); - -} -} - -#endif // TelemetryIPC_h__ diff --git a/toolkit/components/telemetry/moz.build b/toolkit/components/telemetry/moz.build index ab5258fc67a6..04ea04a93ea3 100644 --- a/toolkit/components/telemetry/moz.build +++ b/toolkit/components/telemetry/moz.build @@ -43,20 +43,18 @@ EXPORTS.mozilla += [ '!TelemetryEventEnums.h', '!TelemetryHistogramEnums.h', '!TelemetryScalarEnums.h', - 'ipc/TelemetryComms.h', - 'ipc/TelemetryIPC.h', 'ProcessedStack.h', 'Telemetry.h', + 'TelemetryComms.h', 'ThreadHangStats.h', ] SOURCES += [ - 'ipc/TelemetryIPC.cpp', - 'ipc/TelemetryIPCAccumulator.cpp', 'Telemetry.cpp', 'TelemetryCommon.cpp', 'TelemetryEvent.cpp', 'TelemetryHistogram.cpp', + 'TelemetryIPCAccumulator.cpp', 'TelemetryScalar.cpp', 'WebrtcTelemetry.cpp', ]