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

Unified Diff: src/cpu-profiler.cc

Issue 6712062: Fix DevTools CPU profiler after isolates merge. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index c0a2c2b4ffe4ae9e1826c6e29416c1e81abafcf0..7387a4c4f88345712a68ba6a705dcda530de3272 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -441,6 +441,7 @@ CpuProfiler::CpuProfiler()
token_enumerator_(new TokenEnumerator()),
generator_(NULL),
processor_(NULL),
+ need_to_stop_sampler_(false),
is_profiling_(false) {
}
@@ -486,7 +487,10 @@ void CpuProfiler::StartProcessorIfNotStarted() {
}
// Enable stack sampling.
Sampler* sampler = reinterpret_cast<Sampler*>(LOGGER->ticker_);
- if (!sampler->IsActive()) sampler->Start();
+ if (!sampler->IsActive()) {
+ sampler->Start();
+ need_to_stop_sampler_ = true;
+ }
sampler->IncreaseProfilingDepth();
}
}
@@ -520,7 +524,10 @@ void CpuProfiler::StopProcessorIfLastProfile(const char* title) {
if (profiles_->IsLastProfile(title)) {
Sampler* sampler = reinterpret_cast<Sampler*>(LOGGER->ticker_);
sampler->DecreaseProfilingDepth();
- sampler->Stop();
+ if (need_to_stop_sampler_) {
+ sampler->Stop();
+ need_to_stop_sampler_ = false;
+ }
processor_->Stop();
processor_->Join();
delete processor_;
« no previous file with comments | « src/cpu-profiler.h ('k') | src/platform-linux.cc » ('j') | src/platform-linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698