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

Unified Diff: src/platform-win32.cc

Issue 1635005: Allow new CPU profiling subsystem to coexist nicely with the old one. (Closed)
Patch Set: Fix TickSampleEvent Created 10 years, 8 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
Index: src/platform-win32.cc
diff --git a/src/platform-win32.cc b/src/platform-win32.cc
index fcf1f8f18b360ffe451243ea1dddc6b3457937d0..7f3d95a4c4f7539baba145fc502e0259f153f925 100644
--- a/src/platform-win32.cc
+++ b/src/platform-win32.cc
@@ -1805,15 +1805,12 @@ class Sampler::PlatformData : public Malloced {
memset(&context, 0, sizeof(context));
// Loop until the sampler is disengaged, keeping the specified samling freq.
for ( ; sampler_->IsActive(); Sleep(sampler_->interval_)) {
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
- TickSample* sample = CpuProfiler::TickSampleEvent();
- if (sample == NULL) continue;
- sample->pc = NULL; // Impossible value if sampling succeeds.
- sample->frames_count = 0;
-#else
TickSample sample_obj;
- TickSample* sample = &sample_obj;
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
+ TickSample* sample = NULL;
+#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+ sample = CpuProfiler::TickSampleEvent();
+#endif
+ if (sample == NULL) sample = &sample_obj;
// We always sample the VM state.
sample->state = VMState::current_state();
@@ -1836,10 +1833,8 @@ class Sampler::PlatformData : public Malloced {
ResumeThread(profiled_thread_);
}
-#ifndef ENABLE_CPP_PROFILES_PROCESSOR
// Invoke tick handler with program counter and stack pointer.
sampler_->Tick(sample);
-#endif
}
}
};
« src/cpu-profiler-inl.h ('K') | « src/platform-macos.cc ('k') | src/v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698