| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Tests of profiles generator and utilities. | 3 // Tests of profiles generator and utilities. |
| 4 | 4 |
| 5 #ifdef ENABLE_LOGGING_AND_PROFILING | 5 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 6 | 6 |
| 7 #include "v8.h" | 7 #include "v8.h" |
| 8 #include "cpu-profiler-inl.h" | 8 #include "cpu-profiler-inl.h" |
| 9 #include "cctest.h" | 9 #include "cctest.h" |
| 10 | 10 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 0x80); | 169 0x80); |
| 170 EnqueueTickSampleEvent(&processor, ToAddress(0x1210)); | 170 EnqueueTickSampleEvent(&processor, ToAddress(0x1210)); |
| 171 EnqueueTickSampleEvent(&processor, ToAddress(0x1305), ToAddress(0x1220)); | 171 EnqueueTickSampleEvent(&processor, ToAddress(0x1305), ToAddress(0x1220)); |
| 172 EnqueueTickSampleEvent(&processor, | 172 EnqueueTickSampleEvent(&processor, |
| 173 ToAddress(0x1404), | 173 ToAddress(0x1404), |
| 174 ToAddress(0x1305), | 174 ToAddress(0x1305), |
| 175 ToAddress(0x1230)); | 175 ToAddress(0x1230)); |
| 176 | 176 |
| 177 processor.Stop(); | 177 processor.Stop(); |
| 178 processor.Join(); | 178 processor.Join(); |
| 179 CpuProfile* profile = profiles.StopProfiling(""); | 179 CpuProfile* profile = profiles.StopProfiling("", 1); |
| 180 CHECK_NE(NULL, profile); | 180 CHECK_NE(NULL, profile); |
| 181 | 181 |
| 182 // Check call trees. | 182 // Check call trees. |
| 183 const i::List<ProfileNode*>* top_down_root_children = | 183 const i::List<ProfileNode*>* top_down_root_children = |
| 184 profile->top_down()->root()->children(); | 184 profile->top_down()->root()->children(); |
| 185 CHECK_EQ(1, top_down_root_children->length()); | 185 CHECK_EQ(1, top_down_root_children->length()); |
| 186 CHECK_EQ("bbb", top_down_root_children->last()->entry()->name()); | 186 CHECK_EQ("bbb", top_down_root_children->last()->entry()->name()); |
| 187 const i::List<ProfileNode*>* top_down_bbb_children = | 187 const i::List<ProfileNode*>* top_down_bbb_children = |
| 188 top_down_root_children->last()->children(); | 188 top_down_root_children->last()->children(); |
| 189 CHECK_EQ(1, top_down_bbb_children->length()); | 189 CHECK_EQ(1, top_down_bbb_children->length()); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 216 bottom_up_root_children[2]->children(); | 216 bottom_up_root_children[2]->children(); |
| 217 CHECK_EQ(1, bottom_up_ddd_children->length()); | 217 CHECK_EQ(1, bottom_up_ddd_children->length()); |
| 218 CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name()); | 218 CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name()); |
| 219 const i::List<ProfileNode*>* bottom_up_ddd_stub_children = | 219 const i::List<ProfileNode*>* bottom_up_ddd_stub_children = |
| 220 bottom_up_ddd_children->last()->children(); | 220 bottom_up_ddd_children->last()->children(); |
| 221 CHECK_EQ(1, bottom_up_ddd_stub_children->length()); | 221 CHECK_EQ(1, bottom_up_ddd_stub_children->length()); |
| 222 CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name()); | 222 CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name()); |
| 223 } | 223 } |
| 224 | 224 |
| 225 #endif // ENABLE_LOGGING_AND_PROFILING | 225 #endif // ENABLE_LOGGING_AND_PROFILING |
| OLD | NEW |