Support higher CPU profiler sampling rate on Windows
authoryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 29 Aug 2013 13:44:25 +0000 (13:44 +0000)
committeryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 29 Aug 2013 13:44:25 +0000 (13:44 +0000)
This change moves sampling from SamplerThread to the profiler events processing thread and allows to configure sampling interval on Windows.

Custom tick counter is used instead of OS::Ticks as the latter has maximum presicion of 1ms while we need 100us. QueryPerformanceCounter is used to retrieve high-precision time as described in http://msdn.microsoft.com/en-us/library/ee417693(VS.85).aspx

BUG=v8:2814
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/23271003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16428 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/sampler.cc

index c5551e1..85597e5 100644 (file)
@@ -609,6 +609,8 @@ void Sampler::SampleStack(const RegisterState& state) {
 bool Sampler::CanSampleOnProfilerEventsProcessorThread() {
 #if defined(USE_SIGNALS)
   return true;
+#elif V8_OS_WIN || V8_OS_CYGWIN
+  return true;
 #else
   return false;
 #endif