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

Side by Side Diff: test/cctest/test-log-stack-tracer.cc

Issue 1752173003: Additional fixes for external callback logging in profiler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test-log-stack-tracer.cc Created 4 years, 9 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 | « test/cctest/test-log.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 CHECK(!result.IsEmpty()); 173 CHECK(!result.IsEmpty());
174 // When stack tracer is invoked, the stack should look as follows: 174 // When stack tracer is invoked, the stack should look as follows:
175 // script [JS] 175 // script [JS]
176 // JSTrace() [JS] 176 // JSTrace() [JS]
177 // JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi] 177 // JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi]
178 // trace(EBP) [native (extension)] 178 // trace(EBP) [native (extension)]
179 // DoTrace(EBP) [native] 179 // DoTrace(EBP) [native]
180 // TickSample::Trace 180 // TickSample::Trace
181 181
182 CHECK(sample.has_external_callback); 182 CHECK(sample.has_external_callback);
183 CHECK_EQ(FUNCTION_ADDR(i::TraceExtension::Trace), sample.external_callback); 183 CHECK_EQ(FUNCTION_ADDR(i::TraceExtension::Trace),
184 sample.external_callback_entry);
184 185
185 // Stack tracing will start from the first JS function, i.e. "JSFuncDoTrace" 186 // Stack tracing will start from the first JS function, i.e. "JSFuncDoTrace"
186 unsigned base = 0; 187 unsigned base = 0;
187 CHECK_GT(sample.frames_count, base + 1); 188 CHECK_GT(sample.frames_count, base + 1);
188 189
189 CHECK(IsAddressWithinFuncCode( 190 CHECK(IsAddressWithinFuncCode(
190 context, "JSFuncDoTrace", sample.stack[base + 0])); 191 context, "JSFuncDoTrace", sample.stack[base + 0]));
191 CHECK(IsAddressWithinFuncCode(context, "JSTrace", sample.stack[base + 1])); 192 CHECK(IsAddressWithinFuncCode(context, "JSTrace", sample.stack[base + 1]));
192 } 193 }
193 194
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // script [JS] 228 // script [JS]
228 // OuterJSTrace() [JS] 229 // OuterJSTrace() [JS]
229 // JSTrace() [JS] 230 // JSTrace() [JS]
230 // JSFuncDoTrace() [JS] 231 // JSFuncDoTrace() [JS]
231 // js_trace(EBP) [native (extension)] 232 // js_trace(EBP) [native (extension)]
232 // DoTraceHideCEntryFPAddress(EBP) [native] 233 // DoTraceHideCEntryFPAddress(EBP) [native]
233 // TickSample::Trace 234 // TickSample::Trace
234 // 235 //
235 236
236 CHECK(sample.has_external_callback); 237 CHECK(sample.has_external_callback);
237 CHECK_EQ(FUNCTION_ADDR(i::TraceExtension::JSTrace), sample.external_callback); 238 CHECK_EQ(FUNCTION_ADDR(i::TraceExtension::JSTrace),
239 sample.external_callback_entry);
238 240
239 // Stack sampling will start from the caller of JSFuncDoTrace, i.e. "JSTrace" 241 // Stack sampling will start from the caller of JSFuncDoTrace, i.e. "JSTrace"
240 unsigned base = 0; 242 unsigned base = 0;
241 CHECK_GT(sample.frames_count, base + 1); 243 CHECK_GT(sample.frames_count, base + 1);
242 CHECK(IsAddressWithinFuncCode(context, "JSTrace", sample.stack[base + 0])); 244 CHECK(IsAddressWithinFuncCode(context, "JSTrace", sample.stack[base + 0]));
243 CHECK(IsAddressWithinFuncCode( 245 CHECK(IsAddressWithinFuncCode(
244 context, "OuterJSTrace", sample.stack[base + 1])); 246 context, "OuterJSTrace", sample.stack[base + 1]));
245 } 247 }
246 248
247 249
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION); 291 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION);
290 v8::Context::Scope context_scope(context); 292 v8::Context::Scope context_scope(context);
291 CHECK(!i::TraceExtension::GetJsEntrySp()); 293 CHECK(!i::TraceExtension::GetJsEntrySp());
292 CompileRun("a = 1; b = a + 1;"); 294 CompileRun("a = 1; b = a + 1;");
293 CHECK(!i::TraceExtension::GetJsEntrySp()); 295 CHECK(!i::TraceExtension::GetJsEntrySp());
294 CompileRun("js_entry_sp();"); 296 CompileRun("js_entry_sp();");
295 CHECK(!i::TraceExtension::GetJsEntrySp()); 297 CHECK(!i::TraceExtension::GetJsEntrySp());
296 CompileRun("js_entry_sp_level2();"); 298 CompileRun("js_entry_sp_level2();");
297 CHECK(!i::TraceExtension::GetJsEntrySp()); 299 CHECK(!i::TraceExtension::GetJsEntrySp());
298 } 300 }
OLDNEW
« no previous file with comments | « test/cctest/test-log.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698