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

Side by Side Diff: src/profiler/cpu-profiler.cc

Issue 2461003002: [profiler] Emit runtime call stats into sampling profile (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/profiler/cpu-profiler.h" 5 #include "src/profiler/cpu-profiler.h"
6 6
7 #include "src/debug/debug.h" 7 #include "src/debug/debug.h"
8 #include "src/deoptimizer.h" 8 #include "src/deoptimizer.h"
9 #include "src/frames-inl.h" 9 #include "src/frames-inl.h"
10 #include "src/locked-queue-inl.h" 10 #include "src/locked-queue-inl.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 void CpuProfiler::StartProcessorIfNotStarted() { 299 void CpuProfiler::StartProcessorIfNotStarted() {
300 if (processor_) { 300 if (processor_) {
301 processor_->AddCurrentStack(isolate_); 301 processor_->AddCurrentStack(isolate_);
302 return; 302 return;
303 } 303 }
304 Logger* logger = isolate_->logger(); 304 Logger* logger = isolate_->logger();
305 // Disable logging when using the new implementation. 305 // Disable logging when using the new implementation.
306 saved_is_logging_ = logger->is_logging_; 306 saved_is_logging_ = logger->is_logging_;
307 logger->is_logging_ = false; 307 logger->is_logging_ = false;
308 generator_.reset(new ProfileGenerator(profiles_.get())); 308 generator_.reset(new ProfileGenerator(isolate_, profiles_.get()));
309 processor_.reset(new ProfilerEventsProcessor(isolate_, generator_.get(), 309 processor_.reset(new ProfilerEventsProcessor(isolate_, generator_.get(),
310 sampling_interval_)); 310 sampling_interval_));
311 logger->SetUpProfilerListener(); 311 logger->SetUpProfilerListener();
312 ProfilerListener* profiler_listener = logger->profiler_listener(); 312 ProfilerListener* profiler_listener = logger->profiler_listener();
313 profiler_listener->AddObserver(this); 313 profiler_listener->AddObserver(this);
314 is_profiling_ = true; 314 is_profiling_ = true;
315 isolate_->set_is_profiling(true); 315 isolate_->set_is_profiling(true);
316 // Enumerate stuff we already have in the heap. 316 // Enumerate stuff we already have in the heap.
317 DCHECK(isolate_->heap()->HasBeenSetUp()); 317 DCHECK(isolate_->heap()->HasBeenSetUp());
318 if (!FLAG_prof_browser_mode) { 318 if (!FLAG_prof_browser_mode) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; 363 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_;
364 Builtins::Name id = static_cast<Builtins::Name>(i); 364 Builtins::Name id = static_cast<Builtins::Name>(i);
365 rec->start = builtins->builtin(id)->address(); 365 rec->start = builtins->builtin(id)->address();
366 rec->builtin_id = id; 366 rec->builtin_id = id;
367 processor_->Enqueue(evt_rec); 367 processor_->Enqueue(evt_rec);
368 } 368 }
369 } 369 }
370 370
371 } // namespace internal 371 } // namespace internal
372 } // namespace v8 372 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698