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

Side by Side Diff: test/cctest/test-cpu-profiler.cc

Issue 1539038: Report approximated duration in milliseconds for profile nodes. (Closed)
Patch Set: Created 10 years, 8 months 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
« no previous file with comments | « src/profile-generator-inl.h ('k') | test/cctest/test-profile-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/profile-generator-inl.h ('k') | test/cctest/test-profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698