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

Unified Diff: src/cpu-profiler.cc

Issue 263883008: Make sure CPU profiler collects a sample on start. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | no next file » | no next file with comments »
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 eecf4dcf685c608f8aced66b8975d37204de1658..abe29340d02164623b37768fd2205d8f7488b78d 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -418,30 +418,32 @@ void CpuProfiler::StartProfiling(String* title, bool record_samples) {
void CpuProfiler::StartProcessorIfNotStarted() {
- if (processor_ == NULL) {
- Logger* logger = isolate_->logger();
- // Disable logging when using the new implementation.
- saved_is_logging_ = logger->is_logging_;
- logger->is_logging_ = false;
- generator_ = new ProfileGenerator(profiles_);
- Sampler* sampler = logger->sampler();
- processor_ = new ProfilerEventsProcessor(
- generator_, sampler, sampling_interval_);
- is_profiling_ = true;
- // Enumerate stuff we already have in the heap.
- ASSERT(isolate_->heap()->HasBeenSetUp());
- if (!FLAG_prof_browser_mode) {
- logger->LogCodeObjects();
- }
- logger->LogCompiledFunctions();
- logger->LogAccessorCallbacks();
- LogBuiltins();
- // Enable stack sampling.
- sampler->SetHasProcessingThread(true);
- sampler->IncreaseProfilingDepth();
+ if (processor_ != NULL) {
processor_->AddCurrentStack(isolate_);
- processor_->StartSynchronously();
+ return;
+ }
+ Logger* logger = isolate_->logger();
+ // Disable logging when using the new implementation.
+ saved_is_logging_ = logger->is_logging_;
+ logger->is_logging_ = false;
+ generator_ = new ProfileGenerator(profiles_);
+ Sampler* sampler = logger->sampler();
+ processor_ = new ProfilerEventsProcessor(
+ generator_, sampler, sampling_interval_);
+ is_profiling_ = true;
+ // Enumerate stuff we already have in the heap.
+ ASSERT(isolate_->heap()->HasBeenSetUp());
+ if (!FLAG_prof_browser_mode) {
+ logger->LogCodeObjects();
}
+ logger->LogCompiledFunctions();
+ logger->LogAccessorCallbacks();
+ LogBuiltins();
+ // Enable stack sampling.
+ sampler->SetHasProcessingThread(true);
+ sampler->IncreaseProfilingDepth();
+ processor_->AddCurrentStack(isolate_);
+ processor_->StartSynchronously();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698