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

Unified Diff: src/platform-macos.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-macos.cc
diff --git a/src/platform-macos.cc b/src/platform-macos.cc
index b3ee49e2c9968c6c8b0fd7c9eadfdd96595f4ae4..e50517c8faa57b6658b8ea6050562dab17297fa4 100644
--- a/src/platform-macos.cc
+++ b/src/platform-macos.cc
@@ -546,15 +546,12 @@ class Sampler::PlatformData : public Malloced {
void Runner() {
// Loop until the sampler is disengaged, keeping the specified samling freq.
for ( ; sampler_->IsActive(); OS::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();
@@ -595,10 +592,8 @@ class Sampler::PlatformData : public Malloced {
thread_resume(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-linux.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698