Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: src/platform-win32.cc

Issue 50052: Support profiler stack sampling in any situation. (Closed)
Patch Set: Fixes according to comments Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log.cc ('k') | test/cctest/test-log-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-win32.cc
diff --git a/src/platform-win32.cc b/src/platform-win32.cc
index c1ec2fc9e9c8190a827e1307143331877556dc11..04e786005d1be867d78155d8b40ff2c4086e856f 100644
--- a/src/platform-win32.cc
+++ b/src/platform-win32.cc
@@ -1750,7 +1750,6 @@ class Sampler::PlatformData : public Malloced {
SuspendThread(profiled_thread_);
context.ContextFlags = CONTEXT_FULL;
GetThreadContext(profiled_thread_, &context);
- ResumeThread(profiled_thread_);
// Invoke tick handler with program counter and stack pointer.
sample.pc = context.Eip;
sample.sp = context.Esp;
@@ -1761,6 +1760,10 @@ class Sampler::PlatformData : public Malloced {
sample.state = Logger::state();
sampler_->Tick(&sample);
+ if (sampler_->IsProfiling()) {
+ ResumeThread(profiled_thread_);
+ }
+
// Wait until next sampling.
Sleep(sampler_->interval_);
}
« no previous file with comments | « src/log.cc ('k') | test/cctest/test-log-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698