OLD | NEW |
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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 } | 293 } |
294 | 294 |
295 void CpuProfiler::CollectSample() { | 295 void CpuProfiler::CollectSample() { |
296 if (processor_) { | 296 if (processor_) { |
297 processor_->AddCurrentStack(isolate_); | 297 processor_->AddCurrentStack(isolate_); |
298 } | 298 } |
299 } | 299 } |
300 | 300 |
301 void CpuProfiler::StartProfiling(const char* title, bool record_samples) { | 301 void CpuProfiler::StartProfiling(const char* title, bool record_samples) { |
302 if (profiles_->StartProfiling(title, record_samples)) { | 302 if (profiles_->StartProfiling(title, record_samples)) { |
| 303 TRACE_EVENT0("v8", "CpuProfiler::StartProfiling"); |
303 StartProcessorIfNotStarted(); | 304 StartProcessorIfNotStarted(); |
304 } | 305 } |
305 } | 306 } |
306 | 307 |
307 | 308 |
308 void CpuProfiler::StartProfiling(String* title, bool record_samples) { | 309 void CpuProfiler::StartProfiling(String* title, bool record_samples) { |
309 StartProfiling(profiles_->GetName(title), record_samples); | 310 StartProfiling(profiles_->GetName(title), record_samples); |
310 isolate_->debug()->feature_tracker()->Track(DebugFeatureTracker::kProfiler); | 311 isolate_->debug()->feature_tracker()->Track(DebugFeatureTracker::kProfiler); |
311 } | 312 } |
312 | 313 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; | 380 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; |
380 Builtins::Name id = static_cast<Builtins::Name>(i); | 381 Builtins::Name id = static_cast<Builtins::Name>(i); |
381 rec->start = builtins->builtin(id)->address(); | 382 rec->start = builtins->builtin(id)->address(); |
382 rec->builtin_id = id; | 383 rec->builtin_id = id; |
383 processor_->Enqueue(evt_rec); | 384 processor_->Enqueue(evt_rec); |
384 } | 385 } |
385 } | 386 } |
386 | 387 |
387 } // namespace internal | 388 } // namespace internal |
388 } // namespace v8 | 389 } // namespace v8 |
OLD | NEW |