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

Unified Diff: src/cpu-profiler.cc

Issue 11231002: Perform CPU sampling by CPU sampling thread only iff processing thread is not running. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 8 years, 2 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 | « no previous file | src/platform.h » ('j') | src/platform.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index 8f72c1755cb898264e4d2a5ba029ebc77b019f09..220daca14b18dd8436c0b166cf6ebee1966fd208 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -250,9 +250,7 @@ void ProfilerEventsProcessor::Run() {
while (running_) {
int64_t stop_time = OS::Ticks() + period_in_useconds_;
- if (sampler_ != NULL) {
- sampler_->DoSample();
- }
+ sampler_->DoSample();
ProcessEventsQueue(stop_time, &dequeue_order);
}
@@ -519,6 +517,7 @@ void CpuProfiler::StartProcessorIfNotStarted() {
sampler->Start();
need_to_stop_sampler_ = true;
}
+ sampler->SetHasProcessingThread(true);
sampler->IncreaseProfilingDepth();
processor_->Start();
}
@@ -561,6 +560,7 @@ void CpuProfiler::StopProcessor() {
Logger* logger = Isolate::Current()->logger();
Sampler* sampler = logger->sampler();
sampler->DecreaseProfilingDepth();
+ sampler->SetHasProcessingThread(false);
if (need_to_stop_sampler_) {
sampler->Stop();
need_to_stop_sampler_ = false;
« no previous file with comments | « no previous file | src/platform.h » ('j') | src/platform.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698