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

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

Issue 2083005: CPU profiler: add secure profiles by filtering out functions using security tokens. (Closed)
Patch Set: Reworded comment Created 10 years, 7 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-log-stack-tracer.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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 ToAddress(0x1200), 107 ToAddress(0x1200),
108 0x80); 108 0x80);
109 processor.CodeCreateEvent(i::Logger::STUB_TAG, 5, ToAddress(0x1300), 0x10); 109 processor.CodeCreateEvent(i::Logger::STUB_TAG, 5, ToAddress(0x1300), 0x10);
110 processor.CodeCreateEvent(i::Logger::BUILTIN_TAG, 110 processor.CodeCreateEvent(i::Logger::BUILTIN_TAG,
111 "ddd", 111 "ddd",
112 ToAddress(0x1400), 112 ToAddress(0x1400),
113 0x80); 113 0x80);
114 processor.CodeMoveEvent(ToAddress(0x1400), ToAddress(0x1500)); 114 processor.CodeMoveEvent(ToAddress(0x1400), ToAddress(0x1500));
115 processor.CodeCreateEvent(i::Logger::STUB_TAG, 3, ToAddress(0x1600), 0x10); 115 processor.CodeCreateEvent(i::Logger::STUB_TAG, 3, ToAddress(0x1600), 0x10);
116 processor.CodeDeleteEvent(ToAddress(0x1600)); 116 processor.CodeDeleteEvent(ToAddress(0x1600));
117 processor.FunctionCreateEvent(ToAddress(0x1700), ToAddress(0x1000)); 117 processor.FunctionCreateEvent(ToAddress(0x1700), ToAddress(0x1000),
118 CodeEntry::kNoSecurityToken);
118 // Enqueue a tick event to enable code events processing. 119 // Enqueue a tick event to enable code events processing.
119 EnqueueTickSampleEvent(&processor, ToAddress(0x1000)); 120 EnqueueTickSampleEvent(&processor, ToAddress(0x1000));
120 121
121 processor.Stop(); 122 processor.Stop();
122 processor.Join(); 123 processor.Join();
123 124
124 // Check the state of profile generator. 125 // Check the state of profile generator.
125 CodeEntry* entry1 = generator.code_map()->FindEntry(ToAddress(0x1000)); 126 CodeEntry* entry1 = generator.code_map()->FindEntry(ToAddress(0x1000));
126 CHECK_NE(NULL, entry1); 127 CHECK_NE(NULL, entry1);
127 CHECK_EQ(aaa_str, entry1->name()); 128 CHECK_EQ(aaa_str, entry1->name());
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 0x80); 170 0x80);
170 EnqueueTickSampleEvent(&processor, ToAddress(0x1210)); 171 EnqueueTickSampleEvent(&processor, ToAddress(0x1210));
171 EnqueueTickSampleEvent(&processor, ToAddress(0x1305), ToAddress(0x1220)); 172 EnqueueTickSampleEvent(&processor, ToAddress(0x1305), ToAddress(0x1220));
172 EnqueueTickSampleEvent(&processor, 173 EnqueueTickSampleEvent(&processor,
173 ToAddress(0x1404), 174 ToAddress(0x1404),
174 ToAddress(0x1305), 175 ToAddress(0x1305),
175 ToAddress(0x1230)); 176 ToAddress(0x1230));
176 177
177 processor.Stop(); 178 processor.Stop();
178 processor.Join(); 179 processor.Join();
179 CpuProfile* profile = profiles.StopProfiling("", 1); 180 CpuProfile* profile =
181 profiles.StopProfiling(CodeEntry::kNoSecurityToken, "", 1);
180 CHECK_NE(NULL, profile); 182 CHECK_NE(NULL, profile);
181 183
182 // Check call trees. 184 // Check call trees.
183 const i::List<ProfileNode*>* top_down_root_children = 185 const i::List<ProfileNode*>* top_down_root_children =
184 profile->top_down()->root()->children(); 186 profile->top_down()->root()->children();
185 CHECK_EQ(1, top_down_root_children->length()); 187 CHECK_EQ(1, top_down_root_children->length());
186 CHECK_EQ("bbb", top_down_root_children->last()->entry()->name()); 188 CHECK_EQ("bbb", top_down_root_children->last()->entry()->name());
187 const i::List<ProfileNode*>* top_down_bbb_children = 189 const i::List<ProfileNode*>* top_down_bbb_children =
188 top_down_root_children->last()->children(); 190 top_down_root_children->last()->children();
189 CHECK_EQ(1, top_down_bbb_children->length()); 191 CHECK_EQ(1, top_down_bbb_children->length());
(...skipping 26 matching lines...) Expand all
216 bottom_up_root_children[2]->children(); 218 bottom_up_root_children[2]->children();
217 CHECK_EQ(1, bottom_up_ddd_children->length()); 219 CHECK_EQ(1, bottom_up_ddd_children->length());
218 CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name()); 220 CHECK_EQ("5", bottom_up_ddd_children->last()->entry()->name());
219 const i::List<ProfileNode*>* bottom_up_ddd_stub_children = 221 const i::List<ProfileNode*>* bottom_up_ddd_stub_children =
220 bottom_up_ddd_children->last()->children(); 222 bottom_up_ddd_children->last()->children();
221 CHECK_EQ(1, bottom_up_ddd_stub_children->length()); 223 CHECK_EQ(1, bottom_up_ddd_stub_children->length());
222 CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name()); 224 CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name());
223 } 225 }
224 226
225 #endif // ENABLE_LOGGING_AND_PROFILING 227 #endif // ENABLE_LOGGING_AND_PROFILING
OLDNEW
« no previous file with comments | « src/profile-generator-inl.h ('k') | test/cctest/test-log-stack-tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698