diff options
author | wicknix <39230578+wicknix@users.noreply.github.com> | 2019-04-15 18:58:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-15 18:58:07 -0500 |
commit | 5a1843c9f9e323627f9c35529e6a8c853d4dbb0d (patch) | |
tree | 62de3cd7cb8a6f75e568863bb73ca2deb80d87a9 /devtools/shared/heapsnapshot | |
parent | 065f6f9e5ebc1ed6cfaadaf7851b6021fa94a013 (diff) | |
parent | 095ea556855b38138e39e713f482eb440f7da9b2 (diff) | |
download | UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.gz UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.lz UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.xz UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.zip |
Merge pull request #1 from MoonchildProductions/master
keep up with mc
Diffstat (limited to 'devtools/shared/heapsnapshot')
-rw-r--r-- | devtools/shared/heapsnapshot/HeapSnapshot.cpp | 37 | ||||
-rw-r--r-- | devtools/shared/heapsnapshot/HeapSnapshot.h | 17 |
2 files changed, 3 insertions, 51 deletions
diff --git a/devtools/shared/heapsnapshot/HeapSnapshot.cpp b/devtools/shared/heapsnapshot/HeapSnapshot.cpp index 17f43f34e..299a96a9c 100644 --- a/devtools/shared/heapsnapshot/HeapSnapshot.cpp +++ b/devtools/shared/heapsnapshot/HeapSnapshot.cpp @@ -28,7 +28,6 @@ #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/HeapSnapshotBinding.h" #include "mozilla/RangedPtr.h" -#include "mozilla/Telemetry.h" #include "mozilla/Unused.h" #include "jsapi.h" @@ -1352,10 +1351,6 @@ class MOZ_STACK_CLASS HeapSnapshotHandler JS::CompartmentSet* compartments; public: - // For telemetry. - uint32_t nodeCount; - uint32_t edgeCount; - HeapSnapshotHandler(CoreDumpWriter& writer, JS::CompartmentSet* compartments) : writer(writer), @@ -1372,8 +1367,6 @@ public: NodeData*, bool first) { - edgeCount++; - // We're only interested in the first time we reach edge.referent, not in // every edge arriving at that node. "But, don't we want to serialize every // edge in the heap graph?" you ask. Don't worry! This edge is still @@ -1387,8 +1380,6 @@ public: if (!ShouldIncludeEdge(compartments, origin, edge, &policy)) return true; - nodeCount++; - if (policy == CoreDumpWriter::EXCLUDE_EDGES) traversal.abandonReferent(); @@ -1403,9 +1394,7 @@ WriteHeapGraph(JSContext* cx, CoreDumpWriter& writer, bool wantNames, JS::CompartmentSet* compartments, - JS::AutoCheckCannotGC& noGC, - uint32_t& outNodeCount, - uint32_t& outEdgeCount) + JS::AutoCheckCannotGC& noGC) { // Serialize the starting node to the core dump. @@ -1425,11 +1414,6 @@ WriteHeapGraph(JSContext* cx, bool ok = traversal.addStartVisited(node) && traversal.traverse(); - if (ok) { - outNodeCount = handler.nodeCount; - outEdgeCount = handler.edgeCount; - } - return ok; } @@ -1563,8 +1547,6 @@ ThreadSafeChromeUtils::SaveHeapSnapshot(GlobalObject& global, bool wantNames = true; CompartmentSet compartments; - uint32_t nodeCount = 0; - uint32_t edgeCount = 0; nsCOMPtr<nsIOutputStream> outputStream = getCoreDumpOutputStream(rv, start, outFilePath); if (NS_WARN_IF(rv.Failed())) @@ -1600,9 +1582,7 @@ ThreadSafeChromeUtils::SaveHeapSnapshot(GlobalObject& global, writer, wantNames, compartments.initialized() ? &compartments : nullptr, - maybeNoGC.ref(), - nodeCount, - edgeCount)) + maybeNoGC.ref())) { rv.Throw(zeroCopyStream.failed() ? zeroCopyStream.result() @@ -1610,13 +1590,6 @@ ThreadSafeChromeUtils::SaveHeapSnapshot(GlobalObject& global, return; } } - - Telemetry::AccumulateTimeDelta(Telemetry::DEVTOOLS_SAVE_HEAP_SNAPSHOT_MS, - start); - Telemetry::Accumulate(Telemetry::DEVTOOLS_HEAP_SNAPSHOT_NODE_COUNT, - nodeCount); - Telemetry::Accumulate(Telemetry::DEVTOOLS_HEAP_SNAPSHOT_EDGE_COUNT, - edgeCount); } /* static */ already_AddRefed<HeapSnapshot> @@ -1624,8 +1597,6 @@ ThreadSafeChromeUtils::ReadHeapSnapshot(GlobalObject& global, const nsAString& filePath, ErrorResult& rv) { - auto start = TimeStamp::Now(); - UniquePtr<char[]> path(ToNewCString(filePath)); if (!path) { rv.Throw(NS_ERROR_OUT_OF_MEMORY); @@ -1641,10 +1612,6 @@ ThreadSafeChromeUtils::ReadHeapSnapshot(GlobalObject& global, global.Context(), global, reinterpret_cast<const uint8_t*>(mm.address()), mm.size(), rv); - if (!rv.Failed()) - Telemetry::AccumulateTimeDelta(Telemetry::DEVTOOLS_READ_HEAP_SNAPSHOT_MS, - start); - return snapshot.forget(); } diff --git a/devtools/shared/heapsnapshot/HeapSnapshot.h b/devtools/shared/heapsnapshot/HeapSnapshot.h index 0428033f6..12dfa4c2b 100644 --- a/devtools/shared/heapsnapshot/HeapSnapshot.h +++ b/devtools/shared/heapsnapshot/HeapSnapshot.h @@ -213,22 +213,7 @@ WriteHeapGraph(JSContext* cx, CoreDumpWriter& writer, bool wantNames, JS::CompartmentSet* compartments, - JS::AutoCheckCannotGC& noGC, - uint32_t& outNodeCount, - uint32_t& outEdgeCount); -inline bool -WriteHeapGraph(JSContext* cx, - const JS::ubi::Node& node, - CoreDumpWriter& writer, - bool wantNames, - JS::CompartmentSet* compartments, - JS::AutoCheckCannotGC& noGC) -{ - uint32_t ignoreNodeCount; - uint32_t ignoreEdgeCount; - return WriteHeapGraph(cx, node, writer, wantNames, compartments, noGC, - ignoreNodeCount, ignoreEdgeCount); -} + JS::AutoCheckCannotGC& noGC); // Get the mozilla::MallocSizeOf for the current thread's JSRuntime. MallocSizeOf GetCurrentThreadDebuggerMallocSizeOf(); |