From b3ee84d361a15a38d89e9b27de59e01ec8f4cf27 Mon Sep 17 00:00:00 2001 From: "yurys@chromium.org" Date: Fri, 15 Mar 2013 12:46:45 +0000 Subject: [PATCH] Remove bottom-up CPU profile Bottom-up view of CPU profile can be restored based on top-down profile data. So there is no need to spend resources on creating both of them inside V8. BUG=None Review URL: https://codereview.chromium.org/12825003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13958 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8-profiler.h | 8 ++------ src/api.cc | 8 -------- src/cpu-profiler.cc | 1 - src/profile-generator.cc | 8 -------- src/profile-generator.h | 2 -- test/cctest/test-cpu-profiler.cc | 25 ------------------------- 6 files changed, 2 insertions(+), 50 deletions(-) diff --git a/include/v8-profiler.h b/include/v8-profiler.h index c9eab3f..32a35fd 100644 --- a/include/v8-profiler.h +++ b/include/v8-profiler.h @@ -116,9 +116,8 @@ class V8EXPORT CpuProfileNode { /** - * CpuProfile contains a CPU profile in a form of two call trees: - * - top-down (from main() down to functions that do all the work); - * - bottom-up call graph (in backward direction). + * CpuProfile contains a CPU profile in a form of top-down call tree + * (from main() down to functions that do all the work). */ class V8EXPORT CpuProfile { public: @@ -128,9 +127,6 @@ class V8EXPORT CpuProfile { /** Returns CPU profile title. */ Handle GetTitle() const; - /** Returns the root node of the bottom up call tree. */ - const CpuProfileNode* GetBottomUpRoot() const; - /** Returns the root node of the top down call tree. */ const CpuProfileNode* GetTopDownRoot() const; diff --git a/src/api.cc b/src/api.cc index 47928a6..d2c1402 100644 --- a/src/api.cc +++ b/src/api.cc @@ -6498,14 +6498,6 @@ Handle CpuProfile::GetTitle() const { } -const CpuProfileNode* CpuProfile::GetBottomUpRoot() const { - i::Isolate* isolate = i::Isolate::Current(); - IsDeadCheck(isolate, "v8::CpuProfile::GetBottomUpRoot"); - const i::CpuProfile* profile = reinterpret_cast(this); - return reinterpret_cast(profile->bottom_up()->root()); -} - - const CpuProfileNode* CpuProfile::GetTopDownRoot() const { i::Isolate* isolate = i::Isolate::Current(); IsDeadCheck(isolate, "v8::CpuProfile::GetTopDownRoot"); diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc index 7d56b8d..15edc1e 100644 --- a/src/cpu-profiler.cc +++ b/src/cpu-profiler.cc @@ -39,7 +39,6 @@ namespace v8 { namespace internal { -static const int kEventsBufferSize = 256 * KB; static const int kTickSamplesBufferChunkSize = 64 * KB; static const int kTickSamplesBufferChunksCount = 16; static const int kProfilerStackSize = 64 * KB; diff --git a/src/profile-generator.cc b/src/profile-generator.cc index a51de78..2bf1724 100644 --- a/src/profile-generator.cc +++ b/src/profile-generator.cc @@ -468,19 +468,16 @@ void ProfileTree::ShortPrint() { void CpuProfile::AddPath(const Vector& path) { top_down_.AddPathFromEnd(path); - bottom_up_.AddPathFromStart(path); } void CpuProfile::CalculateTotalTicks() { top_down_.CalculateTotalTicks(); - bottom_up_.CalculateTotalTicks(); } void CpuProfile::SetActualSamplingRate(double actual_sampling_rate) { top_down_.SetTickRatePerMs(actual_sampling_rate); - bottom_up_.SetTickRatePerMs(actual_sampling_rate); } @@ -488,7 +485,6 @@ CpuProfile* CpuProfile::FilteredClone(int security_token_id) { ASSERT(security_token_id != TokenEnumerator::kNoSecurityToken); CpuProfile* clone = new CpuProfile(title_, uid_); clone->top_down_.FilteredClone(&top_down_, security_token_id); - clone->bottom_up_.FilteredClone(&bottom_up_, security_token_id); return clone; } @@ -496,16 +492,12 @@ CpuProfile* CpuProfile::FilteredClone(int security_token_id) { void CpuProfile::ShortPrint() { OS::Print("top down "); top_down_.ShortPrint(); - OS::Print("bottom up "); - bottom_up_.ShortPrint(); } void CpuProfile::Print() { OS::Print("[Top down]:\n"); top_down_.Print(); - OS::Print("[Bottom up]:\n"); - bottom_up_.Print(); } diff --git a/src/profile-generator.h b/src/profile-generator.h index 8315f79..b128dad 100644 --- a/src/profile-generator.h +++ b/src/profile-generator.h @@ -222,7 +222,6 @@ class CpuProfile { INLINE(const char* title() const) { return title_; } INLINE(unsigned uid() const) { return uid_; } INLINE(const ProfileTree* top_down() const) { return &top_down_; } - INLINE(const ProfileTree* bottom_up() const) { return &bottom_up_; } void UpdateTicksScale(); @@ -233,7 +232,6 @@ class CpuProfile { const char* title_; unsigned uid_; ProfileTree top_down_; - ProfileTree bottom_up_; DISALLOW_COPY_AND_ASSIGN(CpuProfile); }; diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc index 2236f30..75e594e 100644 --- a/test/cctest/test-cpu-profiler.cc +++ b/test/cctest/test-cpu-profiler.cc @@ -211,31 +211,6 @@ TEST(TickEvents) { const i::List* top_down_ddd_children = top_down_stub_children->last()->children(); CHECK_EQ(0, top_down_ddd_children->length()); - - const i::List* bottom_up_root_children_unsorted = - profile->bottom_up()->root()->children(); - CHECK_EQ(3, bottom_up_root_children_unsorted->length()); - i::List bottom_up_root_children(3); - bottom_up_root_children.AddAll(*bottom_up_root_children_unsorted); - bottom_up_root_children.Sort(&CompareProfileNodes); - CHECK_EQ("5", bottom_up_root_children[0]->entry()->name()); - CHECK_EQ("bbb", bottom_up_root_children[1]->entry()->name()); - CHECK_EQ("ddd", bottom_up_root_children[2]->entry()->name()); - const i::List* bottom_up_stub_children = - bottom_up_root_children[0]->children(); - CHECK_EQ(1, bottom_up_stub_children->length()); - CHECK_EQ("bbb", bottom_up_stub_children->last()->entry()->name()); - const i::List* bottom_up_bbb_children = - bottom_up_root_children[1]->children(); - CHECK_EQ(0, bottom_up_bbb_children->length()); - const i::List* bottom_up_ddd_children = - bottom_up_root_children[2]->children(); - CHECK_EQ(1, bottom_up_ddd_children->length()); - CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name()); - const i::List* bottom_up_ddd_stub_children = - bottom_up_ddd_children->last()->children(); - CHECK_EQ(1, bottom_up_ddd_stub_children->length()); - CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name()); } -- 2.7.4