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_CPP_PROFILES_PROCESSOR | 5 #ifdef ENABLE_CPP_PROFILES_PROCESSOR |
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 29 matching lines...) Expand all Loading... |
40 | 40 |
41 static inline i::Address ToAddress(int n) { | 41 static inline i::Address ToAddress(int n) { |
42 return reinterpret_cast<i::Address>(n); | 42 return reinterpret_cast<i::Address>(n); |
43 } | 43 } |
44 | 44 |
45 static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, | 45 static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, |
46 i::Address frame1, | 46 i::Address frame1, |
47 i::Address frame2 = NULL, | 47 i::Address frame2 = NULL, |
48 i::Address frame3 = NULL) { | 48 i::Address frame3 = NULL) { |
49 i::TickSample* sample = proc->TickSampleEvent(); | 49 i::TickSample* sample = proc->TickSampleEvent(); |
| 50 sample->state = i::OTHER; |
50 sample->pc = frame1; | 51 sample->pc = frame1; |
51 sample->function = frame1; | 52 sample->function = frame1; |
52 sample->frames_count = 0; | 53 sample->frames_count = 0; |
53 if (frame2 != NULL) { | 54 if (frame2 != NULL) { |
54 sample->stack[0] = frame2; | 55 sample->stack[0] = frame2; |
55 sample->frames_count = 1; | 56 sample->frames_count = 1; |
56 } | 57 } |
57 if (frame3 != NULL) { | 58 if (frame3 != NULL) { |
58 sample->stack[1] = frame3; | 59 sample->stack[1] = frame3; |
59 sample->frames_count = 2; | 60 sample->frames_count = 2; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 bottom_up_root_children[2]->children(); | 196 bottom_up_root_children[2]->children(); |
196 CHECK_EQ(1, bottom_up_ddd_children->length()); | 197 CHECK_EQ(1, bottom_up_ddd_children->length()); |
197 CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name()); | 198 CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name()); |
198 const i::List<ProfileNode*>* bottom_up_ddd_stub_children = | 199 const i::List<ProfileNode*>* bottom_up_ddd_stub_children = |
199 bottom_up_ddd_children->last()->children(); | 200 bottom_up_ddd_children->last()->children(); |
200 CHECK_EQ(1, bottom_up_ddd_stub_children->length()); | 201 CHECK_EQ(1, bottom_up_ddd_stub_children->length()); |
201 CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name()); | 202 CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name()); |
202 } | 203 } |
203 | 204 |
204 #endif // ENABLE_CPP_PROFILES_PROCESSOR | 205 #endif // ENABLE_CPP_PROFILES_PROCESSOR |
OLD | NEW |