Index: Source/platform/heap/ThreadState.cpp |
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp |
index aaef9c1d8a73899115ae6a0840800578c7e63b0b..94d84b9b640d64f6c756430819e31835b3a80e92 100644 |
--- a/Source/platform/heap/ThreadState.cpp |
+++ b/Source/platform/heap/ThreadState.cpp |
@@ -35,6 +35,7 @@ |
#include "platform/heap/AddressSanitizer.h" |
#include "platform/heap/Handle.h" |
#include "platform/heap/Heap.h" |
+#include "public/platform/Platform.h" |
#include "wtf/ThreadingPrimitives.h" |
#if OS(WIN) |
@@ -819,8 +820,11 @@ void ThreadState::performPendingSweep() |
TRACE_EVENT0("Blink", "ThreadState::performPendingSweep"); |
const char* samplingState = TRACE_EVENT_GET_SAMPLING_STATE(); |
- if (isMainThread()) |
+ double timeStamp = 0; |
+ if (isMainThread()) { |
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "BlinkGCSweeping"); |
+ timeStamp = WTF::currentTimeMS(); |
Mads Ager (chromium)
2014/05/28 09:35:45
Is histogram collection also not thread safe? It w
haraken
2014/05/28 09:40:15
It's thread-safe.
At first, I thought that if we
haraken
2014/05/28 10:40:26
Done.
|
+ } |
m_sweepInProgress = true; |
// Disallow allocation during weak processing. |
@@ -837,8 +841,12 @@ void ThreadState::performPendingSweep() |
clearGCRequested(); |
clearSweepRequested(); |
- if (isMainThread()) |
+ if (isMainThread()) { |
TRACE_EVENT_SET_NONCONST_SAMPLING_STATE(samplingState); |
+ if (blink::Platform::current()) { |
+ blink::Platform::current()->histogramEnumeration("BlinkGC.PerformPendingSweep", WTF::currentTimeMS() - timeStamp, 30000); |
+ } |
+ } |
} |
void ThreadState::addInterruptor(Interruptor* interruptor) |