diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-24 14:06:04 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-24 14:06:04 +0200 |
commit | ac25827a87d86f1cf9e48aab6605f77a2c89041a (patch) | |
tree | c3533a008e606f4f6393e838b4305cf6d07f47d2 /toolkit/components/telemetry/Telemetry.cpp | |
parent | c8b38a18031f6ae0fca8b2bef73daa86f6f96ae8 (diff) | |
download | UXP-ac25827a87d86f1cf9e48aab6605f77a2c89041a.tar UXP-ac25827a87d86f1cf9e48aab6605f77a2c89041a.tar.gz UXP-ac25827a87d86f1cf9e48aab6605f77a2c89041a.tar.lz UXP-ac25827a87d86f1cf9e48aab6605f77a2c89041a.tar.xz UXP-ac25827a87d86f1cf9e48aab6605f77a2c89041a.zip |
Remove SPS profiler.
- Conditionals and code blocks. (MOZ_ENABLE_PROFILER_SPS)
- Stub out several profiler-only functions.
Diffstat (limited to 'toolkit/components/telemetry/Telemetry.cpp')
-rw-r--r-- | toolkit/components/telemetry/Telemetry.cpp | 136 |
1 files changed, 0 insertions, 136 deletions
diff --git a/toolkit/components/telemetry/Telemetry.cpp b/toolkit/components/telemetry/Telemetry.cpp index 6dbd59bcf..f0a1789d6 100644 --- a/toolkit/components/telemetry/Telemetry.cpp +++ b/toolkit/components/telemetry/Telemetry.cpp @@ -73,9 +73,6 @@ #include "mozilla/PoisonIOInterposer.h" #include "mozilla/StartupTimeline.h" #include "mozilla/HangMonitor.h" -#if defined(MOZ_ENABLE_PROFILER_SPS) -#include "shared-libraries.h" -#endif namespace { @@ -682,13 +679,6 @@ public: static void ShutdownTelemetry(); static void RecordSlowStatement(const nsACString &sql, const nsACString &dbName, uint32_t delay); -#if defined(MOZ_ENABLE_PROFILER_SPS) - static void RecordChromeHang(uint32_t aDuration, - Telemetry::ProcessedStack &aStack, - int32_t aSystemUptime, - int32_t aFirefoxUptime, - HangAnnotationsPtr aAnnotations); -#endif static void RecordThreadHangStats(Telemetry::ThreadHangStats& aStats); size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf); struct Stat { @@ -2224,31 +2214,6 @@ TelemetryImpl::RecordIceCandidates(const uint32_t iceCandidateBitmask, sTelemetry->mWebrtcTelemetry.RecordIceCandidateMask(iceCandidateBitmask, success); } -#if defined(MOZ_ENABLE_PROFILER_SPS) -void -TelemetryImpl::RecordChromeHang(uint32_t aDuration, - Telemetry::ProcessedStack &aStack, - int32_t aSystemUptime, - int32_t aFirefoxUptime, - HangAnnotationsPtr aAnnotations) -{ - if (!sTelemetry || !TelemetryHistogram::CanRecordExtended()) - return; - - HangAnnotationsPtr annotations; - // We only pass aAnnotations if it is not empty. - if (aAnnotations && !aAnnotations->IsEmpty()) { - annotations = Move(aAnnotations); - } - - MutexAutoLock hangReportMutex(sTelemetry->mHangReportsMutex); - - sTelemetry->mHangReports.AddHang(aStack, aDuration, - aSystemUptime, aFirefoxUptime, - Move(annotations)); -} -#endif - void TelemetryImpl::RecordThreadHangStats(Telemetry::ThreadHangStats& aStats) { @@ -2452,18 +2417,6 @@ struct StackFrame uint16_t mModIndex; // The index of module that has this program counter. }; -#ifdef MOZ_ENABLE_PROFILER_SPS -static bool CompareByPC(const StackFrame &a, const StackFrame &b) -{ - return a.mPC < b.mPC; -} - -static bool CompareByIndex(const StackFrame &a, const StackFrame &b) -{ - return a.mIndex < b.mIndex; -} -#endif - } // namespace @@ -2629,60 +2582,6 @@ GetStackAndModules(const std::vector<uintptr_t>& aPCs) rawStack.push_back(Frame); } -#ifdef MOZ_ENABLE_PROFILER_SPS - // Remove all modules not referenced by a PC on the stack - std::sort(rawStack.begin(), rawStack.end(), CompareByPC); - - size_t moduleIndex = 0; - size_t stackIndex = 0; - size_t stackSize = rawStack.size(); - - SharedLibraryInfo rawModules = SharedLibraryInfo::GetInfoForSelf(); - rawModules.SortByAddress(); - - while (moduleIndex < rawModules.GetSize()) { - const SharedLibrary& module = rawModules.GetEntry(moduleIndex); - uintptr_t moduleStart = module.GetStart(); - uintptr_t moduleEnd = module.GetEnd() - 1; - // the interval is [moduleStart, moduleEnd) - - bool moduleReferenced = false; - for (;stackIndex < stackSize; ++stackIndex) { - uintptr_t pc = rawStack[stackIndex].mPC; - if (pc >= moduleEnd) - break; - - if (pc >= moduleStart) { - // If the current PC is within the current module, mark - // module as used - moduleReferenced = true; - rawStack[stackIndex].mPC -= moduleStart; - rawStack[stackIndex].mModIndex = moduleIndex; - } else { - // PC does not belong to any module. It is probably from - // the JIT. Use a fixed mPC so that we don't get different - // stacks on different runs. - rawStack[stackIndex].mPC = - std::numeric_limits<uintptr_t>::max(); - } - } - - if (moduleReferenced) { - ++moduleIndex; - } else { - // Remove module if no PCs within its address range - rawModules.RemoveEntries(moduleIndex, moduleIndex + 1); - } - } - - for (;stackIndex < stackSize; ++stackIndex) { - // These PCs are past the last module. - rawStack[stackIndex].mPC = std::numeric_limits<uintptr_t>::max(); - } - - std::sort(rawStack.begin(), rawStack.end(), CompareByIndex); -#endif - // Copy the information to the return value. ProcessedStack Ret; for (std::vector<StackFrame>::iterator i = rawStack.begin(), @@ -2692,28 +2591,6 @@ GetStackAndModules(const std::vector<uintptr_t>& aPCs) Ret.AddFrame(frame); } -#ifdef MOZ_ENABLE_PROFILER_SPS - for (unsigned i = 0, n = rawModules.GetSize(); i != n; ++i) { - const SharedLibrary &info = rawModules.GetEntry(i); - const std::string &name = info.GetName(); - std::string basename = name; -#ifdef XP_MACOSX - // FIXME: We want to use just the basename as the libname, but the - // current profiler addon needs the full path name, so we compute the - // basename in here. - size_t pos = name.rfind('/'); - if (pos != std::string::npos) { - basename = name.substr(pos + 1); - } -#endif - mozilla::Telemetry::ProcessedStack::Module module = { - basename, - info.GetBreakpadId() - }; - Ret.AddModule(module); - } -#endif - return Ret; } @@ -2910,19 +2787,6 @@ void Init() MOZ_ASSERT(telemetryService); } -#if defined(MOZ_ENABLE_PROFILER_SPS) -void RecordChromeHang(uint32_t duration, - ProcessedStack &aStack, - int32_t aSystemUptime, - int32_t aFirefoxUptime, - HangAnnotationsPtr aAnnotations) -{ - TelemetryImpl::RecordChromeHang(duration, aStack, - aSystemUptime, aFirefoxUptime, - Move(aAnnotations)); -} -#endif - void RecordThreadHangStats(ThreadHangStats& aStats) { TelemetryImpl::RecordThreadHangStats(aStats); |