From 7433982068c3cf45e9b81bd77e5450cf3e715138 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 13 Jun 2016 09:55:08 +0200 Subject: [PATCH] Backed out changeset 5038112b5f78 (bug 1277275) for bustage --- netwerk/cache2/CacheIOThread.cpp | 77 +++++-------------- netwerk/cache2/CacheIOThread.h | 7 +- toolkit/components/telemetry/Histograms.json | 48 ------------ .../telemetry/histogram-whitelists.json | 16 ---- 4 files changed, 21 insertions(+), 127 deletions(-) diff --git a/netwerk/cache2/CacheIOThread.cpp b/netwerk/cache2/CacheIOThread.cpp index d5acfec5218a..b724a82973eb 100644 --- a/netwerk/cache2/CacheIOThread.cpp +++ b/netwerk/cache2/CacheIOThread.cpp @@ -14,54 +14,6 @@ namespace mozilla { namespace net { -namespace { // anon - -class CacheIOTelemetry -{ -public: - typedef CacheIOThread::EventQueue::size_type size_type; - static size_type mMinLengthToReport[CacheIOThread::LAST_LEVEL]; - static void Report(uint32_t aLevel, uint32_t aLength); -}; - -static CacheIOTelemetry::size_type const kGranularity = 30; - -uint32_t CacheIOTelemetry::mMinLengthToReport[CacheIOThread::LAST_LEVEL] = { - kGranularity, kGranularity, kGranularity, kGranularity, - kGranularity, kGranularity, kGranularity, kGranularity -}; - -// static -void CacheIOTelemetry::Report(uint32_t aLevel, size_type aLength) -{ - if (mMinLengthToReport[aLevel] > aLength) { - return; - } - - static Telemetry::ID telemetryID[] = { - Telemetry::HTTP_CACHE_IO_QUEUE_OPEN_PRIORITY, - Telemetry::HTTP_CACHE_IO_QUEUE_READ_PRIORITY, - Telemetry::HTTP_CACHE_IO_QUEUE_OPEN, - Telemetry::HTTP_CACHE_IO_QUEUE_READ, - Telemetry::HTTP_CACHE_IO_QUEUE_MANAGEMENT, - Telemetry::HTTP_CACHE_IO_QUEUE_WRITE, - Telemetry::HTTP_CACHE_IO_QUEUE_INDEX, - Telemetry::HTTP_CACHE_IO_QUEUE_EVICT - }; - - // Each bucket is a multiply of kGranularity (30, 60, 90..., 300+) - aLength = (aLength / kGranularity); - // Next time report only when over the current length + kGranularity - mMinLengthToReport[aLevel] = (aLength + 1) * kGranularity; - - // 10 is number of buckets we have in each probe - aLength = std::min(aLength, 10); - - Telemetry::Accumulate(telemetryID[aLevel], aLength - 1); // counted from 0 -} - -} // anon - CacheIOThread* CacheIOThread::sSelf = nullptr; NS_IMPL_ISUPPORTS(CacheIOThread, nsIThreadObserver) @@ -303,18 +255,32 @@ loopStart: threadInternal->SetObserver(nullptr); } +static const char* const sLevelTraceName[] = { + "net::cache::io::level(0)", + "net::cache::io::level(1)", + "net::cache::io::level(2)", + "net::cache::io::level(3)", + "net::cache::io::level(4)", + "net::cache::io::level(5)", + "net::cache::io::level(6)", + "net::cache::io::level(7)", + "net::cache::io::level(8)", + "net::cache::io::level(9)", + "net::cache::io::level(10)", + "net::cache::io::level(11)", + "net::cache::io::level(12)" +}; + void CacheIOThread::LoopOneLevel(uint32_t aLevel) { - EventQueue events; + nsTArray > events; events.SwapElements(mEventQueue[aLevel]); - EventQueue::size_type length = events.Length(); + uint32_t length = events.Length(); mCurrentlyExecutingLevel = aLevel; bool returnEvents = false; - bool reportTelementry = true; - - EventQueue::size_type index; + uint32_t index; { MonitorAutoUnlock unlock(mMonitor); @@ -326,11 +292,6 @@ void CacheIOThread::LoopOneLevel(uint32_t aLevel) break; } - if (reportTelementry) { - reportTelementry = false; - CacheIOTelemetry::Report(aLevel, length); - } - // Drop any previous flagging, only an event on the current level may set // this flag. mRerunCurrentEvent = false; diff --git a/netwerk/cache2/CacheIOThread.h b/netwerk/cache2/CacheIOThread.h index a4a7899fd723..314378f22236 100644 --- a/netwerk/cache2/CacheIOThread.h +++ b/netwerk/cache2/CacheIOThread.h @@ -29,9 +29,7 @@ public: CacheIOThread(); - typedef nsTArray> EventQueue; - - enum ELevel : uint32_t { + enum ELevel { OPEN_PRIORITY, READ_PRIORITY, OPEN, @@ -93,8 +91,7 @@ private: Atomic mXPCOMThread; Atomic mLowestLevelWaiting; uint32_t mCurrentlyExecutingLevel; - - EventQueue mEventQueue[LAST_LEVEL]; + nsTArray > mEventQueue[LAST_LEVEL]; Atomic mHasXPCOMEvents; bool mRerunCurrentEvent; diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index fa965976df4a..b77f7be083b4 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -1800,54 +1800,6 @@ "kind": "boolean", "description": "Rate of page load from offline cache" }, - "HTTP_CACHE_IO_QUEUE_OPEN_PRIORITY": { - "expires_in_version": "54", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_READ_PRIORITY": { - "expires_in_version": "54", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_OPEN": { - "expires_in_version": "54", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_READ": { - "expires_in_version": "54", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_MANAGEMENT": { - "expires_in_version": "54", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_WRITE": { - "expires_in_version": "54", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_INDEX": { - "expires_in_version": "54", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, - "HTTP_CACHE_IO_QUEUE_EVICT": { - "expires_in_version": "54", - "kind": "enumerated", - "n_values": 10, - "description": "HTTP Cache IO queue length" - }, "CACHE_DEVICE_SEARCH_2": { "expires_in_version": "never", "kind": "exponential", diff --git a/toolkit/components/telemetry/histogram-whitelists.json b/toolkit/components/telemetry/histogram-whitelists.json index 51bc8a99cee7..5c952ad9cd71 100644 --- a/toolkit/components/telemetry/histogram-whitelists.json +++ b/toolkit/components/telemetry/histogram-whitelists.json @@ -518,14 +518,6 @@ "HTTP_MEMORY_CACHE_DISPOSITION_2", "HTTP_OFFLINE_CACHE_DISPOSITION_2", "HTTP_OFFLINE_CACHE_DOCUMENT_LOAD", - "HTTP_CACHE_IO_QUEUE_OPEN_PRIORITY", - "HTTP_CACHE_IO_QUEUE_READ_PRIORITY", - "HTTP_CACHE_IO_QUEUE_OPEN", - "HTTP_CACHE_IO_QUEUE_READ", - "HTTP_CACHE_IO_QUEUE_MANAGEMENT", - "HTTP_CACHE_IO_QUEUE_WRITE", - "HTTP_CACHE_IO_QUEUE_INDEX", - "HTTP_CACHE_IO_QUEUE_EVICT", "HTTP_PAGELOAD_IS_SSL", "HTTP_PAGE_CACHE_READ_TIME", "HTTP_PAGE_CACHE_READ_TIME_V2", @@ -1685,14 +1677,6 @@ "HTTP_MEMORY_CACHE_DISPOSITION_2", "HTTP_OFFLINE_CACHE_DISPOSITION_2", "HTTP_OFFLINE_CACHE_DOCUMENT_LOAD", - "HTTP_CACHE_IO_QUEUE_OPEN_PRIORITY", - "HTTP_CACHE_IO_QUEUE_READ_PRIORITY", - "HTTP_CACHE_IO_QUEUE_OPEN", - "HTTP_CACHE_IO_QUEUE_READ", - "HTTP_CACHE_IO_QUEUE_MANAGEMENT", - "HTTP_CACHE_IO_QUEUE_WRITE", - "HTTP_CACHE_IO_QUEUE_INDEX", - "HTTP_CACHE_IO_QUEUE_EVICT", "HTTP_PAGELOAD_IS_SSL", "HTTP_PAGE_CACHE_READ_TIME", "HTTP_PAGE_CACHE_READ_TIME_V2",