Index: src/v8.cc |
diff --git a/src/v8.cc b/src/v8.cc |
index 5af200348b4058e4c65075dc4d58102393f63fd9..2fe672d86fbd4f6565166f287289e8fdab8332b6 100644 |
--- a/src/v8.cc |
+++ b/src/v8.cc |
@@ -60,6 +60,14 @@ bool V8::Initialize(Deserializer* des) { |
// Enable logging before setting up the heap |
Logger::Setup(); |
+ CpuProfiler::Setup(); |
+ |
+#ifdef ENABLE_CPP_PROFILES_PROCESSOR |
+ if (FLAG_prof && FLAG_prof_auto) { |
+ CpuProfiler::StartProfiling("internal.auto"); |
+ } |
+#endif |
+ |
// Setup the platform OS support. |
OS::Setup(); |
@@ -135,6 +143,12 @@ void V8::SetFatalError() { |
void V8::TearDown() { |
if (!has_been_setup_ || has_been_disposed_) return; |
+#ifdef ENABLE_CPP_PROFILES_PROCESSOR |
+ if (FLAG_prof && FLAG_prof_auto) { |
+ CpuProfiler::StopProfiling("internal.auto"); |
+ } |
+#endif |
+ |
OProfileAgent::TearDown(); |
if (FLAG_preemption) { |
@@ -148,6 +162,9 @@ void V8::TearDown() { |
Top::TearDown(); |
Heap::TearDown(); |
+ |
+ CpuProfiler::TearDown(); |
+ |
Logger::TearDown(); |
is_running_ = false; |